Isohybrid

From Syslinux Wiki
Revision as of 13:17, 25 June 2014 by Scdbackup (talk | contribs) (Moved Isohybrid article from ISOLINUX discussion page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Isohybrid for disk storage devices

BIOS

ISO 9660 filesystems which are created by above mkisofs command will boot via BIOS firmware only from optical media like CD, DVD, or BD. (This includes virtual BIOS and virtual CD-ROM.)

The isohybrid feature enhances ISOLINUX equipped ISO 9660 filesystems by a Master Boot Record (MBR) for booting via BIOS from disk storage devices like USB flash drives.

ISOLINUX provides two programs which can do this in 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.

Both programs contain MBR code which has to match the version of the ISOLINUX file isolinux.bin. So always use the program from the same SYSLINUX installation which provided this file for the ISO 9660 production.

The basic usage is simple. Create a bootable ISO 9660 image file by mkisofs, genisoimage, or xorriso and then treat it by

isohybrid output.iso

Both programs take expert options which are listed by

isohybrid -?

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 pattern isohdp[fp]x*.bin and are to find in SYSLINUX directory ./mbr 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 result needs no further treatment by isohybrid tools.

MBR selection

SYSLINUX provides six versions and flavors of the MBR code, which are contained in its isohybrid programs. The options --forcehd0, --ctrlhd0, --partok may be used to choose one of the non-default flavors.

  • without these options, isohdpfx.bin is chosen. It is for booting from the base device by a healthy BIOS.
  • --forcehd0 chooses isohdpfx_f.bin, which forces booting from BIOS drive 0x80.
  • --ctrlhd0 chooses isohdpfx_c.bin, which forces BIOS drive 0x80 only if the Ctrl key is held during boot.
  • --partok chooses isohdppx.bin, which is for booting from a device partition by a healthy BIOS.
  • --partok --forcehd0 chooses isohdppx_f.bin, for booting from a partition of BIOS disk 0x80.
  • --partok --ctrlhd0 chooses isohdppx_c.bin, for booting from a partition either of disk 0x80 or of the BISO detected disk, depending on whether the Ctrl key is held during boot.

UEFI

The isohybrid feature for UEFI adds a partition to the MBR partition table which points 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. Further isohybrid for UEFI creates a GUID Partition Table (GPT) with a partition which points 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

   -e isolinux/efiboot.img \

by

  -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 an 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. Regrettably 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 which contain only BIOS equipment.

xorriso can add the GPT equipment by its option -isohybrid-gpt-basdat:

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

See Also