Friday, August 3, 2012

Grub2

On my machines, I like to have 2 linux partitions, one is my active partition, the other one for experimenting, or as a backup during upgrade periods, etc. So usually what I do is to create a small grub partition (50MB) or so, and use it as a first stage booting:

- From the MBR launch GRUB on the grub partition
- ask which operating system to boot and chainload
- From the partition boot record (PBR), launch GRUB on that partition and boot the kernel

Recent Ubuntu systems do not come with Grub-legacy any more so I had to use GRUB2. Here is the configuration file that goes in the grub partition.

set default="1"

menuentry 'Ubuntu Precise on /dev/sda1 (old install)' {
set root=(hd0,1)
multiboot /boot/grub/core.img
}

menuentry 'Ubuntu Precise on /dev/sda6 (clone of old install)' {
set root=(hd0,6)
multiboot /boot/grub/core.img
}