GRUB to the rescue!
Historically GRUB is being used for hard disks and syslinux for floppies and flash drives. But nothing prevents using GRUB for flash drives as well. Here are instructions for creating bootable GRUB-based USB flash drive (disk on key):
- Create vfat partition. For big drives you must use fat32 format.
- Unpack the http://skliarie.meshanet.com/skliarie_blog/boot.tar.gz onto it. It will create single directory boot on the drive.
- Customize boot/grub/grub.cfg file, put iso images accordingly
- On linux box, put bootable MBR onto the DOK (for example on /dev/sdf):
- mount /dev/sdf /mnt/dok
- grub-install --force --no-floppy --root-directory=/mnt/dok /dev/sdf
- umount /mnt/dok
The ISO image must support GRUB-based booting. Specifically it must be smart enough to locate ISO image on the DOK using parameters specified in grub.cfg file.
Latest Ubuntu and Debian based ISO images are known to work.
Thanks to Jonathan Vollebregt there is a way to boot knoppix as well. You will need custom initrd, with your flash drive specific tuning. I built one for mine: knoppix_minirt.gz, you are free to take and modify it according to your DOK and filesystem parameters. Important commands here are:
- Unpack the initrd
gzip -dc /mnt/dok/boot/knoppix/minirt_ska.gz | cpio -i
- Modify the init file (put sector numbers that are correct for your DOK)
- Compress back the initrd
find ./ | cpio -H newc -o | gzip -9 -c > /mnt/dok/boot/knoppix/minirt_ska.gz