USB stick works 2 times faster than hard disk. Using USB sticks, you can increase the performance of your Ubuntu. Or you can make your own environment portable. Nowadays, everybody can buy a few 16G USB sticks.

That way I have speed and I don't have the nightmare of installing my next new box. When you move to another box with your system the only problem is having a different graphics card. Jaunty fixes the problem for you on failure of existing X11 configuration.

I'll try to cover a few possibilities that can be applied independently

Fresh first time (K)ubuntu

Stick your devices, pop-in live-cd and do a normal installation. Instead of "Guided Partition", go and specify the devices for / (root), /home and swap.

After booting into your new system add the last bit of optimization so that your usb system does not wear off. Add those lines to /etc/fstab

Also comment out the other line which specifies the swap partition on your hard disk. You don't need it anymore. In case you are keeping it pri=5 above makes usb to take over swapping.

Enable the new swap space

sudo swapon -a

You can see the current swap configuration of your machine

swapon -s

When my swap went USB, I found out that I could launch around virtual machines for testing purposes and live them around freely. With less concern. Ubuntu has a "swappiness" setting. When it's 100, it will swap out any idle process ASAP and use the freed memory for data caches. So with a fast swap space, you can increase the storage cache memory to increase the performance of the computer once more. How useful this trick depends on how CPU intensive your processes are. But in general, things are just idling around. So give the memory to cache and get better harddisk performance.

sudo sysctl -w vm.swappiness=100

The default value of swappiness is 60. You can experiment values between 60 and 100 to get a better result depending on your CPU usage ratio.

Moving existing system applications to USB

You are not doing a clean reinstall. You have have your lovely existing system. Then the easiest way is to keep your existing boot device as it is while moving the application binaries to the USB stick.

This gives you some benefits. Data in your harddisk and applications in the stick will be read in parallel. This is simply faster boot or operation. You'll have more space left on your harddisk :)

What about write limit of USB sticks? I am sure you are not making 10000 operating system upgrades soon. And when a USB stick dies, it simply becomes read only.

Using qtparted or your other favorite, format your stick using "ext2". No "ext3" please. Having journal on USB stick will kill it faster.

Notice that I am removing /usr.bak at the end only so that I have a way to rollback until the end.

A 16G stick will be sufficient for most installations. If you still have an 8G then please buy a new one. If you are screaming that your /usr is 32G then that deserves another article although possible :) . Tell me if you need it.

Performance

~Device

Rate

Maximum Latency

CPU

HD

650 Mb/s

10 ms

69 %

USB

910 Mb/s

1.7ms

0 %

My heavy boot with many services was 2 mins. It's now 30 secs.

Have fun :)

/usr problem

On some systems (nowadays all systems in fact), applications are guarded (.e.g by apparmor) so that they can only access the expected path inside '/usr'. If you do the symlink trick above then your system will no more work. Expecially X server itself. So the work around is mounting it instead of linking it. In fstab, define a line similar to

/mnt/usb-root/usr /usr none rw,bind 0 0

And do

sudomv /usr /usr.baksudomkdir /usr
sudo mount -a

Now the /usr on stick is mounted on the original place and the system guard will not be aware of it.