Title photo
frugal technology, simple living and guerrilla large-appliance repair
Wed, 10 Jul 2013

Re-adding Fedora to your EFI boot menu if you (like me) have the audacity to disconnect your hard drive

I'm now running Fedora 19, but this happened when I was still running Fedora 18 with UEFI on my HP Pavilion g6-2210us.

The Fedora installation created an entry in the laptop's EFI boot menu for Fedora 18. But when I disconnected the hard drive, replaced it with another for some testing, then reconnected the original drive, Fedora was no longer in the EFI menu.

I was still able to boot Fedora by navigating to it via the "boot from EFI file" function in the UEFI menu, so I knew where the bodies (i.e. Fedora's EFI partition) were buried.

That act of navigation helped me figure out how to restore Fedora to the overall UEFI boot menu via the Linux efibootmgr utility. As is often the case, the Arch Linux Wiki was extremely helpful.

Here's what I did. (This is all done as root, hence the # in the prompt).

First, make sure that efivars is active:

# modprobe efivars

Then add back Fedora's EFI partition with efibootmgr. My Fedora EFI partition was on /dev/sda6, and the file is shim.efi. I chose to name the entry "Fedora":

# efibootmgr -c -w -d /dev/sda -p 6 -l '\EFI\fedora\shim.efi' -L "Fedora"

If you want to know more, it couldn't hurt to read the entire Arch Wiki entry on UEFI:

It is not lost on me that the Arch Wiki is better than ... just about everything ... at helping users get things done in pretty much every Linux distribution, not just Arch. Thanks, Arch users and developers, for such a great resource.