Install Linux on a USB drive with UNetbootin

There are so many reasons why having a Linux distribution on a usb drive can come in handy. Fram having a "rescue" OS on your keyring to being able to install a new distribution on your EeePC, a "thumb drive" Linux has many uses. But getting Linux onto a usb drive can't be simple. Right? Wrong. There is a tool, UNetbootin, that makes installing Linux on a usb drive simple.

UNetbootin can be used on either Linux or Windows. In this article, we'll be illustrating the Linux side of things (naturally).

Note of warning: Not all usb installations will work on all machines. This can be an issue with your Bios or your USB drive. If you install an OS that doesn't work, try another. But after all that work, you might wind up with a machine that simply won't boot from a USB drive. You have been warned.

Now, on with the installation.

Getting and using UNetbootin

The first thing to do is download a copy of UNetbootin. For our purposes we'll download the Linux universal install binary (named unetbootin-linux-299). Once that has finished you will need to issue the command chmod u+x unetbootin-linux299 in order to make the file executable. Once the file is executable, su to the root user and issue the command (from the same directory unetbootin-linx-299 is stored) ./unetbootin-linux-299 to see the application running. But you're not ready just yet.

Depending upon your distribution, you might come across an error involving p7zip-full. This might be in your distribution's repositories. If you use Mandriva you can install p7zip but you will not have the full package. If you use Unbuntu you can get p7zip-full with the command apt-get install p7zip-full.

Before you run the application you will need to insert and mount your usb drive. Stick in your usb drive and then issue dmesg to find out where your usb drive is located. Mount that and then issue, as root, ./unetbootin-linux-299. When yo issue the command you will see the UNetbootin window.

UNetbootin Main Window

Once this window is up and running you are almost there.

If you have very specific needs for your distribution you will most likely have an image file downloaded to use. If you do not you can select your distribution from the drop down list. First you select the distribution and then you select the version (or release). NOTE: Unless you have a very large USB drive you will most likely want to use a netinstall version of your distribution.If you do happen to have a large USB drive you can go ahead with a full distribution. If this usb drive is for rescue purposes, or just to have a version of Linux with you at all times, a distribution like PCLinuxOS Minime is a greate choice.

Once the process is done you will have two buttons to click, Reboot and Exit. Don't bother with the Reboot button. Click the Exit button and UNetbootin will close. You can now unmount your drive and reboot your machine to see if the installation works.

When your machine boots you will need to make sure it first boots from the usb device.

If you're interested to see what PCLinuxOS Minime looks like, take a look.

PCLinuxOS Minime

And that's it.

Advertisement

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

About Jack Wallen

Jack has been a technical writer, covering Linux and open source, for nearly ten years. He began as an editor in chief of Linux content with Techrepublic and is now a freelance writer for numerous sites. Jack is also a writer of novels and is currently working on his first zombie fiction!

To use linux as OS recovery, it might be helpful which linux versions could read and write NTFS-Filesystems. I’ve tried to repair a PC with winXP and I have to copy one single file into system32, but several free bootdiscs allow only read NTFS. A linux system which could run on an USB-stick and at the same time could allow to copy that stupid file to the system32-directory, that would be great. Is this possible?

@ Matthias, if you want to create a Windows repair system, just make a UBCD4Win (Ultimate Boot CD 4 Windows) – much more effective I have found.

I was wondering, I’ve been having real problems using a USB Flash drive running a Linux LiveCD (via Unetbootin) to install an OS to a USB Hard drive. It seems it is very hard to install Linux to a USB Hard drive. I finally got it to work with Puppy, but it seems to be so slow. I was thinking of risking it and trying it with DSL instead. Anyone else got any good very minimal sys requirement Distros to recommend to try (I’ve got no CD drive, so it must be able to boot from USB Flash)?

Also, anyone care to mention why you can’t use Unetbootin to install a Distro to a USB Hard drive? It never works – how is it different from installing to a USB Flash drive? Is there any way to install an OS to a USB Hard drive using something like Unetbootin without being in the OS you wish to install?

I installed Puppy Linux 4.1.1 on a 4GB Kingston DataTraveler via the Puppy Universal Installer. When you get to bootloaders use the third one on the list. Went very smooth and Puppy is lightning fast. I have also tried to install many other distros to my USB stick and USB harddrive without success. I’m perfectly happy now booting Puppy from the stick and using the USB hard drive for storage.

Hello.I use QEMU .Dowmload and move it to your flash drive memory stick.Thendownload a Linux iso .1GB is sufficient for puppy or dsl,Move your ISO to your flash drive[probably “f” ]when you then go to your Flash drive,just “Drag” the Iso over the other icon thats there[there will be only the two] then it is EXTRACT what you then get is a “BOOT” ,CLICK ON IT and before you know it Linux is loading,just follow the path it is easy….Well it works for me!…Another site to look at is PENDRIVE LINUX.COM have a look at all the distros and various ways there are .Yours in FlashDriving BLOGGER BLAKE. Hopes this is of help.

Dr OM, you say your computer has a strange smell. i cant see any reason why that would be. what dell computer is it? model? i would suggest if u have to money to use something like the eeepc or some other netbook….some dont have much memory others do.

i know dell did haveproblems with some of there notebooks but that would have been quiet sometime ago.

good luck. unetbootin works fine fo me. im using dell xps notebook. u say that ur cards are non-standard….why not disable the and replace with a usb wifi card?? i hope hope this help in one way or another.

Hi there! I was wondering something… I have 8 GB USB stick, with 3 partitions on it, FAT32 on first and second, and ext2 on third one. I installed Ubuntu 9.04 Live onto second, and Puppy 4.2 live on third pertition. Can I make unetbootin ask me what to boot, Puppy or Ubuntu? Can u please explain how if it is possible? Thanx in advance! Salut from Croatia! ;) :)

About gHacks

Ghacks is a technology news blog that was founded in 2005 by Martin Brinkmann. It has since then become one of the most popular tech news sites on the Internet with five authors and regular contributions from freelance writers.