Bootable USB flash drives

Finnix, the LiveCD for system administrators

Many X86 motherboards can boot from USB flash drives (thumb drives, USB keys, etc). Finnix can be installed on these devices, and there are a few different methods, but there are some caveats for each.

Contents

[edit] USB-HDD

A USB flash drive can be set up to emulate a bootable hard drive, otherwise known as USB-HDD. However, this method is not often used, mainly because many BIOSes are horribly broken in this regard, and will not correctly boot. finnix-thumbdrive will have support for this method in a future release.

[edit] USB-ZIP

The most popular method of booting a USB flash drive is making it emulate a Zip drive. This seems to be the most supported method across the most motherboards, oddly enough. This method has several caveats, though:

  • The drive has to be partitioned in a certain way, namely with the primary partition as #4, and with 64 heads, 32 sectors and not more than 1024 cylinders.
  • This method WILL destroy all data on the device. Once you have your USB flash drive set up in a compliant manner, you can tell finnix-thumbdrive to skip partitioning and just overwrite files on the existing partition.
  • The 1024 cylinder limit effectively limits the 4th partition to 1GB. If your flash drive is over 1GB, you will have to create a second partition as #1, #2 or #3, with the rest of the space.
  • If you do have a >1GB drive and end up needing to create 2 partitions, keep in mind that Windows will, for some reason, only be able to see the first allocated partition on a USB flash drive. However, in this method, the first allocated partition will be the one you created manually. So if you have a 4GB flash drive and use the USB-ZIP method, you'll have a 1GB "hidden" bootable Finnix partition on #4 that Windows cannot see, and a 3GB partition on #1 that Windows can see. (Linux and Mac OS X will see both partitions without problem.)

The finnix-thumbdrive utility within Finnix is designed to set up USB flash drives as USB-ZIP, to copy all necessary Finnix files to the USB flash drive, and to modify the Finnix boot loader config files to boot off a USB flash drive.

[edit] First time partitioning

[edit] Drives 1GB or under

Run:

# finnix-thumbdrive /dev/sdX

Where /dev/sdX is your USB flash drive. Be absolutely sure this is your USB flash drive, and not something else like a hard drive. (The author personally lost a workstation this way, due to negligence.) finnix-thumbdrive will automatically partition the USB flash drive, destroying all data in the process, creating /dev/sdX4 with the appropriate number of cylinders. It will then copy the Finnix CD to /dev/sdX4, modify/move necessary files, then install a bootloader (syslinux).

[edit] Drives over 1GB

Follow the instructions for Drives 1GB or under, but use this instead:

# finnix-thumbdrive -l /dev/sdX

The -l (lowercase letter L) flag tells finnix-thumbdrive to limit creation to 1024 cylinders, rather than trying to calculate how many cylinders to use (which would fail). You will be left with a bootable /dev/sdX4 that is only 1GB. To use the rest of the space on your USB flash drive:

# fdisk /dev/sdX

Once in fdisk, create a new partition #1 with the rest of the available space (n, p, 1, <ENTER>, <ENTER>), set the partition type to FAT32 (t, 1, b), then write the partition table and exit (w). Then, format the partition:

# mkfs.vfat /dev/sdX1

[edit] Subsequent Finnix installs

If you used a method above to create a USB-ZIP-compliant, you do not have to destroy your USB flash drive's data if you want to re-install or upgrade Finnix on /dev/sdX4. Run this:

# finnix-thumbdrive -p /dev/sdX

The -p flag skips partitioning and formatting, and will just copy over and modify the necessary Finnix files, and refresh the bootloader.

Personal tools