How to make a bootable USB stick

First thing to do is to format the USB stick with Gparted. If you want to format from the command line do like so:

fdisk -l

And find the name of your USB stick. It could be something like sdb1, sdc1 or whatever. But firstly be sure about what is your device.

Then you can format your USB stick with a FAT16 or FAT32 filesystem:

mkfs.vfat /dev/sdxx

Where sdxx is the name of your USB device. If you want to create a linux filesystem:

mkfs.ext3 /dev/sdxx

Now to make the newly created partition bootable type:

fdisk /dev/sdxx

press the key "a"

press the key "q" to exit from fdisk

Now you have to install syslinux on the USB stick. For doing this go to the syslinux web site http://www.syslinux.org/wiki/index.php/Download and download the latest version.

Now you have to unpackage syslinux and cd into the directory syslinux/linux

Here open a terminal and type:

./syslinux -i /dev/sdxx

this command creates the file ldlinux.sys in /dev/sdxx

Then with a text editor create a file named syslinux.cfg and write this in the file:

DEFAULT vmlinuz

Append initrd=initrd.gz

Then copy the files vmlinuz and initrd.gz onto the USB stick in the / directory. These files can be found in the .ISO image of your distribution.

Well done! you have now a bootable USB stick.