Thursday, February 07, 2008

Grub Config

Example of menu.lst booting a kernel

title Item Title Goes here

# this first root option selects which partition to set GRUB root
root (hd0,0) # name of the partition that grub should look for the kernel image

# the second root option in the kernel statement is the root partition that Linux will mount to
kernel (hd0,4)/boot/vmlinuz ro root=/dev/sda5 # location of read only image.

initrd (hd0,4)/boot/initrd.img # location of initrd image
boot # actually boots the system with the given commands

Example of menu.lst chainloading an OS

title Item Title Goes here
root (hd0,1)
chainloader +1

Installing grub into a boot sector (within the os)

sudo grub
> root (hd0,0)
> setup (hd0)