grub: Making a GRUB bootable CD-ROM
4.2 Making a GRUB bootable CD-ROM
=================================
GRUB supports the "no emulation mode" in the El Torito specification(1)
(⇒Making a GRUB bootable CD-ROM-Footnote-1). This means that you
can use the whole CD-ROM from GRUB and you don't have to make a floppy
or hard disk image file, which can cause compatibility problems.
For booting from a CD-ROM, GRUB uses a special image called
'cdboot.img', which is concatenated with 'core.img'. The 'core.img'
used for this should be built with at least the 'iso9660' and 'biosdisk'
modules. Your bootable CD-ROM will usually also need to include a
configuration file 'grub.cfg' and some other GRUB modules.
To make a simple generic GRUB rescue CD, you can use the
'grub-mkrescue' program (⇒Invoking grub-mkrescue):
$ grub-mkrescue -o grub.iso
You will often need to include other files in your image. To do
this, first make a top directory for the bootable image, say, 'iso':
$ mkdir iso
Make a directory for GRUB:
$ mkdir -p iso/boot/grub
If desired, make the config file 'grub.cfg' under 'iso/boot/grub'
(⇒Configuration), and copy any files and directories for the disc
to the directory 'iso/'.
Finally, make the image:
$ grub-mkrescue -o grub.iso iso
This produces a file named 'grub.iso', which then can be burned into
a CD (or a DVD), or written to a USB mass storage device.
The root device will be set up appropriately on entering your
'grub.cfg' configuration file, so you can refer to file names on the CD
without needing to use an explicit device name. This makes it easier to
produce rescue images that will work on both optical drives and USB mass
storage devices.