Author Topic: How to force GRUB to boot CD/DVD  (Read 8160 times)

Offline plambi

  • Full Member
  • ***
  • Posts: 143
How to force GRUB to boot CD/DVD
« on: September 30, 2009, 01:23:18 AM »
Here is a handy trick I found - how to make GRUB to boot from your CD/DVD, in case you forgot to set appropriate option in your BIOS.
The trick is to "chainload" from GRUB into an CD/DVD with the help of two tools from other boot-manager projects: memdisk (see:  http://syslinux.zytor.com/memdisk.php) from the Syslinux project and sbm (see:  http://btmgr.sourceforge.net/about.html) from the Smart Bootmanager project.

If you need both you can find here memdisk and a bare version of sbm.
Download these two files and copy them in /boot/grub as root.

This sbm image has only the following options left in its menu:

  • Reboot
  • Power Down
  • Exit to BIOS
  • Boot from CD

It defaults to booting from CD/DVD directly (without a delay, resp. with a delay of zero seconds). If you need to enter the menu you have to hold down the Ctrl key during loading sbm.

The menu entry for Chainloading an CD/DVD disk in my menu.lst file is:

    title Boot CD/DVD
    kernel /boot/grub/memdisk.bin
    initrd /boot/grub/sbootmgr.dsk

If there is no CD in the drive, sbm complains about a "Disk error! 0xAA" and if you hit any key, sbm enters its Boot menu. The same happens, if the directory of the CD is not yet loaded, or if the drive cannot read it (e.g. RW disk in an older drive), so it is worth while to retry loading the CD by hitting any key in response to the "Disk error! 0xAA" message and Enter on the (highlighted) CD-ROM line in SBMs Boot Menu.

With memdisk version 2.03 and later you can compress the disk image with gzip and memdisk transparently decompresses the image:

    title Boot CD/DVD
    kernel /boot/grub/memdisk.bin
    initrd /boot/grub/sbm.dsk.gz

Disclaimer: Use this trick completely on your own risk, be warned that you can ruin your hard disk with only some keystrokes. Do not blame me, if it does not work for you :)

Original article: http://www.lrz-muenchen.de/~bernhard/grub-chain-cd.html
« Last Edit: September 30, 2009, 01:26:52 AM by plambi »