Previous Section  < Day Day Up >  Next Section

Recipe 11.9. Creating a Bootable CD

11.9.1 Problem

You need to burn a bootable CD. You already have the boot image and data files.

11.9.2 Solution

The boot image needs to be rolled into the .iso with mkisofs.

If the bootable image is on a floppy disk, first make a boot/ directory in the file tree that is going on the CD, and copy it there:

$ dd if=/dev/fd0 of=~/cd-files/boot/boot.img bs=10k count=144

Or copy it from another location on the hard drive:

$ cp boot.img  ~/cd-files/boot/boot.img

Then package the .iso:

$ mkisofs -r -b boot/boot.img -c boot/boot.catalog -o bootable-cd.iso ~/cd-files

Now burn it to disc with cdrecord, in the usual fashion, and you have a bootable CD.

11.9.3 Discussion

mkisofs uses the El Torito specification to create a boot image that fools a PC into thinking it's seeing a boot floppy. All you need is the boot image, and mkisofs creates the boot catalog.

The options are:


Set the file ownership and modes so that anyone can read the files.

-b boot/boot.img

Specify the path and filename of the boot image. The boot/ directory is relative to the root filesystem of the CD.

-c boot/boot.catalog

Create and name the boot catalog file.

-o bootable-cd.iso ~/cd-files

Name the new .iso, and give the path to the files that go into it.

11.9.4 See Also

  • mkisofs(8)

    Previous Section  < Day Day Up >  Next Section