Installing a portable Ubuntu Linux in a USB Thumbdrive

I couldn’t wait for the price of 32GB USB thumb drive to come down and decided to get one. I think the current size of most USB drive is way more than enough for the average Joe’s but not for power users like me! It seems like Moore’s Law don’t seem to apply for the USB thumb drive anymore if there is a lower demand for more storage space in USB drive. It now takes ages for the prices to come down for USB drive and if you compare with say a portable hard drive, it sure is lagging behind!

SanDisk Cruzer - micro and standard.

Anyway, I bought myself the SanDisk Cruzer 32 GB, this was different from my SanDisk micro Cruzer 16 GB, as this one does not have U3 capability. Though I find the U3 feature rather useful in securing the thumbdrive content, not many people like to use it, so again due to demand and supply it is not easy to find a U3 thumbdrive. For securing files, SanDisk provides a software solution calling it the SanDisk Secure Access. I find SanDisk Secure Access to be less useful as I am not able to sync the file in the secure mode tuck away in a encrypted vault unlike using the U3 where the files acts like files and after ejecting, the U3 will lock the thumbdrive. Anyway, I found another solution using TrueCrypt so no problem for me.

Meanwhile, 32 GB of storage space (actually you get about 29 GB due to the way the bytes are calculated) is rather ample and I decided to make my thumb drive work a little harder. Instead of carrying a bulkier portable drive with Ubuntu Linux installed, using a USB thumb drive with Ubuntu installed inside would be far handier.

To prepare the thumb drive to boot up Linux requires partitioning preparation. You can’t use Windows to do the job. In fact, Windows is not able to recognize partitions in a thumbdrive, which makes me wonder why such a powerhouse like Windows (even the latest Windows 7) is so lacking. This is where Linux shine when it comes to efficiency and effectiveness. Just too bad it needs to get more polished to increase its user base and software supplier base.

Do note that the Windows storage partition must be on the first section or Windows won’t be able to find it as Windows cannot read more than one partition in the USB drive.

Partitioning the USB Thumb drive

To do all the preparation, you will need to boot up Ubuntu Linux live CD and fire up the Gnome Partition Manager or Gparted for short. This is the best partition manager that I have found so far ever since I learned about partition management way back when I was using PowerQuest Partition Manager. However, Gparted has a quirk. Could be due to the Linux kernel itself. I have a set of RAID drives and it could not access the partition and instead read each individual drive instead and reported them as unknown partition. Hmmm… maybe the kernel couldn’t recognize the old RAID card that I was using on one my old PC. Anyway I don’t use RAID nowadays.

Gparted can resize the partition without clearing out your data. Of course the more data you have in your partition the slower the partitioning. Starting out clean would speed up the process a lot. Another one up of using Gparted against Windows Disk Manager, you can actually get to specify whether you want to create a partition as primary or in extended mode. Windows Disk Manager don’t really give you this option and assumes all new partition are to be created in the extended volume. And of course using Gparted you could format it with NTFS, FAT 32, or its native Linux EXT format. And if you install additional module you could install other file formats apart from the those mentioned. Really handy!

How much storage space allocation for Ubuntu Linux?

The main purpose for my 32 GB SanDisk Cruzer USB drive is to store data. Unlike say a portable drive where you don’t have to worry about space constraint. On a 32 GB, you may want to have an efficient usage of data storage and Linux. The minimum required for Ubuntu is about 4 GB, the completed basic installation takes up about 2.5 GB of storage space and the extra is for additional software and data stored in the Linux format. I found I needed to allocate about 5 to 6 GB to cater for additional application software that I would install and make the portable Ubuntu Linux much more usable. After adding up the additional application software, my Ubuntu Linux has used up 3.5 GB leaving about 2 GB for future further expansion.

And what about the Linux Swap space size?

The basic rule of thumb is 2 times the memory of your computer memory. Digging around the internet, this idea was basically more for server installation. Linux is very memory efficient compared with Windows, and hardly ever need to swap any data onto the swap file. For a portable drive, I allocated about 4 GB mirroring my desktop PC RAM memory since portable drive got so much space available. However for a Linux workstation PC, you don’t really need much. And I came across some discussion that said they didn’t even need a swap space. Initially I went for 1 GB of swap file space in my SanDisk Cruzer, but checking with the Linux system monitor, hardly any data was written into the swap file space. So I decided to reduce the size to about 512 MB instead just in case I needed some swap space.

So this is what I ended up with:

USB thumb drive primary partitioning with Windows, Linux and Linux Swap

sdx1 — Windows – 24 GB
sdx2 — Ubuntu – 5.5 GB
sdx3 — Swap Space – 512 MB

Once got your partitioning done, you could proceed with installing Ubuntu Linux. To speed up the installation process, unhook your internet connection. You could always install the updates later. What you want is to quickly install Ubuntu asap and fire it up and see your handy work in action!

Once your GRUB 2 is installed in the MBR and all other installation is done. It is time to fire it up! If you feel you need to adjust your partitioning to suit your storage/linux requirement, do be careful as it might damage the GRUB boot loader (which unfortunately I did damage mine and had to reinstall GRUB 2 using command line to fix it).

The Ubuntu Linux has proven to be very robust and was able to run in the several desktop PC’s, laptops and netbook that I have. As I was using Ubuntu 11.04, the Unity desktop only had one hiccup on one of my older Pentium 4 PC due to lower video graphic card hardware specification. I was still able to run it on the classic interface. Frankly speaking, I still liked the older Ubuntu classic GUI, the newer Unity desktop needs a more powerful graphic card and sometimes I felt that it was a little laggy. Not sure it is because I install my Ubuntu onto my USB thumb drive is one of the contributing reason as well too.

By installing my Ubuntu Linux into my thumb drive, I could dispense with having to install Ubuntu on each of my computers. It helps to save me time from having to install the same application on each of the computers. Now I just need to install the software applications into this little handy thumbdrive and I’m good to go on any of the PC’s!

Related post:
Dual Boot Ubuntu and Puppy Linux in USB pendrive

2 thoughts on “Installing a portable Ubuntu Linux in a USB Thumbdrive”

  1. hi, i tried to install Ubuntu 11.10 on my sandisk jump drive (i did the partitioning and everything) but when i boot it up GTK/Unity won’t work. woul you happen to know why?

Leave a Comment

Your email address will not be published. Required fields are marked *

Blue Captcha Image


This site uses Akismet to reduce spam. Learn how your comment data is processed.