# Trying to fix bi_load_efi_data get mem error - stuck



## shaunobi (Dec 30, 2020)

Hi all! New (ish) FreeBSD user here in Portland. Running on a 4th gen Intel NUC, bare metal. Installed FreeBSD 12.1 RELEASE several months ago, most of the way through Absolute FreeBSD 3rd Ed. Loving it, really enjoying using it as a daily driver instead of Linux.

I've started getting a new intermittent error when booting (below). The error when booting is bi_load_efi_data: GetMemoryMap Error 5.

This is apparently a known bug. Looks like Rebecca Cran fixed it: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235714

However, I can't figure out how to apply this fix. Do I need to recompile some boot efi image somewhere? I'm seeing the revision in Subversion, but not sure how to proceed. Happy to read anything, follow directions in the Handbook, just have searched for awhile and am not seeing where to go next. I'm comfortable using a compiler, etc.

Thanks for any help!

--Shaun


----------



## SirDice (Dec 31, 2020)

The patch was for 13-CURRENT and has already been applied there. I can't find any MFC but it's possible this has found its way into 12-STABLE too. So have a try with 12.2-RELEASE, it's possible that bug has already been fixed there.


----------



## shaunobi (Jan 3, 2021)

Hi SirDice! Tried 12.2-RELEASE, still getting the same error. Here's something that might be relevant in the bug notes:



> Yes, it's been pushed to 13-CURRENT but you'll need to update your ESP manually: it isn't currently updated during an installworld.
> 
> To update the ESP, mount it (e.g. /dev/ada0p1) as msdosfs and copy /boot/loader.efi to either efi/boot/bootx64.efi or efi/freebsd/loader.efi, whichever exists.



I'm willing to try doing this, but just don't quite know enough to figure out. How do I get the ESP to mount it?

Also, if it's better for me to upgrade to 13-CURRENT, I'm willing to do that, just not sure what the ramifications are.

Thanks for the help, much appreciated.


----------



## SirDice (Jan 4, 2021)

shaunobi said:


> Also, if it's better for me to upgrade to 13-CURRENT, I'm willing to do that, just not sure what the ramifications are.


-CURRENT is an unsupported development version. That said, it will be released some time in March (https://www.freebsd.org/releases/13.0R/schedule.html) so it should be fairly stable now. Note however that you will need to build from source and there is a ton of debugging options turned on, making it a bit slower than a regular version. This will require some build options to be set (and unset) in order to make it perform better. Not something I would recommend to do if you've never built FreeBSD before.


----------



## Emrion (Jan 4, 2021)

If you can build or take from somewhere the patched loader.efi, you can try to put it in your efi partition, but beware as it can lead to a non-booting system.
For example:

```
# gpart show
=>      40  20971440  ada0  GPT  (10G)
        40    409600     1  efi  (200M)
    409640      1024     2  freebsd-boot  (512K)
    410664       984        - free -  (492K)
    411648   2097152     3  freebsd-swap  (1.0G)
   2508800  18460672     4  freebsd-zfs  (8.8G)
  20969472      2008        - free -  (1.0M)

# mount -t msdosfs /dev/ada0p1 /mnt
# cp loader.efi /mnt/efi/boot/BOOTx64.efi
# umount /mnt
```


----------

