Return to Level1Techs.com

Configure GRUB to boot Legacy and UEFI?

My Linux laptop (an HP Probook 6460b) died recently. Fedora 27 was installed on the hard drive in legacy/MBR mode. On the new laptop, Windows 10 Pro is installed on the main drive in UEFI/GPT mode. I’ve added the old HP drive to the second drive bay (i.e., the optical bay.)

I’d like to dual boot Windows and Fedora, and I can manage this from the UEFI boot menu. If I leave the laptop in UEFI mode, at boot time I can select to boot the Fedora drive in legacy mode, or the Windows drive in UEFI mode. What I’d like to do is add a GRUB entry for Windows so I don’t have to pound on the F12 key every time I boot up. But the traditional commands to update grub aren’t picking up the Windows hard drive/partition.

I’ve tried:

# grub2-mkconfig -o /boot/grub2/grub.cfg

  • AND -

# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

grub2-mkconfig successfully adds Fedora boot entries (for old kernels and recovery mode), but makes no effort to add Windows to the GRUB boot menu.

So is it completely impossible to boot a Windows UEFI partition from a legacy Fedora install? I can reformat one of my drives if I have to, but I’d obviously like to avoid that if it can be helped.

not a fix so much as a workaround, but you could use refind as your default boot manager, and use it to chainload windows or linux conveniently at startup:

http://www.rodsbooks.com/refind/

huge UX improvement for people on dual boot systems

otherwise you’re gonna have to completely redo your boot system (add a boot/uefi partition, reinstall gnome etc – and that assumes your old drive is gpt with legacy boot, otherwise it’s a wash)

Thanks, I used to use REFit a lot when I used to mess around with alternate OS’s on my old Mac. I didn’t even know it was still around.

However if anyone has any less drastic suggestions, I’d appreciate your input.

in my experience, chainloading from grub doesn’t play well with win10 at all, and that may be by design on microsoft’s part

I installed rEFInd from RPM, and it boots Windows fine. However, when I try to boot Linux it fails to make it past the initial ramdisk, failing at “Switch Root Device.” It was easy enough to recover by switching the UEFI back to legacy boot mode and starting from the 2nd device bay.

Reading through the install documentation (http://www.rodsbooks.com/refind/installing.html) it’s mentioned that boot failures may be due to a damaged hybrid MBR. It’s possible that my old drive doesn’t have a hybrid MBR, but just a plain MBR.

So unless @tkoham has some usage tips for rEFInd, looks like I’m going to have to reinstall Linux in UEFI mode. It’s a smallish drive anyway, and I have some larger ones I can put in.

that’s probably the best option. If your home folder is on a separate partition you won’t lose anything anyway