Hi there folks,
Is it just me or is the idea of installing an Operating System to a USB pen just amazing. No matter how long I think about it, it doesn’t get boring. Laptops? Netbooks? If it’s portability you’re after, then how about an Operating System and all of you files in your pocket? Cool ! It’s a bit like planes – No matter how long I watch them for, I still wonder how they stay in the air… they go so slowly!
Tutorial
OK, so here’s my tutorial on how to install Linux onto a Memory stick. For this excercise, you’ll need a large USB stick – I have used a 16GB stick, but that is because I want to have my videos and music with me. An 8GB will do, and you’re pushing it at 4GB, which is only slightly larger than a basic Linux installation + OpenOffice, Firefox etc etc… Next, you’ll need a LiveCD of the Linux distribution of your choice. I used Fedora. See below for instructions. That’s it!
- A USB memory stick with preferably at least 8GB capacity – they’re really cheap these days!
- A Live CD of your favourite Linux distro
- A computer to do the installation on
Step 1
Insert the USB stick into your PC. IMPORTANT: Make sure that there are no files on the USB stick, they will be lost. The intention for my USB stick is to have some space to store music and video that I can share with other people. Other people may not be using Linux, so we need to create an area (or partition) that will allow the other PC’s to see some area of the USB stick. So I opted to divide my 16GB USB stick into: 9GB Linux filesystem (ext3) and 6GB multi platform compatible (NTFS). Note FAT16 has a 2GB size limit, and FAT32 has a 4GB size limit. Luckily the NTFS support is now very good in the Linux world, so I opted for that. So on my PC, I used “gParted“, the Gnome disk partitioning application to make these partitions.
So we can see that I have divided the 16GB into 8.79GB of ext3 and 6.15GB of NTFS. gParted is a great application, which I recommend to everyone.
Step 2
Once that is complete, the next instruction is to download the latest LiveCD image from the distro website. I wanted to install Fedora KDE onto my PC, so went to their website: http://fedoraproject.org/en/get-fedora-kde and downloaded the iso file.I then used k3b to burn the image to a CD:

Step 3
Once the CD is ready, reboot your PC, leaving the CD in the CD/DVD-rom. Also, make sure your USB stick is plugged in. When your PC starts up, be ready – you’ll need to tap the key that it states is used to choose the boot device. It’s sometimes F12 but changes from PC to PC. Select CD/DVD-ROM from the menu. Your PC will now boot up the LiveCD version of your chosen Linux Distro. We’re making progress!
Step 4
OK, once you’re into the desktop, there should be “install now” or similar sitting on the desktop, or in a menu somewhere obvious. You should be given an installation application, similar to the one Fedora produce:
Please, please do make sure that you’re careful here, as you will, at some point be asked which hard drive you want to install to. Disclaimer: You have been warned! Take a mental note of the capacity of your USB stick, and the name of it too. The intention is to install to the ext3 partition you set up earlier. Fill in all the details, then you will be prompted to restart your PC. when it turns off, Please tap the button again to choose the boot device.
Step 5
With any luck, your USB memory stick device will be listed, either on its own, or in the HDD sub menu. Select it, and fingers crossed, you will now be booting the Linux distro of your choice from the USB stick. We’re almost done !
Step 6
My final advise is to update your software packages after the first boot, it will contains the latest and greatest iterations of open source software.
………………….
I hope that this helps you, even if it answers your question of whether or not it can be done, or maybe one or two important tips along the way?
Any comments, questions or feedback, post below !






Comments
Hi!
I’ve been trying to do these but when I tried at Ubuntu it made my computer unable to boot without the USB stuck to it because it installed grub into the pc’s MBR. How can I avoid these? And by the way, is it possible to access the NTFS partition from the Linux distro? I really want the whole USB space.
Hi Hector,
It’s unfortunate that the install affected your PC’s hard drive – it seems you have to be extra careful using the GUI installer to deselect all hard drives, leaving only your (unmounted) USB stick selected. Anyway, so the grub has been installed to your PC’s mbr.. Going forward I’m happy to help if I can, but need to clarify one or two things. If you boot from your hard drive without the USB stick inserted, does it pop up with the grub command line interface? I’m guessing so, but may be wrong. If so, just a few commands using the grub command line will fix your grub config, and allow you to boot. Just a few things I need to know first of all… how many hard drives do you have? And on these, how many operating systems do you have? and within each hard drive, how many partitions? The reason for this is because the last thing we want to do is install grub onto, lets say, a Windows partition – it will break that too. But don’t worry, I’ve recovered grub in the past so let me know your setup and we’ll take it from there. Next, yes – you can access ntfs partitions by default now in recent distro releases – which is good news! The benifit of having the ntfs partition is so that it can carry your files to a Windows system to read/write data to your USB stick. If you’re never going to use that partition though, then I suggest ext3 across the whole USB stick – be good to your Linux install with all the space you can give it. If you are too tight with the OS disk space, this will cause issues with, for example, temporary files. For example if you’re doing a distro upgrade (to Jaunty when it is released), it will need to store the packages first of all (in /tmp I think), then install. So be as generous as you can.
Thanks.
Don’t worry about the grub, I am not that rookie about installing linux in computers I’ve been using ubuntu constantly for the past 2 years, however I am kinda new to install into USBs. My computer, where I am doing the process, has one single hard drive which is divided into vista partition for the system, main partition for the files and some unallocated space I was planning for Ubuntu or my long trying of not so friendly slackware. But since I only used this computer for very few things and my laptop for everything I left it that way. Now that my laptop is dead and my final exams and projects at the turn of the corner I need to manage and take my files and code with me. That is why I’ve been trying to virtualize xp into a usb (since I need visual studio), but being unable/insecure/unusable as it seems to be I am trying to carry ubuntu (or any other disto I can) into the usb and virtualizing xp just for visual studio. I will try now your instructions as it says and will unplug my HD to make sure I don’t lost the info for my homeworks and projects. Will keep you posted.
Best regards.
Hi, is persistence possible in this solution
Great Idea. I was trying to achieve something similar with the Live USB installation, when I bumped into your post. My goal is to have my portable Linux desktop in a USB and that I can boot in may different machines.
However, with your method, it seems like drivers will be an issue…. hoave you experienced any issues with that? drivers changing constantly when moving from system to system?
I like the idea of hosting all my data in the Internet cloud (i.e. hosted email, hosted docs, delicious.com bookmarks, and even leverage something like Dropbox for storing some files) and have a “netbook – OS” without the netbook.
@Leoboulton
Regarding the graphics drivers – Fedora 13 does a better job than 12 at automatically configuring graphics support without an xorg.conf file. I definitely recommend that you do not setup any proprietary drivers (e.g. nvidia) because you won’t get a successful X server when you’re not using one of their chipsets. Just let Fedora work it out.
And yes – I use my USB installation for lots of things, it’s in my pocket just now. I use it to recover Linux PC’s (including my own), booting corrupt Windows installations to extract important user files, and when using friends laptops when I don’t want to use their virus ridden OS’s. If you use Fedora 13, you’re likely to have access to most wireless chipsets with the 2.6.31 kernel, too.
My only advise is not to update software on it. It’ll use most of your persistent storage, leaving no room for user documents like videos. My USB installation is Fedora 12, and have no problem leaving it this way for a couple of years.
@Hector
Exactly the same thing happened to me. BTW, virtualizing Windows from a USB with Ubuntu sounds interesting.
@Leoboulton&@Rob
I have installed Ubuntu on a 4GB USB and I have had no major issues running it on many different laptops. The only thing is that Skype might not work properly on some (as usual), but graphics and audio are usually fine. Install Dropbox and u will have all files synchronized!
I am trying to install Ubuntu on an encrypted partition (for work) in a 16GB USB. I am struggling with the guided partitioning of Ubuntu. How would you recommend to install Ubuntu in a similar way as u did with Fedora?
PS: I have NO CD drive and I run only windows on my laptop since partitioning it is not an option (long story).
Hi: I greatly appreciate you posting this. I found no other useful posts regarding how to install Fedora to a USB flashdrive (I mean actually install, not just create a Live flashdrive). I am a unix novice. I followed your instructions above, but since you do not provide details about how to use the installer, I would like to fill in a few details from my experience that may be useful to other novices. I first downloaded Fedora 14 ISO and burned to a DVD. From Windows 7, I used Acronis Disk Director to create two 4 Gb primary NTFS partitions on a Patriot 8Gb USB flash drive. I did this because I know how to use Acronis, I’m not very comfortable with unix tools. I then booted the Live Fedora 14 disk. I ran the Install to Hard Drive. At Storage Devices screen, I selected Basic Devices (take note, because I’ll come back to this later). At Disk Partitioning screen, I selected Create Custom Layout (also take note of this because I’ll refer back to this later also). I then selected the 1st partition on the USB drive, deleted it, and recreated to same size as ext4, specifying mount ‘\’. The install warned me about not specifying a swap partition, but I ignored. When asked for location of boot loader, I took the default. This was my first mistake. The installer placed Grub on my PC hard drive rather than on the USB drive. I see above from other comments that someone else made the same mistake. However, when done installing, I was still able to boot using the USB. Success. Almost. I quickly found that 4Gb was not quite enough space when I also wanted to try out KDE, so I started to remove applications. I accidently removed something network related. Being a novice, I could not figure out how to repair, so I just decided to start over and reinstall. The second time, I specified that the boot loader should be installed on my USB drive. Unfortunately, when I reinstalled the second time, the boot up stopped with Grub prompt. After much research, I realized that somehow either the master boot record must be corrupted or the device not bootable, etc. I repartitioned in Win7 using Acronis and reran Fedora install. No luck. Still booted to Grub. I then executed a unix dd command to wipe the MBR (dd if=/dev/null of=/dev/sdX bs=446 count=1). No luck. Still booted to Grub. I then repartitioned the entire USB drive in Fedora (Live environment) as one primary partition, specifying ‘no partition’ (and set flag to not bootable). I then reran Fedora install. This time, no Grub, but didn’t boot either. After additional research, I realized that I probably should rerun Fedora install using more of the defaults rather than Custom Layout. I got it working again executing the following steps: at Storage Devices screen, I selected ‘Specialized Storage Devices’; I then selected the Basic Storage Devices tab and selected only my Patriot USB drive (this prevents you from making any mistakes with other drives later); I then select ‘Use All Space’ from the Disk Partitioning screen; I modified the layout to shrink the Swap partition to 2Gb and made the root a little over 5Gb; after Writing Changes to Disk, at the Boot Loader screen, I left the default, which this time pointed to my Patriot USB (because I only selected this drive earlier from the Storage Devices screen). When the installer was done, I rebooted from the USB drive with no problems. In summary, somehow I messed up the boot sector. I believe rerunning and letting the installer partition the USB drive corrected the error. Unfortunately, I don’t now have a NTFS partition to share files between Windows and Unix, but I think I’m experienced enough now to redo (with bigger USB drive). Oh, one more thing, I then fixed the MBR on my primary hard drive (where I accidently wrote Grub earlier) by booting Win 7 install disk, selecting Recovery Options and from Command Prompt executing ‘bootrec /fixMBR’ and then ‘bootrec /fixboot’. I highly recommend folks read the Fedora 14 Installation Guide before executing the installer. I learned a lot after I read this. If you have the time, I’d really like to know what I did wrong to cause the USB to boot only to Grub command prompt. I never did figure out why exactly this happened.