I recently did a fresh install of Ubuntu 12.04. I did it on a 16GB USB flash drive, with 964MB for swap and 13.97GB for ext3.
System specs:
- 2GB DDR2 RAM (800~ frequency range)
- 3.14GHz single core processor
- ATI 3600 graphics card
This is the first time I have gotten Ubuntu installed on a USB flash drive (I had another Ubuntu installed on hard drive). The Ubuntu I had on the hard drive worked marvellously faster than my Windows 7; for example, I could be running Google Chrome with around twenty tabs and have Photoshop running without any lag. But now with the USB version I can barely have Google Chrome open with six tabs and browse my home folder at the same time without lag, and freezing of either Chrome or the home folder.
This is a picture of top
being used in the terminal:
So could you please help me? Any suggestions will be helpful.
Best Answer
Where USB flash drives fail is in random writes to the disk. They can be hundreds of times slower than the same operation on traditional hard drives. Note that this used to be the case with SSDs too until around 2008 or 2009 when they gained new controller technologies which make them much faster than tradtional hard drives. These technologies pretty much don't exist on USB flash drives.
Operations that will be particularly slow include:
This article on phoronix compares the performance of various file systems on USB flash drives. Unfortunately, its conclusion is that it doesn't make all that much difference. Theoretically, a log-structured file system should help, but these aren't mainstream enough for me to recommend them for the uninitiated.
One idea is to use a read-only or hybrid file-system instead, which is exactly what you get if you copy the Ubuntu Live CD image (or use UNetBootin to set up a live USB) to your USB flash drive. Look into setting up a Live USB from the Live CD image with persistence (try to find a recent guide to doing so). Of course, you then won't be able to upgrade to a new version of Ubuntu, but that's not necessarily terrible.
Barring any such measures, and keeping a traditional partition type/structure, your main strategy will be to try and minimise writes to the disk at all cost. Ideas for this include: