Booting floppy disk images from a USB thumb drive

A few days ago I needed to run a manufacturer's hard disk utility, prior to returning a dying drive under warranty. The software was provided as an ISO, or a floppy disk image.

It felt like a shame to waste a CD to burn less than a few megabytes of data, so I wanted to use the floppy disk image. The only problem is that my PC (like most new PCs these days) doesn't actually come with a floppy disk drive (which is good – I don't like those things).

What I did have, was a USB thumb drive and after a bit research I managed to boot the floppy disk image from it. A little more research resulted in a simple system to boot one of several floppy disk images stored on a USB drive.

The article below describes the steps required to achieve this using a Linux system.

Required software

The following tools will be required:

  • LILO
  • mkdosfs
  • SYSLINUX

Debian packages are lilo, dosfstools and syslinux.

Partition the USB drive

Unless you want to dedicate your USB drive to the task of booting disk images, you will want to create a separate partition for this purpose (and use the rest of the disk for other things). The image partition will need to be in FAT16 format. It will also need to have the boot flag set. This is what my image partition looks like in fdisk:

Device      Boot    Start   End     Blocks  Id  System
/dev/sdf1   *   1   12  47213   6   FAT16

The remainder of this article assumes that the USB drive is accessible using /dev/sdf, and that the FAT16 partition created above is /dev/sdf1.

Once the partition is created, create the file-system using:

mkdosfs /dev/sdf1

Configure SYSLINUX on the USB drive

SYSLINUX will be responsible for booting the floppy disk images.

First, install SYSLINUX on the new partition:

syslinux /dev/sdf1

Mount the partition:

mkdir /mnt/sdf1
mount /dev/sdf1 /mnt/sdf1

Next, you will need to copy the special "memdisk" kernel that will boot the disk images:

cp /usr/lib/syslinux/memdisk /mnt/sdf1

(On a non-Debian system the file may be in a different location.)

You will also (obviously) need to copy your floppy disk image to the USB drive. The remainder of this article assumes that you have two image files: "image1.img" and "image2.img".

Create the SYSLINUX configuration file /mnt/sdf1/syslinux.cfg with the following contents:

DEFAULT image1

DISPLAY boot.txt

LABEL image1
KERNEL memdisk
APPEND initrd=image1.img

LABEL image2
KERNEL memdisk
APPEND initrd=image2.img

PROMPT 1
TIMEOUT 0

Create the (optional) information file /mnt/sdf1/boot.txt. The text in this file will be displayed on boot:

List of available images:

image1 - Image No. 1 (default)
image2 - Image No. 2

Now unmount the partition:

umount /dev/sdf1

Install LILO

The final step is to install the LILO bootloader onto the MBR of your USB drive:

lilo -M /dev/sdf

Conclusion

All that is left is to test your new bootable USB key. Hopefully you can now boot your floppy images without a floppy drive.

References

Disclaimer

The information above is accurate to my knowledge, however I provide no guarantees to this effect and consequently accept no liability whatsoever for any bad things that may happen as a result of the reader using this information in practice. Use at your own risk. Oh, and backup your data while you're at it.