Orangeman Burns - Sriram Sridharan's Blog

Orangeman Burns is a blog written and maintained by Sriram Sridharan, under his nick “sriraminhell”, at http://www.sriraminhell.com. He primarily writes about technology, gadgets and gizmos and also blogs hacks, tips and tricks about bringing tech to the masses.


Orangeman Burns has tied up with TradePub to jointly offer free magazine subscriptions, white papers and ebooks. Click here to go to the co-branded offer site. Yes, you read that right, they are totally free. No strings attached. No matter what country you're from I'm sure we have something for you. Happy reading!!



I'm sure that you would have, at one time or another, felt the need for a portable Operating System that you could carry around with you and to help troubleshoot and backup your friends' crashed PCs. There are several Live CD based Linux distributions[distros] where you just slide a CD in, boot from it and enjoy the new OS. But what if you need your Data and settings to be remembered[also called persistence]. A good alternative is to use a Live USB based OS. So here's a small guide for getting a small OS up and running on a USB flash drive.

There are three major requirements that we need to consider:

  • Size of USB drive
  • Type of Distro
  • Usage

With drives of 1GB storage becoming common it's very easy to install a Live OS. Distros like Damn Small Linux and Puppy Linux will perform admirably in 128MB drives. Some OSes section off a portion of your computer's memory[RAM] and use that as a drive, in addition to the flash drive.

In this example, I'm using a Sandisk Cruzer 1GB USB drive.
I've formatted it to FAT32 like so:


Formatting an USB storage device

*Back up your data before formatting as the data will be erased*

  1. Right click the drive in Windows
  2. Select format
  3. Select the File System as Fat32
  4. Check the "Quick Format" option

We are going to use an application called UNetbootin to install the Linux distro into the flash drive. We can either let the program download a distro or select the image file[.iso] of an already downloaded distro. Download UNetbootin here: http://unetbootin.sourceforge.net/ and install it.

I'm using the Boxpup version of Puppy Linux as my distro. Download it from BitTorrent if you are LEET enough[One of the more legitimate uses of BitTorrent :)] or get it from the official site here: http://www.puppylinux.org/ . Download for Boxpup version: http://www.puppylinux.org/downloads/puplets/boxpup

Refer to my tutorials on BitTorrent if you need help downloading:
http://www.sriraminhell.com/2007/08/p2p-brief-introduction.html
http://www.sriraminhell.com/2007/08/peer-to-peer-ii-bit-torrent.html

The downloaded file will be an .ISO file. The important thing to note here is to make sure that you have downloaded the file correctly. So we're going to verify the authenticity of the downloaded iso. So get the MD5 hash from the place you downloaded. If you got it from BitTorrent, it's the text file with MD5 in the file name. If you got it from the site, it will be listed in the download page itself. Select the whole MD5 hash and copy it using ctrl-c.

Now install this MD5 hash checker called HashTab from here: http://beeblebrox.org/hashtab/. After you finish installing HashTab, right click the downloaded iso file, select properties. You'll see a tab called file hashes. Select the tab and wait for it to calculate the file hashes. Select MD5 and paste the MD5 hash, that you copied earlier, into the box that reads "Hash Comparison". If your downloaded file in not tampered, you will see a green tick mark in the hash comparison box. If the downloaded iso file is tampered with or has been incorrectly downloaded, you will see a red cross. You should then attempt to re-download the file from another source.


Hash for the iso file downloaded via BitTorrent


Hash for the iso file downloaded from the web


Comparing and verifying the MD5 hashes


Now that your iso file has been verified, it's time to install the OS onto the USB drive. Open UNetbootin and select the Diskimage Radio button and select the downloaded iso file. Now make sure the correct drive letter for your USB drive is selected below.
*It is very important to cross-check this because a mistake here will end up with you formatting one of the partitions in your hard disk.*


UNetbootin screenshot


Now Select Ok and let the program work it's magic. After a few minutes you'll see a dialog box asking to reboot. Click No. Save all your work, eject the USB drive[but leave it in the USB port] and restart the computer.


Extracting files - UNetbootin


Boot Loader Config - UNetbootin


Done - UNetbootin


Before the computer starts up, keep pressing the Del key or the F12 key or whatever key that you need to press to access the BIOS menu. Go to the tab named Boot and change the boot disk priority so that the USB drive is booted first. Hit F10 to save and reboot. After the computer reboots, you'll see the UNetbootin menu. Select Puppy. Now you'll be asked a "one-time" set of questions to determine the setup of your computer. Questions like if your mouse is connected via USB or PS/2 and the Keyboard layout and so on. Select the Xorg display when it prompts and choose a resolution that's native for your LCD screen. Typically it's 1024x768 for 17" CRT monitors with a 4:3 aspect ratio. Select a mode ending with x24[Color Depth].

Now your OS should have started up. Use the network wizard from the desktop[right click menu for Boxpup users] to configure your Internet connection. Click ETH0 when your Ethernet card is selected and click Auto DHCP for a one click configuration. Then use the ALSA wizard to setup the Audio. Most of the wizards are very easy to use. They require only a "Yes" or "No" choice and most ofter a recommendation is also displayed. Your OS on a USB setup is almost done. When you finish your work, click shutdown and a prompt asks you if you want to save the work onto a a USB drive. Select Yes, select the size as 256 MB for 1GB drives, 128MB for 512MB drives and give it a name. Now all your settings are persistent and will be retained and updated as and when needed.

Screenshots of Puppy Linux 4.1.1 with BoxPup Puplet:


Desktop of Boxpup variant of Puppy Linux


Mounted drives are shown with a green circle in Boxpup variant of Puppy Linux


Task Manager in Boxpup variant of Puppy Linux


Xine Media Player in Boxpup variant of Puppy Linux


Package downloader in Boxpup variant of Puppy Linux


Another shot of the Package manager in the Boxpup variant of Puppy Linux


Repo based package installer in the Boxpup variant of Puppy Linux


Right click menubar in the Boxpup variant of Puppy Linux


File Manager in the Boxpup variant of Puppy Linux


Opera Browser in the Boxpup variant of Puppy Linux


Word processor in the Boxpup variant of Puppy Linux


Spreadsheet processor in the Boxpup variant of Puppy Linux


A word of caution: Check if your Motherboard supports booting from a USB drive. I have a 4+ year old Intel 845 GVSR and it does, so unless your board is pretty ancient it should be able to boot from an USB drive. To check if your board does, go to the BIOS screen and in the BOOT tab see in Boot from USB is an option. If it is present, make sure it's enabled. If it's absent then you'll not be able to use this tutorial.



Bookmark and Share

Related Posts: Doesn't work with Adblock Plus turned on



Reactions:

44 comments:

Anonymous said...

Ubuntu 8.10 includes a utility by default (System > Administration > Create a USB Startup Disk) that will do this for you as well. Just tell it what ISO file to use, what USB drive to use and how much space you want the filesystem to have, and you're set. I think it only works with Ubuntu 8.10 ISO's (or any variant- xubuntu, kubuntu, etc.), but it's worked flawlessly for me and only takes a few minutes.

Paul said...

does unetbootin work with other operating system iso's such as bartpe or ultimate boot cd (windows)?

Orangeman said...

@Paul, I haven't tried it but I will today with Windows XP SP3.

pooja said...

U truly rock sriram and so does your blog!!!

ROCK ON!!

SjAy said...

Nice post ... Can do more experiments on this I guess

Anonymous said...

The snow is annoying... takes cpu cycles for nothing!

Orangeman said...

@Anonymous, your wish is command. Done!! On a more serious note, I didn't realize that the snow was being such a resource hog. Just noticed it. Thanks for the heads up. :)

adam said...

Ahhh I wish I'd read this earlier! Thanks

Richard said...

Nice post, I've heard about installing an operating system on a usb drive but really haven't tried doing it personally. Thanks for the additional info. If you do have time you can also visit my blog at free seo tips and tricks

Orangeman said...

Thanks Richard!

Roxas said...

does it work for windows xp or windows 7?

Pritch said...

I can't get this to work. I followed the instructions to the letter but when I restart the system and choose to boot from the USB I get a brief line of text saying that it can't find linux followed by a prompt. Any ideas?

Orangeman said...

@Roxas, This is for Linux distros. you'll have to use Bart PE for Windows OS'es.
@Pritch, The installation/system files for the Linux OS on the USB drive are probably corrupt. Try formatting the drive and installing again. If you get the same error, try checking the hashes for the source distro's iso file. The method is detailed in my post. Cheers!!

Pritch said...

Thanks, but I already tried all of that. The message is regarding the kernel - could not find the Linux kernel? I'll try again and take a note of the full message if it doesn't work. I'm doing everything exactly the same; same o/s, same has check - I'm even using a SanDisk Cruzer 1gb! I'll get back to you...

Orangeman said...

@Pritch, have you removed the Launch Pad thingy that comes default with Cruzers? Can you try with a different pendrive?

Pritch said...

It still did the same thing. Here's the message in full;

SYSLINUX 3.72 2008-09-25 CBIOS Copyright (C) 1994-2008 H. Peter Alvin

Could not find kernel image: linux

boot: _

The last part is a command prompt. I have another USB memory stick so I'll try that.

Orangeman said...

@Pritch, did you check the authenticity of the distro? May be you could try another flavor. Keep me posted mate!

Pritch said...

Yes, I checked the authenticity and it was fine. I've used the latest version of puppy as well with the same result. I am about to try installing on a 4gb Lexar Firefly. If boxpuppy doesn't work I'll try an alternative - ubuntu perhaps. I'll let you know - thanks for helping :o)

Orangeman said...

@Pritch, Anytime mate. Do let me know how it goes. :)

Pritch said...

Success! I'm writing this from the Opera browser in my newly installed boxpuppy OS. My Cruzer flash stick must have been faulty. I now have a highly portable OS and will be proudly showing it off to all my mates! Thanks again for your assistance.

Orangeman said...

@Pritch, Glad it all worked out. Cheers!!

Anonymous said...

I Have a question. I recently purchased a 16G USB drive. For the last step you said for 256mb you use 128 and so on. So for a 16G what would it be. (FYI i didn't purchase it for running an operating system it was to back up stuff, But i purchased another one, so i am going to install Windows 7 on the usb.) Which i need your help in doing.

sashavol said...

Can you download stuff on this while it is on the usb stick?

Orangeman said...

@Anonymous, The size is determined by the amount of usage your live USB OS. I'd say 1GB-2GB should be more than enough for occasional usage. I have not tried installing Windows 7 on an USB drive. The Windows 7 install is about 2.5GB and is still in beta. So one cannot predict it's behavior when loaded onto a removable media. Also I dont think there is a Bart PE or similar program to install Windows 7 on an USB drive. That said, if you can find one, please dont hesitate to comment here. Cheers!

@sashavolm, Yes. I've tried downloading stuff via HTTP and P2P(BitTorrent) and both worked admirably. Constant downloading onto an USB device might reduce its life span though.

Anonymous said...

Siramin, I tried the whole process 2 times (including hash both times). When booting to the usb I select puppy and it starts to load, but it hangs at "Performing a 'switch_root: to the layered filesystem...". Any advise? I did follow every step (2x).
Keith

projectautomatika said...

Will be trying this one. Thanks!

ArpitNext said...

Hi! A nice article for newbies :)

I use SLAX and it works great with my usb stick .

Anonymous said...

Siramin, Tried another jump and it worked like a charm. Formatted the 128 jump but no luck. What do you expect for free stuff.
Thanks for your work,
Keith

Anonymous said...

Hi

I tried your way and installed on my 1gb drive successfully but after restart it gave me an error. After restart i got two options: Default and Puppy. I tried both but after about 3 or 4 'Done' msgs it says "'Kernel...' and screening: kernel kill init." don't remember exactly what is that. Please suggest how to do it?

Anonymous said...

hi
i think exactly that was this error:
Kernel panic – not synching: Attempted to kill init!

AB

Orangeman said...

@Anon, These forum threads say that it might be due to a hardware incompatibility, more specifically due to the HDD/Raid cards:

http://www.linuxquestions.org/questions/mandriva-30/kernel-panic-not-synching-attempted-to-kill-init-558129/

http://www.linuxquestions.org/questions/linux-kernel-70/kernel-panic-not-syncing-attempted-to-kill-init-589245/

Could you try the existing setup on another PC to rule out a problem with the USB device or the kernel itself? Also, maybe you could install a distro like Ubuntu that has better compatibility, on the pen drive. Cheers!

Ian R said...

I followed everything word for word (the install went sucessful)... Though when I re-start and try to boot I see the USB option to boot from and on my other computer I see "Sony", I installed this OS on a 1gb Sony stick and I keep getting a

"Remove disks or other media.
Press any key to restart"

when ever I try to boot from it.

It then boots onto my regular OS.

Please help.

Orangeman said...

Hi Ian, Can you tell me if your Motherboard allows you to boot from USB drives?

Will said...

Just thought I'd let you know this worked great with my SUPER TALENT Pico_C 8GB Flash Drive and the Ubuntu 8.10 AMD64 Desktop iso. It's great that I didn't have to format the flash drive to ext/reiser so I can still carry files and portable windows apps on the same USB stick. Thanks for the HOWTO. One question/problem though, is there a simple way to increase the size of the squashfs / beyond 1.5GB? I ran out of space in a hurry doing `apt-get dist-upgrade`.

Orangeman said...

Hi Will. Since I have absolutely no experience with Ubuntu installs on a USB drive I am unable to help you. I suggest that you mail the developer here: http://squashfs.sourceforge.net/ or ask here: http://ubuntuforums.org/ or here: http://www.ubuntu.com/support/community/webforums

JEEVANANDAM MANICKAM said...

Nice, Thanks for the Guide, It Really works fine, but i had faced a problem of lock screen what is the default Password to unlock the screen? i have not set any password.. but its not allowing to get in once the screen got locked...Kindly Help.... Thanks in advance

Orangeman said...

Hi, Have you tried directly hitting the return key without entering any text in the password box? If that doesn't work, set a password, save it and then change it back to blank. That should work. Cheers!

JeFF said...

indeed very useful.

Anonymous said...

This is truly nice, good work. I enjoyed doing this too, I might have to dawdle around with this some more. Nice [TUT], Love it helped a lot.

satish said...

hi sriram garu nice job,really interesting stuff ,i try it soon on my pen drive.

salvador said...

I tried and it really works but I don't know if it will work on other computer. Because of some of the comment. Those who tried and failed please look to your BIOS.

Anonymous said...

I't did not work because maybe I had a old computer.

Anonymous said...

Hello there,

This is a nice post,
But I have a problem My motherboard says something like removable drive in BIOS.

I did your procedure and also the DSL procedure but no luck,
Give me some more distros which can work on slower machines.

With Regards
Harsh Jain

printer cartridges said...

This is great thing. I have never imagine before that i can bring OS in my usb flash drive.

Post a Comment

Comment here.. No spam..


AnooX Local UK 62-151 Media Group - Directory Listing Blog Directory Blogging Fusion Blog Directory & Search engine
Blog Directory
Technology blogs Technology Free Domains Forwarding Blogarama - The Blog Directory Blog Roll
DigNow.net Visit blogadda.com to discover Indian blogsTechnology blogs