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:
*Back up your data before formatting as the data will be erased*
Right click the drive in Windows Select format Select the File System as Fat32 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.
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.*
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:


























44 comments:
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.
does unetbootin work with other operating system iso's such as bartpe or ultimate boot cd (windows)?
@Paul, I haven't tried it but I will today with Windows XP SP3.
U truly rock sriram and so does your blog!!!
ROCK ON!!
Nice post ... Can do more experiments on this I guess
The snow is annoying... takes cpu cycles for nothing!
@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. :)
Ahhh I wish I'd read this earlier! Thanks
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
Thanks Richard!
does it work for windows xp or windows 7?
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?
@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!!
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...
@Pritch, have you removed the Launch Pad thingy that comes default with Cruzers? Can you try with a different pendrive?
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.
@Pritch, did you check the authenticity of the distro? May be you could try another flavor. Keep me posted mate!
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)
@Pritch, Anytime mate. Do let me know how it goes. :)
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.
@Pritch, Glad it all worked out. Cheers!!
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.
Can you download stuff on this while it is on the usb stick?
@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.
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
Will be trying this one. Thanks!
Hi! A nice article for newbies :)
I use SLAX and it works great with my usb stick .
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
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?
hi
i think exactly that was this error:
Kernel panic – not synching: Attempted to kill init!
AB
@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!
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.
Hi Ian, Can you tell me if your Motherboard allows you to boot from USB drives?
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`.
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
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
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!
indeed very useful.
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.
hi sriram garu nice job,really interesting stuff ,i try it soon on my pen drive.
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.
I't did not work because maybe I had a old computer.
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
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..
Post a Comment
Comment here.. No spam..