Background
I was trying to install macOS (Hackintosh) alongside Microsoft Windows 10 on my SSD, so I shrank the Windows partition using Disk Management and left an empty exFAT partition next to C: (called ToBeErased) for macOS to format as APFS with Disk Utility. When I launched the macOS install disk and attempted to erase the correct partition with DU, it gave an error regarding the impossibility to format the disk. So I rebooted into Windows and… Nothing. The install appeared non-existent. I realized that when trying to create the APFS container, macOS had had the brilliant idea to erase the ESP partition and leave empty space in its place.
The issue
What was most strange was that my BIOS boot manager still showed an empty/blank " " entry and – even after recreating my ESP using BCDEdit, it still remained along with the proper "Windows Boot Manager" bootloader entry. If I try to boot it, it blanks the screen for a moment and then returns to the boot manager.
As can be seen in this picture, there are:
- the "ghost" entry
- two bootloaders on two spinning HDDs
- Windows Boot Manager on the SSD
My board model is Gigabyte Z370 Aorus Gaming 7.
How do I remove it and – most importantly – what is it, and why does it appear?
Best Answer
These boot entries are stored in UEFI NVRAM. Even resetting it won’t clear them.
Instead, you can use Linux and
efibootmgr
to manage these entries. To be able to manage these entries, Linux needs to be booted in UEFI mode. You might have to disable Secure Boot to do this. Most modern Linux Live USB should includeefibootmgr
. I used Arch Linux.To see the current boot configuration, run
efibootmgr --verbose
.For example, on one of my laptops, it looks like this:
On a PC, it might look like this:
“BootCurrent” marks the currently booted entry, a USB flash drive in both cases. The “BootOrder” is self-explanatory. Directly after the
BootXXXX
comes the name as displayed in the boot selection menu.Locate the entry you want to delete and take note of its number. Run
efibootmgr --bootnum XXXX --delete-bootnum
. Please be very careful. There are no safety questions and changes are effective immediately. Deleting the wrong entry would necessitate boot repair.It is also possible you cannot remove this entry. Unfortunately, most UEFI implementations are quite bug-ridden. It could simply be a display error.