0

How do we edit grub in a UEFI HDD to have multi boot option having more than just one linux one Windows OS, readily being selected and run at PC startup

  • What's is your current configuration? What Operating System are you currently using? – Rayleigh Jan 22 at 10:02
  • All installs must be UEFI, grub can only boot other installs in same boot mode or other UEFI installs. I like to turn off os-prober in grub and add my own entries to 40_custom. But to learn I originally copied stanza's from the grub.cfg os_prober created, before backing it up & creating new without os_prober. help.ubuntu.com/community/Grub2/CustomMenus & askubuntu.com/questions/659528/… & – oldfred Jan 22 at 14:39
0

If at least one of your Linux distributions includes the os-prober package and integrates it with the GRUB configuration tools (like Debian/Ubuntu does, for example), then it might be capable of automatically finding a number of Linux versions and adding them to the boot menu for you.

If you choose this approach, you might have to use that distribution as the "primary bootloader maintainer", and might need to run sudo update-grub on that distribution before any kernel update in the other Linux distributions gets actually used at boot time.

Alternatively, you could allow each Linux OS maintain their own GRUB instances, and have one of them (the one selected as the first one in the BIOS boot order) augmented with custom menuitems like these in the /etc/grub.d/40_custom file:

menuentry 'Some other Linux distribution' {
    search --no-floppy --fs-uuid --set=root <UUID of filesystem containing /boot/grub of the other Linux distribution>
    set prefix=$(root)'/grub'
    configfile $prefix/grub.cfg
}

menuentry 'Windows 7 or newer' {
    search --no-floppy --fs-uuid --set=root <UUID of the EFI System Partition of the Windows installation>
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

In other words, for Linux distributions, the idea is to just let GRUB read the configuration file maintained by the other Linux distribution when its boot entry is selected. Assuming that the versions of GRUB are not incompatible, it should just display the boot menu of that distribution effectively as a "sub-menu" of the boot menu of the "primary" installation. If the versions of GRUB are not compatible, it should be possible to chainload into the other Linux distribution's version of GRUB, similar to what is done with the Windows UEFI bootloaders.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy