Create a bootable USB flash disk from an ISO image file

From file "/usr/share/doc/syslinux-3.82-r1/isolinux.txt.bz2", in syslinux >= 3.72 :


      Starting in version 3.72, ISOLINUX supports a "hybrid mode" which can
      be booted from either CD-ROM or from a device which BIOS considers a
      hard disk or ZIP disk, e.g. a USB key or similar.

      To enable this mode, the .iso image should be postprocessed with the
      "isohybrid" script from the utils directory:

              isohybrid filename.iso

If the iso has been generated with a recent isolinux as a bootloader, just test :

	isohybrid myimage.iso
if it does not complain, now just copy the image on a device.
	cat image.iso > /dev/sdX #cat the image to the device
Be very careful, you dont want to write to your internal hard drive. Double check dmesg.

If isohybrid complains, you will need to depack the iso, change the isolinux.bin bootloader, then repack it. The commands are, as root:

	mkdir old 		# create mount point
	mkdir new		# create read-write root for the new image
	mount -o loop mycoolimage.iso old	# mount image
	rsync -av old/* new/			# copy image content to new/, keeping owners, permissions, symlinks, etc.
	cp /usr/share/syslinux/isolinux.bin new/isolinux/ 	# copy bootsector
	mkisofs -o mynewimage.iso -R -l -J -V MyCoolLivePenDrive -b isolinux/isolinux.bin -c isolinux/ -no-emul-boot -boot-load-size 4 -boot-info-table new/ # generage new iso image
	isohybrid mynewimage.iso # patch the iso image
	# cleanup 
	umount old
	rm -Rf new
Now just write the image to a device/media :
	cat mynewimage.iso > /dev/sdX
or to a CD :
	cdrecord mynewimage.iso

plugging such a pendrive make this appear in KDE4 : you can mount the iso9660 filesystem.

Some distros work, other don't. It depends a lot on the initrd scripts. Tested working images :

Tested non working images, due to initrd scripts searching at no other place than the CD-Rom drive :