grub

From Glee
Jump to: navigation, search

Restoring GRUB on a software RAID-1 array

grub # load the interactive grub shell
grub> find /boot/grub/stage2
 (hd0,0) # This is /dev/sda
 (hd1,0) # This is /dev/sdb
# If hd1 doesn't show up, maybe you're missing /dev/sdb* in your rescue environment : MAKEDEV sdb
# Install grub on /dev/sda MBR
root (hd0,0)
setup (hd0)
# Temporary point the MBR to /dev/sdb, and install :
device (hd0) /dev/sdb
root (hd0,0)
setup (hd0)

Copying GRUB

The bootloader is contained in the 512 bytes of the MBR, but within the first 446 (+2 static) bytes. Copying the entire 512 also copies the partition tables, whereas the following doesn't :

dd if=/dev/sda of=mbr-grub.raw bs=448 count=1

GRUB2

Chain load example :

menuentry "Other Linux" {
  set root=(hd0,6)
  chainloader +1
}