Boot and Install Ubuntu From USB Flash Drive

Just to make a note for myself, although this has been posted on various blogs.
I am using the latest Ubuntu (8.04) for this note. 
What you’ll need:
a) Ubuntu 8.04 Live CD (the image can be downloaded here)
b) Working Internet Connection
c) 1GB or above USB flash drive
How to get it done:
1. Boot your computer with the Ubuntu Live CD and choose the first option
2. Insert the USB flash drive
3. Open a terminal window and type sudo su 
4. Now type fdisk -l to list available drives/partitions (note which device is your flash drive Example: /dev/sdb). Throughout this tutorial, replace all instances of x with your flash drive letter. For example, if your flash drive is sdb, replace x with b
5. Type umount /dev/sdx1 
6. Type fdisk /dev/sdx 
  • type p to show the existing partition and d to delete it
  • type p again to show any remaining partitions (if partitions exist, repeat the previous step)
  • type n to make a new partition
  • type p for primary partition
  • type 1 to make this the first partition
  • hit enter to use the default 1st cylinder
  • type +750M to set the partition size
  • type a to make this partition active
  • type 1 to select partition 1
  • type t to change the partition filesystem
  • type 6 to select the fat16 file system
  • type n to make another new partition
  • type p for primary partition
  • type 2 to make this the second partition
  • hit enter to use the default cylinder
  • hit enter again to use the default last cylinder
  • type w to write the new partition table
7. Type umount /dev/sdx1 to unmount the partition
8. Type mkfs.vfat -F 16 -n ubuntu8 /dev/sdx1 to format the first partition
9. Type umount /dev/sdx2 to ensure the partition is unmounted
10. Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
11. Remove and re-insert your flash drive (if prompted that a new medium has been detected, select to open in a new window and click ok)
12. Back at the terminal, type sudo apt-get install syslinux mtools
13. Type syslinux -sf /dev/sdx1 
14. Type cd /cdrom 
15. Type cp -rfv casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines install/mt86plus /media/ubuntu8 
16. Type cd /media/ubuntu8 
17. Type wget 
18. Type cd casper 
19. Type rm initrd.gz 
20. Type wget 
21. Reboot your computer and set your system BIOS boot priority to boot from the USB stick.
To make a USB flash drive to boot and install your favorite Linux distro, check out Pendrivelinux