December 03, 2010

Ultra-portible Linux - i.e. Linux on a stick

Updated Dec 9th 2010 - see below...

I was recently in the market for a new laptop as the old one was slow and the battery was almost done for. That laptop now services mainly as a portable DVD & netplayer for my 4 year old son, Isaac. The battery is almost gone (5.5 % is reported by Ubuntu) but it is still enough to move the laptop from one wall socket to the other.

As my budget was quite limited I had to choose between power and portability - I could not get both, so I opted for power. You can see the specs of the computer in an earlier post on this blog. So what do I do for a portable - away from home - solution for minimal funds and minimal size?

Why not make a USB stick bootable?

I happen to have a Kingston 8GB Class 10 USB stick that I can use for this purpose. This is a reasonably big drive with plenty of speed.

So my plans are the following:


Partition the space into 2 partitions:
  • 2 GB FAT - for windows use
  • 6 GB ext4 - for Ubuntu

As you might notice I have opted not to put in a swap drive. This is partly due to the fact, that I do not know how Linux will cope with a flash drive with regard to wear/limited write cycles. What happens when cells become read only on a swap partition? Secondly most computer will have ample memory for my primary use; Programming.

I need the FAT partition for windows use - moving files etc.

The plan is to install Ubuntu 10.10 on the 6 GB partition. I am using one big partition as it is hard to know right now how much /root and how much /home space I need so I am diverting from my usual /root /home partition scheme.

To keep data and projects uptodate I will be using UbuntuOne. But as my primary Ubuntu One account holds more than 20 GBs of data currently, which will not fit on the stick and as Ubuntu One configuration currently does not support selective sync'ing I am going to use a secondary UbuntuOne account to which I will share the necessary folders.

Please feel free to share your views and thoughts in the comments. I will update this post with new info as I go along.

Update 09-12-2010:

I made my first go at this yesterday and worked on it a bit this morning. (This update is being written on the Ubuntu-on-USB ;-) I will make a new post with a how I did it approach. A few thoughts from my first go:

I decided to lower the FAT partition to 1800 MB to allow for a little more space. But with the things I need to install: git, eclipse, Android SDK and with opening my primary email in Evolution (IMAP based) I now have around 600 MB to spare on the /root partition. And that was after doing an apt-get clean. Before that I had about 70 MB to spare. So I will redo the setup with a 1 GB FAT partition instead.

Also it seems quite slow when doing a lot of I/O e.g. when doing apt-get update/upgrade and installing packages. I am not sure why this is the case but I suspect that it might be because the fs manager has set the write-cache to a minimum because it is running on a USB device in order to preserve high-reliability. I will try to google a bit to see if this is the case and how to set a more harddisk like write-cache to speed things up a bit.

I have only tried the stick on 2 Acer laptops, my wn Aspire 5738ZG and an eMachines 17". But so far it works on those two. I will try to boot on a few other at work today.