GRUB, the GRand Unified Bootloader


After using LILO for years, I switched to GRUB some time ago mostly because I was sick of typing "lilo" after each and every kernel compile ;-)

Build a GRUB floppy disk

# /sbin/grub --batch --device-map=/dev/null << EOF > device (fd0) /dev/fd0 > root (fd0) > setup (fd0) > quit > EOF

Build a GRUB bootable CD-ROM

First of all, I have to say that I did not manage to find a way to create a CD-R that will boot on all my Computers.
Especially the Laptops are picky, and each in it's own way.
Anyway, something like this is supposed to work:
$ mkdir -p boot_cd/boot/grub $ cp /usr/lib/grub/i386-pc/stage2_eltorito boot_cd/boot/grub ## Optional: Configuration create/copying: $ vim boot_cd/boot/grub/menu.lst ## Now copy desired CD content: $ cp -vdpR cd_content boot_cd ## Variant 1: $ mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \ -boot-load-size 4 -boot-info-table -o grub.iso boot_cd
This creates the file grub.iso that can be burned on a CD-R as it is. There is no need for further modifications by grub.
The option "-boot-load-size 4" is meant to be used for compatibility with the BIOS of older computers.
Trying to boot a CD-R created with variant #1 has those results:

Sample /boot/grub/menu.lst file

default 0 timeout 10 color green/black light-green/black title Linux root (hd0,0) kernel /kernel root=/dev/hda4 vga=0 title Linux with initramfs root (hd0,0) kernel /kernel-2.6.xx initrd /initramfs_data.cpio.gz title Load kernel and initramfs from floppy root (hd0,0) kernel (fd0)/kernel-2.6.xx root=/dev/ram0 # TODO: Check which one of those actually works # prompt "Now insert disk with the initrd image" # pause Insert disk with the initrd image, then press enter initrd (fd0)/initrd.img.gz title Windows 98 hide (hd0,0) unhide (hd0,2) rootnoverify (hd0,2) chainloader +1 makeactive title Memdisk floppy emulator root (hd0,0) kernel /memdisk initrd /bootdisk.img

Using GRUB and Memdisk to boot a floppy image

Most modern computers (especially "netbooks") come without a floppy drive. If you need to boot DOS to flash the BIOS (or for other reasons), this can be done with Memdisk. Memdisk is part of the Syslinux package, which can be found on the Syslinux homepage.
Memdisk puts the image of the floppy disk (which must be passed to it with the GRUB "initrd" parameter) to the Highmem and installs a small driver (typically about 2K) in Lowmem.

Hide the GRUB boot menu

add GRUB_FORCE_HIDDEN_MENU="true" to /etc/default/grub then run grub-mkconfig -o /boot/grub/grub.cfg