Debian installer on a USB key

I couldn’t find a concise article about creating a Debian installer USB key with a writable file system, so here is my take.  This assumes you have an available Linux system.  Note that some old BIOSes might not happily boot USB drives created in this way.

  • Install syslinux
  • Insert the USB key and find the device using dmesg (assumed to be at /dev/sdg below)
  • Create a FAT partition, mark it bootable (assumed at /dev/sdg1 below)
  • Put mbr.bin on the key (cat /usr/lib/syslinux/mbr.bin > /dev/sdg)
  • Mount the FAT partition and put the following files on it:
  • Unmount the FAT partition if it was mounted (umount /dev/sdg1)
  • Run syslinux /dev/sdg1

You can also automate the installation.  See: http://www.debian.org/releases/stable/amd64/apb.html.en.  The preseed.cfg file should go into the root folder of the USB key.  You can then change the syslinux.cfg file to:


default vmlinuz

append initrd=initrd.gz auto file=/hd-media/preseed.cfg locale=en_US console-keymaps-at/keymap=us

 You now have a bootable USB key that you can also easily modify.