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

UNetbootin Main Window

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

Read also:  Canonical Looking for user input on software selection for Ubuntu

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

PCLinuxOS Minime

And that's it.

Please share this article

Facebooktwittergoogle_plusredditlinkedinmail



Responses to Install Linux on a USB drive with UNetbootin

  1. **Juanito** December 17, 2008 at 12:36 am #

    Very useful. I use MySlax to create USB bootable Linux.
    Greetings

  2. SantAnna December 17, 2008 at 3:44 am #

    I think you have to format the pendrive before using UNetbootin.

  3. Scikotic December 17, 2008 at 3:46 am #

    I have a question. Has anyone used UNetbootin to create a USB key with multiple Anti-Virus rescue CD's loaded onto it? I think this would be a great project.

  4. jack December 17, 2008 at 5:09 am #

    SantAnna,

    I did a test on a usb drive without doing any formatting. I can not say if it had been pre-formatted, but i did no formatting and the install went fine.

  5. Kislay Kishore December 17, 2008 at 7:30 am #

    It worked!!!

  6. Matthias December 17, 2008 at 8:07 pm #

    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?

  7. Rupert December 17, 2008 at 11:21 pm #

    @ 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?

    Questions questions, anyone got any answers?

  8. Artie December 20, 2008 at 4:00 pm #

    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.

    Artie

  9. blogger blake December 22, 2008 at 5:53 pm #

    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.

    • WAGGERBLAKE January 19, 2010 at 1:49 pm #

      BLOGGER BLAKE FORGOT to mention that you can download MOBALand it will run your Linux ISO ,Works well with DSL,PUPPY etc....yours Wagger Blake...

  10. alan March 2, 2009 at 3:45 am #

    can i use this program to make the usb device multi-boot many distros i have a 16GB corsair flash drive

  11. Dr OM March 27, 2009 at 6:44 pm #

    Very useful. My only problem is hardware issues. My wi-fi card and ethernet card are non standard and I have problems connecting to the internet. Is there a workaround for this.

    (using a smell....er Dell system)

  12. ov3rh3at March 27, 2009 at 8:07 pm #

    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.

  13. axl456 March 29, 2009 at 5:01 pm #

    @alan: thats more dificult than it sounds sadly..

    Right know am trying to do it, and fail to succesfuly install the GRUB on the flashdrive..

    am installing debian on the flashdrive now and crossing my fingers hoping it will work, so then i just edit the menu.lst of the grub to add more distros..

  14. Petar May 17, 2009 at 10:50 pm #

    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! ;) :)

  15. Jetchisel November 25, 2011 at 1:59 am #

    The OpenSuSE way.

    http://jason.ferrer.com.ph/2011/08/opensuse-on-usb-reloaded_16.html

  16. anil March 24, 2012 at 5:45 pm #

    while installing linux..it asks me for driver disk image...can anyone tell me what is this and from where i can found tht...i have acer aspire one aohappy netbook ..

Leave a Reply