Solved efibootmgr: Cannot translate unix loader path '\EFI\BOOT\BOOTX64.EFI' to UEFI: No such file or directory

Trying to make 2nd disk, ada1, mirrored and bootable.
Code:
mkdir -p /tmp/efi-ada1
mount -t msdosfs /dev/ada1p1 /tmp/efi-ada1    # tried mount -t msdosfs /dev/gpt/efiboot1 /tmp/efi-ada1
mkdir -p /tmp/efi-ada1/EFI/BOOT
mkdir -p /tmp/efi-ada1/EFI/FreeBSD
cp /boot/loader.efi /tmp/efi-ada1/EFI/BOOT/BOOTX64.EFI
cp /boot/loader.efi /tmp/efi-ada1/EFI/FreeBSD/loader.efi
Code:
ls -R /tmp/efi-ada1 shows BOOTX64.EFI and loader.efi are there

efibootmgr -a -c -l /EFI/BOOT/BOOTX64.EFI -L FreeBSD_ada1

efibootmgr -a -c -l '\EFI\BOOT\BOOTX64.EFI' -L FreeBSD_ada1

efibootmgr: Cannot translate unix loader path '\EFI\BOOT\BOOTX64.EFI' to UEFI: No such file or directory

efibootmgr -a -c -l /EFI/FreeBSD/loader.efi -L FreeBSD_ada1

efibootmgr: Cannot translate unix loader path '\EFI\FreeBSD\loader.efi' to UEFI: No such file or directory
 
Last edited by a moderator:
The loader path must be one of the following (assuming ada1p1 is mounted on /tmp/efi-ada1)
Code:
efibootmgr -a -c -l /tmp/efi-ada1/EFI/BOOT/BOOTX64.EFI -L FreeBSD_ada1
efibootmgr -a -c -l /tmp/efi-ada1/EFI/FreeBSD/loader.efi -L FreeBSD_ada1

# following doesn't need ada1p1 mounted

efibootmgr -a -c -l ada1p1:/EFI/BOOT/BOOTX64.EFI -L FreeBSD_ada1
efibootmgr -a -c -l ada1p1:/EFI/FreeBSD/loader.efi -L FreeBSD_ada1
MSDOS FAT file system is case insensitive, you can name all the files and directories in lower case.
 
The loader path must be one of the following (assuming ada1p1 is mounted on /tmp/efi-ada1)
Code:
efibootmgr -a -c -l /tmp/efi-ada1/EFI/BOOT/BOOTX64.EFI -L FreeBSD_ada1
efibootmgr -a -c -l /tmp/efi-ada1/EFI/FreeBSD/loader.efi -L FreeBSD_ada1

# following doesn't need ada1p1 mounted

efibootmgr -a -c -l ada1p1:/EFI/BOOT/BOOTX64.EFI -L FreeBSD_ada1
efibootmgr -a -c -l ada1p1:/EFI/FreeBSD/loader.efi -L FreeBSD_ada1
MSDOS FAT file system is case insensitive, you can name all the files and directories in lower case.
Great. Many thanks.
Been struggling with AI and becoming clueless.
 
Been struggling with AI and becoming clueless.
Why ask a so called "AI" when you could have easily found an answer in the FreeBSD manuals:

efibootmgr(8)
Code:
Examples

     The efibootmgr program can be used to create new EFI boot variables.  The
     following command may be used to create a new boot method, using the EFI
     partition mounted under /boot/efi, mark the method active, using the
     given loader and label the method "FreeBSD-15":

           efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-15
Next time you might want to consult the FreeBSD documentation first, that could lead to a faster, and, more important, to a correct answer.

You don't need to read the manuals from top to bottom, take a look at the EXAMPLES section first, or search in the man page. apropos(1) can locate a appropriate manual.

Or grep trough all of the manuals. Taking here textproc/ugrep (a very fast pattern search utility), base system grep(1) doesn't support reading compressed manual archives (like efibootmgr.8.gz), and zgrep(1) doesn't support recursive search in directories.

Example:
Rich (BB code):
% ugrep -rIz efibootmgr /usr/share/man
/usr/share/man/man8/boot.8.gz
   327: .Xr efibootmgr 8 ,

/usr/share/man/man8/boot_i386.8.gz
   327: .Xr efibootmgr 8 ,

/usr/share/man/man8/efi.8.gz
    65: .Xr efibootmgr 8 .
   115: .Xr efibootmgr 8 ,

/usr/share/man/man8/efibootmgr.8.gz
    31: .Nm efibootmgr
   210: .Dl efibootmgr -v
   239: .Dl efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-15
   261: .Dl efibootmgr -B -b 0009
   267: .Dl efibootmgr -a -b 0009
   273: .Dl efibootmgr -n -b 0009
   279: .Dl efibootmgr -o 0009,0003,...

/usr/share/man/man8/gptboot.efi.8.gz
    51: .Xr efibootmgr 8
   266: .Xr efibootmgr 8 ,

/usr/share/man/man8/loader.efi.8.gz
    51: .Xr efibootmgr 8 ,
   388: .Xr efibootmgr 8
   391: # efibootmgr -v
   469: .Pa efibootmgr
   472: .Pa efibootmgr

/usr/share/man/man8/uefi.8.gz
    65: .Xr efibootmgr 8 .
   115: .Xr efibootmgr 8 ,
In this case, the search result shows directly the answer and in which manual the finding is located (see bold highlighted lines).

Base system and packages manual locations:
Code:
% manpath
/usr/share/man:/usr/local/share/man:/usr/local/man:/usr/share/openssl/man:/usr/local/lib/perl5/site_perl/man:/usr/local/lib/perl5/5.42/perl/man
 
Why ask a so called "AI" when you could have easily found an answer in the FreeBSD manuals:

efibootmgr(8)
Code:
Examples

     The efibootmgr program can be used to create new EFI boot variables.  The
     following command may be used to create a new boot method, using the EFI
     partition mounted under /boot/efi, mark the method active, using the
     given loader and label the method "FreeBSD-15":

           efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-15
Next time you might want to consult the FreeBSD documentation first, that could lead to a faster, and, more important, to a correct answer.

You don't need to read the manuals from top to bottom, take a look at the EXAMPLES section first, or search in the man page. apropos(1) can locate a appropriate manual.

Or grep trough all of the manuals. Taking here textproc/ugrep (a very fast pattern search utility), base system grep(1) doesn't support reading compressed manual archives (like efibootmgr.8.gz), and zgrep(1) doesn't support recursive search in directories.

Example:
Rich (BB code):
% ugrep -rIz efibootmgr /usr/share/man
/usr/share/man/man8/boot.8.gz
   327: .Xr efibootmgr 8 ,

/usr/share/man/man8/boot_i386.8.gz
   327: .Xr efibootmgr 8 ,

/usr/share/man/man8/efi.8.gz
    65: .Xr efibootmgr 8 .
   115: .Xr efibootmgr 8 ,

/usr/share/man/man8/efibootmgr.8.gz
    31: .Nm efibootmgr
   210: .Dl efibootmgr -v
   239: .Dl efibootmgr -a -c -l /boot/efi/EFI/freebsd/loader.efi -L FreeBSD-15
   261: .Dl efibootmgr -B -b 0009
   267: .Dl efibootmgr -a -b 0009
   273: .Dl efibootmgr -n -b 0009
   279: .Dl efibootmgr -o 0009,0003,...

/usr/share/man/man8/gptboot.efi.8.gz
    51: .Xr efibootmgr 8
   266: .Xr efibootmgr 8 ,

/usr/share/man/man8/loader.efi.8.gz
    51: .Xr efibootmgr 8 ,
   388: .Xr efibootmgr 8
   391: # efibootmgr -v
   469: .Pa efibootmgr
   472: .Pa efibootmgr

/usr/share/man/man8/uefi.8.gz
    65: .Xr efibootmgr 8 .
   115: .Xr efibootmgr 8 ,
In this case, the search result shows directly the answer and in which manual the finding is located (see bold highlighted lines).

Base system and packages manual locations:
Code:
% manpath
/usr/share/man:/usr/local/share/man:/usr/local/man:/usr/share/openssl/man:/usr/local/lib/perl5/site_perl/man:/usr/local/lib/perl5/5.42/perl/man
Reading manual is not my thing, yet, maybe I should be working on it. ugrep looks great.
Again, thanks for the tip.
 
Well, just got some time to continue on this task. I've successfully created entry on ada1 (I think, because there was no error reported).
efibootmgr -a -c -l /tmp/efi-ada1/EFI/BOOT/BOOTX64.EFI -L FreeBSD_ada1
efibootmgr -a -c -l /tmp/efi-ada1/EFI/FreeBSD/loader.efi -L FreeBSD_ada1

efibootmgr
Boot to FW : false
BootCurrent: 0008
Timeout : 0 seconds
BootOrder : 0001, 0002, 0008, 0009, 0005, 0006, 0007
Boot0001* USB Floppy/CD
Boot0002* USB Hard Drive
+Boot0008* UEFI: ST500DM002-1BD142
Boot0009* UEFI: ST500DM002-1BD142
Boot0005* USB Floppy/CD
Boot0006* Hard Drive
Boot0007* Realtek PXE B03 D00
I have this line in /etc/fstab
Code:
/dev/gpt/efiboot0        /boot/efi        msdosfs        rw,noauto    2    2
Then I test the bootability of ada1 by disconnecting disk ada0. During boot, there is the error
......
Starting file system checks:
Can't open `/dev/gpt/efiboot0'
/dev/gpt/efiboot0: UNEXPECTED INCONSISTENCY; RUN fsck_msdosfs MANUALLY.
THE FOLLOWING FILE SYSTEM HAD AN UNEXPECTED INCONSISTENCY:
msdosfs: /dev/gpt/efiboot0 (/boot/efi)
Automatic file system check failed; help!
ERROR: ABORTING BOOT (sending SIGTERM to parent)!
......
I can make the error go a way by commenting out the aforementioned line in /etc/fstab, but I'm not sure if i'm doing this correctly.
Can anyone shed a light?
 
Back
Top