how to create a bootable usb stick from an iso using syslinux/isolinux

these instructions are linux-specific; adjust for bsd, etc…

determine which disk device has been allocated to the usb stick:

cat /proc/partitions

compare the output from before and after inserting the device:

  dmesg | tail
  # insert device
  dmesg | tail

assumptions made:

  • the iso is on a cdrom at /dev/sr0

  • the usb stick is /dev/sdc

loop mount the iso:

mount -o loop,ro /dev/sr0 /cdrom

format the usb stick and create a fat partition

# note that this may vary slightly between fdisk versions.
fdisk /dev/sdc <<EOM
o
n
p
1


a
1
t
c
w
EOM

cat /usr/lib/syslinux/mbr.bin > /dev/sdc
mkfs.vfat -F 32 -n USBDISK /dev/sdc1
mount /dev/sdc1 /mnt
syslinux /dev/sdc1
cp -a /cdrom /mnt
umount /cdrom /mnt
sync
sync
sync
eject /dev/sr0

test boot…