Installing Ubuntu on the USB drive

Download the Ubuntu image (for example, ubuntu-11.04-desktop-i386.iso) or put in an Ubuntu install CD if you have it.

If you use the downloaded image you can mount it to make it accessible as follows, using ‘terminal’ (supposing that the iso image is in the current directory):

mkdir ubuntuCD
sudo mount ubuntu-11.04-desktop-i386.iso ubuntuCD -o loop

You can now access the files via the ‘ubuntuCD’ folder.

Open the CD’s top-level folder and make sure that you see the hidden files too. (verify that View–>Show Hidden Files is checked).

Copy the following folders and files to the 750 MB partition of your USB drive:

  • Copy folders: ‘.disk’, ‘casper’, ‘dists’, ‘install’, ‘pics’, ‘pool’ and ‘preseed’ (skip the ‘boot’ folder);
  • Copy the folder ‘isolinux’ to the drive and rename it to ‘syslinux’;
  • Copy the file ‘README.diskdefines’, and optionally, the ‘usb-creator.exe’ and ‘wubi.exe’ files (skip the ‘autorun.inf’ and ‘md5sum.txt’ files);
  • Rename the file ‘syslinux/isolinux.cfg’ to ‘syslinux/syslinux.cfg’ on the USB drive by right clicking on it and selecting ‘rename’;
  • Rename the file ‘syslinux/isolinux.bin’ to ‘syslinux/syslinux.bin’.

Alternately, you can run the following commands in ‘terminal’. If you copy/paste, take care to make your browser window large enough to not have accidental line breaks inserted. And remember to replace /media/ubuntu with /media/whatmountpointyouhave1 if you used a different name for the mount point.

Add the -v option to cp to get some progress indication. The casper/filesystem.squashfs file in particular is large, and takes a long time to copy.

cd ubuntuCD
cp -rf casper dists install pics pool preseed .disk /media/ubuntu
cp -rf isolinux /media/ubuntu/syslinux
cd /media/ubuntu/syslinux
mv isolinux.cfg syslinux.cfg
mv isolinux.bin syslinux.bin

The FAT32 file system will not allow symbolic links to be copied over. You will get a warning about this, but it is harmless.

Unmount the iso image that you mounted above, using ‘terminal’.

sudo umount ubuntuCD