There are several ways to make a usb flash drive bootable (this also works for usb hdd and a usb card reader with an sd card). The most easiest way is to use an application such as Unetbootin click here, All you do is install it to your hdd, download an operating system iso and then install to the usb.
Before we begin you need to understand that in most cases this will create a live operating system or live boot the same as copying an iso to a cd click here and click here. Operating systems such as puppy linux or if they have a persistent save file will allow you to install and set up the os and have the apps and things saved for next time you boot.
Also the file system in the usb will make a difference. click here for more information on different filesystems to choose what is right for you.
Unetbootin uses syslinux and sets it up automatically in one go for you. this is only good if you have one os to put on the usb flash or usb hdd.
You can also install syslinux manually which will give you the ability to setup and install more than one operating system to the usb. This is what i am going to take you through now.
- Get the latest syslinux .tar.gz file click here.
- Extract it to your home folder.
- Open a command prompt / terminal and cd to the file cd ~/(syslinux folder)/linux (~/ points to your home folder)
- Next run the command ./syslinux -i /dev/sdX1 replacing X with the device node of your media. eg /devx/sdb1 (a quick way to find the device details of your usb is to run gparted and select is from the list) eg
- To make the usb itself bootable we need to create a mbr (master boot record) on the usb. cd to the “syslinux/mbr’” folder and Run the following command, replacing X with the device node of your usb drive:
- sudo dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/sdX && sudo parted /dev/sdX set 1 boot on
This will setup the mbr and create a file fsckme.flg on the usb
- Next open the file manager and navigate to your syslinux/com32/menu/ folder ad copy the file menu .c32 to the usb. (this file is needed to create a nice looking fancy menu for your syslinux setup see my syslinux.cfg file below)..
now you can copy the bootable operating system files.
- Copy a Linux kernel image (like vmlinuz) to the root (/dev/sdX1) of your media.
- Now you can create a syslinux.cfg file and set the boot options for the particular os you are using.
Here is my setup. after you have completed the first 6 steps to install syslinux
- Download Puppy Linux 528.004. click here
- On the usb create a folder called puppy528 (this is where the Linux kernel image(s) will go)
- Extract the 3 files vmlinux. intrid.gz, lupu_528.sfs from the iso image into the puppy528 folder on your usb device
- Create a file syslinux.cfg and copy this into it. click here this menu will boot most puppy Linux versions. it will be similar but different for other linux os. Google around and you can find one for your operating system.
Have fun and enjoy your favorite operating system on an external usb device.