Linux – Boot GRUB2 to GRUB or GRUB2 on another disk

grubgrub2linuxopensuse

I've got a couple of distributions installed, Gentoo with GRUB2, and openSUSE with some other version of GRUB.

OpenSUSE manages it's kernel entries, and I don't want to have to update my main Gentoo GRUB2 config to copy changes after updating. Currently I hit F8 in the BIOS to select a different disk, but it'd be nice to just go from my main GRUB to openSUSE managed GRUB via a menu entry.

  1. How do I get GRUB2 to load GRUB from another disks MBR?

  2. How do I get GBUB2 to load GRUB from another bootable partition?

  3. How do I get GRUB2 to load GRUB2 from another disks MBR?

  4. How do I get GRUB2 to load GRUB2 from another bootable partition?

Assume I'm on hd0 MBR, and booting to GRUB in hd1 MBR, or (hd1,2) (Second partition).

Best Answer

Since I figured this out yesterday I may as well point the answer.

To go from GRUB2 to another MBR you need to do the following

menuentry "Other Disk" {
    insmod part_msdos
    set root='(hd1)'
    drivemap -s hd0 hd1
    chainloader (hd1)+1
}

That is booting my GRUB2 into GRUB managed by OpenSUSE. hd1 could be swapped for any other drive or partition. The drivemap is needed so the other GRUB will find the partitions on hd1 it needs, since the other GRUB (1) will treat the other disk as hd0. To boot off a partition you would change (hd1) to (hd1,2) or whatever partition you want, note the drivemap would omit the partition.

GRUB2 -> GRUB2 should be the same way, though I don't have an install to test this. The config file might work for GRUB2->GRUB2, but I didn't test that either since I'm going form GRUB2 -> GRUB

Related Question