My Fantastic Linux & UEFI Adventures Begin 2016: It Maybe Can Save Your Money And Time

Introduction

In the first day of new 2016 year I tried to boot my HP laptop with Fedora. Little surprise: black screen after UEFI boot menu. Hmm, maybe the hardware is broken? I run the RAM and disks tests from standard HP suite and after 5 minutes they report: memory and hard drive is OK. Strange situation. Next step: connect HDD to my desktop, renew backups and check errors with fsck tool – no effect.

I’m in a bad mood after the other bad news – the same story with LiveCD: it also can’t start. After this I start thinking about near service centers, but something in my mind says “strange ’cause this laptop never has a problem” and try to remember my last work on this machine.

I disabled my hard drive and try to boot from USB – system starts correctly in BIOS mode! Logs were absolutely clear without errors and problems. The conclusion is simple – this is the UEFI startup problem.

After 5-10 attempts my LiveCD was started casually in UEFI-mode. I run efibootmgr and can’t believe to my eyes:

# efibootmgr
BootCurrent: 0000
Timeout: 0 seconds
Boot0000* Notebook Hard Drive
Boot0002* Notebook Ethernet
Boot0003* Fedora
...
...
120(!) records "Fedora"

Problem is detected: UEFI can’t start the OS immediately because need to check 120+ boot records!

Boot0003* Fedora    HD(1,GPT,2bab38e7-5a34-4693-a7a0-e4b517d91268,0x800,0x64000)/File(\EFI\fedora\shim.efi)

How to fix it

I delete all the duplicates:

# efibootmgr -b "NUMBER OF ENTRY" -B

And my Fedora boot successfully from hard drive. But this is not the end: after every reboot new one Fedora entry adds to my UEFI boot menu! I don’t known how to fix it. If you have an idea – feel free to write in comments. And yes, you need right now to install and run efibootmgr in all your UEFI hardware and check the boot entries.

Wish the good hardware and software to everyone in 2016!

UPDATE: 

Fallback.efi every time create new boot record. Quotes from Fedora Wiki:

The EFI program /boot/efi/EFI/BOOT/fallback.efi will look for files called BOOT.CSV in your ESP and will add boot entries corresponding to them, if such entries do not already appear to exist. shim provides a BOOT.CSV file that will add an entry for grub2-efi for you. So just using the EFI Shell to invoke fallback.efi should do the trick.

If you have no boot entries at all, then just booting off your disk in UEFI mode should automatically invoke /boot/efi/EFI/BOOT/BOOTX64.EFI, which will, in turn, invoke fallback.efi.

Read more:

Person of The Year 2015 in the Linux/OpenSource Community: Open VotingRead more:

Santa Claus in Linux Style: Top Linux Hardware and Free Linux/Programming Books & Courses Recommendations

 

  • Jerry Casiano

    Fixed this issue recently, sorry didn’t document steps, wasn’t that difficult…

    Erased all duplicate entries and set Fedora as default boot entry using efibootmgr, played around in “bios” settings making sure the boot order there matched. Think that was it really.

    For me it was obvious that there was an issue right after install though. Error msg while grub loaded. So never ran out of space.

    Anyway, sure you’ll figure it out.

    • Paul Alberto Rufous

      Thanks for the comment! Trying to create a valid boot entry.

  • ididntwanttosignup

    Oh, I ran into this issues a couple of times. The blame is on HP for hard-coding the EFI boot manager path.
    Here’s the solution and a more in-depth explanation: https://ask.fedoraproject.org/en/question/46142/way-to-stop-fedora-making-boot-entries-in-uefi-nvram/ and https://wiki.archlinux.org/index.php/HP_EliteBook_840_G1

    • Paul Alberto Rufous

      Thank you! Here is this two solutions:
      1) Just use systemd-boot – it works
      2) Replace /boot/EFI/BOOT/BOOTX.efi to your *.efi file
      I have planned to update this post tomorrow.