Ask Your Question

GRUB not found after re-plugging the hard drive

asked 2017-06-18 17:57:21 -0500

msum gravatar image

updated 2017-06-19 04:36:01 -0500

I have a dual boot Windows 10 / Fedora 25 install (on the same hard disk, using a UEFI boot partition) and a second hard drive for additional storage. Up to today everything worked fine. Today I unplugged both hard drives to plug another one and install Debian on it. Then I took the Debian drive away and re-plugged the original drives. However, now I am only able to boot Windows. When I go to UEFI Setup -> Boot menu, the GRUB entry is not there anymore, by default the Windows boot manager starts directly.

I used the Fedora Live USB stick to mount the EFI partition and check its content. The GRUB files are still there.

Edit: From what I've found out, it seems possible that re-plugging a hard drive breaks the NVRAM entries. Is there some way to restore the entry in NVRAM, for example using the live USB stick? I thought about mounting the EFI partition and reinstalling GRUB (grub2-install), but I'm afraid to lose my original configuration, kernel images etc.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-06-19 14:43:07 -0500

msum gravatar image

The following command added the missing boot entry and solved the issue:

efibootmgr -c -d /dev/sda -p 2 -L 'Fedora' -l '\EFI\fedora\shim.efi'

edit flag offensive delete link more

answered 2017-06-18 22:43:00 -0500

cmurf gravatar image

The UEFI firmware's boot manager should enumerate options based on the EFI System partition contents, but I've seen some bugs where this doesn't happen. It's possible the boot entry or its number is missing from NVRAM. You can check this from Fedora with

efibootmgr -v

And you can change the boot order with --bootnext or --bootorder flags.

You can also boot Fedora from Windows. Press shift key when you click on restart, and you'll get an additional menu of options, one of which should be "Use a device", click that, and in the next list choose Fedora. I've seen navigating to this option vary somewhat depending on the Windows 10 variant, so you might have to dig around for it. But the main thing is holding shift + restart to get that menu instead of it rebooting.

edit flag offensive delete link more


efibootmgr -v lists the same options as the boot menu in the UEFI setup. There's no option for GRUB. Booting from Windows just gives me options 'hard drive' / USB device', and if I select 'hard drive', it boots Windows.

msum gravatar imagemsum ( 2017-06-19 03:55:12 -0500 )edit

There isn't supposed to be an option for GRUB in NVRAM. The option is for Fedora, which points to shim.efi. This shows a before and after listing of NVRAM in my computer, the first case it boots Windows by default because the boot order is set to boot the Windows entry first. And then I changed it with --bootorder option to get it to boot Fedora first.

cmurf gravatar imagecmurf ( 2017-06-19 12:03:50 -0500 )edit

I have no option for Fedora either.

msum gravatar imagemsum ( 2017-06-19 13:24:13 -0500 )edit

Question Tools

1 follower


Asked: 2017-06-18 17:57:21 -0500

Seen: 604 times

Last updated: Jun 19 '17