How to set up GRUB2 chainloader to other Grub (Fedora, Debian) on GPT

Posted by basic6 on Super User See other posts from Super User or by basic6
Published on 2012-06-03T14:30:43Z Indexed on 2012/06/03 16:43 UTC
Read the original article Hit count: 314

Filed under:
|
|

I'm trying to set up a dedicated GRUB2 which (chain-)loads another GRUB on a disk with GPT partition table.

Relevant partitions:

  • /dev/sda1 BIOS_BOOT
  • /dev/sda2 BOOT (ext2)
  • /dev/sda3 FEDORA (ext4)
  • /dev/sda6 DEBIAN (ext4)

I installed Fedora first, using /dev/sda2 as boot partition. Then I installed Debian. The Debian installer recognized the Fedora installation and added it as boot entry, then installed its GRUB into the MBR. While this works for the moment, it's pretty messy, because every Debian update may change the boot config, removing the Fedora entry (tried it) and the other way around. That's why I want both systems to have their own boot loader and one main boot loader (that could reside on /dev/sda2), which loads one of them.

This is what I've tried:

  • Moved everything from /dev/sda2 to /dev/sda3/boot
  • Removed /boot mount point in Fedora (so /dev/sda2 isn't used anymore)
  • From a live Linux, installed GRUB2 to the MBR (grub-install --boot-directory=sda2 /dev/sda)
  • Wrote a menu.lst:
    • title Fedora
    • root (hd0,2)
    • chainloader +1
    • (Again, for Debian)
  • Converted that to a grub.cfg script (grub-menu2cfg or something like that)
  • When booting, actually got a GRUB2 menu with "Fedora" (and "Debian")
  • When selecting any one of those:
    • error: invalid signature
  • Issued "grub-install /dev/sda6" (and ...sda3) from all kinds of live Linux systems, all of which failed with another error message (in the case of the Debian installer, without explanation at all)
  • Added --force to the chainloader line, now it says "loading", then reboots
  • Found douzens of howtos, none of which seem to work for me

Since I get the self-made GRUB2 menu on bootup, I've at least successfully installed the first stage of GRUB, right?
When trying to chainload, some signature is checked and seems to be wrong - how do I fix it?
The boot menus (Fedora with its different Kernel versions and Debian with Debian and Fedora as well) are now on the system partitions (/dev/sda3, /dev/sda6), is there anything else to do on these partitions, so they can be chainloaded?

Any help is greatly appreciated.

© Super User or respective owner

Related posts about debian

Related posts about fedora