Ask Your Question

GRUB not found after re-plugging the hard drive

asked 2017-06-18 22:57:21 +0000

macjan gravatar image

updated 2017-06-19 09:36:01 +0000

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 19:43:07 +0000

macjan 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-19 03:43:00 +0000

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.

macjan ( 2017-06-19 08:55:12 +0000 )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. https://paste.fedoraproject.org/paste...

cmurf ( 2017-06-19 17:03:50 +0000 )edit

I have no option for Fedora either.

macjan ( 2017-06-19 18:24:13 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Use your votes!

  • Use the 30 daily voting points that you get!
  • Up-vote well framed questions that provide enough information to enable people provide answers.
  • Thank your helpers by up-voting their comments and answers. If a question you asked has been answered, accept the best answer by clicking on the checkbox on the left side of the answer.
  • Down-voting might cost you karma, but you should consider doing so for incorrect or clearly detrimental questions and answers.

Question Tools

1 follower


Asked: 2017-06-18 22:57:21 +0000

Seen: 50 times

Last updated: Jun 19