ISO 9660 filesystems which are created by the mkisofs command in the article about ISOLINUX will boot via BIOS or UEFI firmware only from optical media like CD, DVD, or BD.
The isohybrid feature enhances such filesystems by a Master Boot Record (MBR) for booting via BIOS from disk storage devices like USB flash drives.
ISOLINUX provides two alternative programs to apply this feature on image files or block devices with ISO 9660 filesystems:
- isohybrid.pl needs a perl interpreter and is supposed to be widely portable.
- isohybrid from utils/isohybrid.c needs to be compiled once for a particular operating system and hardware architecture. Then it is usable without other preconditions.
Meanwhile there is an additional isohybrid feature for UEFI.
Both isohybrid programs contain MBR code matching the same version of the ISOLINUX bootloader file, "isolinux.bin". So always use the isohybrid program from the same Syslinux installation that provided this bootloader file for the ISO 9660 production.
The basic usage is simple. Create a bootable ISO 9660 image file named "output.iso" by either mkisofs, genisoimage, or xorriso and then treat it by:
Both isohybrid programs can take expert options, listed by:
Optionally, the ISO 9660 production program xorriso can enhance its results by isohybrid, if an MBR template file from the local Syslinux installation is provided. The names of these files match the isohdp[fp]x*.bin pattern and are to be found in Syslinux under the ./[bios/]mbr directory or installed as e.g. /usr/lib/syslinux/isohdpfx.bin.
xorriso -as mkisofs \ -o output.iso \ -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \ -c isolinux/boot.cat \ -b isolinux/isolinux.bin \ -no-emul-boot -boot-load-size 4 -boot-info-table \ CD_root
The resulting ISO image needs no further treatment by isohybrid tools.
Syslinux provides six variations of the MBR code, contained in its isohybrid programs. The options "--forcehd0", "--ctrlhd0", "--partok" may be used to choose one of the non-default flavors.
When booting a "healthy" BIOS:
|no options (default)||isohdpfx.bin||Boot from base device|
|--forcehd0||isohdpfx_f.bin||Boot from BIOS disk 0x80|
|--ctrlhd0||isohdpfx_c.bin|| If the Ctrl key is held during boot time,|
then boot from BIOS disk 0x80
|--partok||isohdppx.bin|| Boot from a partition device|
(e.g. /dev/sdx1 rather than /dev/sdx)
|--partok --forcehd0||isohdppx_f.bin||Boot from a partition of BIOS disk 0x80|
|--partok --ctrlhd0||isohdppx_c.bin|| If the Ctrl key is held during boot time,|
then boot from BIOS disk 0x80;
Otherwise, boot from a partition device.
The additional isohybrid feature for UEFI adds a partition to the MBR partition table pointing to the same file in the ISO 9660 filesystem as does the El Torito catalog entry for EFI. This file contains a FAT filesystem with boot equipment from which the UEFI firmware will be able to start the desired operating system. Furthermore, isohybrid for UEFI creates a GUID Partition Table (GPT) with a partition pointing to that file.
It can be brought into the ISO 9660 filesystem as second boot image with options "-eltorito-alt-boot" and "-e" by Fedora's variant of genisoimage, or by xorriso:
genisoimage \ -o output.iso \ -c isolinux/boot.cat \ -b isolinux/isolinux.bin \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -eltorito-alt-boot \ -e isolinux/efiboot.img \ -no-emul-boot \ CD_root
With mkisofs, replace the above:
-e isolinux/efiboot.img \
-eltorito-platform 0xEF -eltorito-boot isolinux/efiboot.img \
The isohybrid tool compiled from utils/isohybrid.c has an option to add a suitable MBR partition and GPT to such a UEFI bootable filesystem:
isohybrid --uefi output.iso
The ISO 9660 filesystem is then supposed to boot from optical media and from disk storage via BIOS and via UEFI. Unfortunately, there seem to be some UEFI implementations which boot from MBR and fail to boot if GPT is present. Therefore some Linux distributions have special ISO images for amd64 containing only BIOS equipment.
xorriso can add the GPT equipment by its "-isohybrid-gpt-basdat" option:
xorriso -as mkisofs \ -o output.iso \ -isohybrid-mbr /usr/lib/syslinux/isohdpfx.bin \ -c isolinux/boot.cat \ -b isolinux/isolinux.bin \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -eltorito-alt-boot \ -e isolinux/efiboot.img \ -no-emul-boot \ -isohybrid-gpt-basdat \ CD_root
Again, the resulting ISO image file needs no further treatment by isohybrid tools.
Copying onto USB stick by shell commands
As any other ISO image, the content of an isohybrid image can be burned to optical media, or alternatively it can be extracted onto a USB stick which can be eventually booted by SYSLINUX.
The advantage of an isohybrid image is that it can also be easily "burned" (as opposed to extracting its content) onto storage media such as USB sticks. Such storage media then can boot the system in a similar way as the read-only optical media.
The properly equipped ISO image can be put on a USB flash drive. Unless option "--partok" is used, it has to be copied to the base disk device so that it overwrites the partition table. Partition editors may then be used to make the remaining storage capacity available as additional partition for a read-write filesystem.
The following procedure is for ISO images prepared without "--partok".
Verify device address or make a backup
The main problem on a Linux system is that you need superuser power to overwrite the whole USB stick, and that this power suffices to also spoil the content of your hard disk.
So first verify that the device file address really leads to the intended device (e.g. by reading a few megabytes and watching it blink). If the USB stick is supposed to be Linux device "/dev/sdb":
umount /dev/sdb dd if=/dev/sdb of=/dev/null bs=1024 count=100000
or by making a backup of its complete content in a compressed disk file :
umount /dev/sdb dd if=/dev/sdb | gzip >"$HOME"/red_usb_stick.gz
Write to USB stick
Once you are convinced that this is the right device file address, copy the ISO image onto the USB stick by:
dd if=output.iso bs=2048 of=/dev/sdb
Eventually restore backup
To later restore the original content of the USB stick, take the same care to really use the correct address and then:
dd if="$HOME"/red_usb_stick.gz | gunzip >/dev/sdb
Images prepared with --partok
ISO images that were prepared by "--partok" resp. with MBR "isohdppx*.bin" have to be dd' to a partition device. E.g. /dev/sdb1 rather than /dev/sdb. Such an ISO partition may then be booted by chainloading or by a suitable MBR at the start of the base disk device.
- man 8 mkisofs Manual of mkisofs.
- man 1 genisoimage Manual of genisoimage.
- man 1 xorrisofs Manual of xorriso's emulation of mkisofs.
- ECMA-119 as PDF Specification of ISO 9660 on byte level.
- libisofs/doc/boot_sectors.txt Description of boot sectors on byte level.
- Doc/usbkey and Hardware_Compatibility#USB-Geometry Contain comments about CHS geometry that might be also relevant for some isohybrid images.