EFI Boot Management: Juggling FreeBSD, Proxmox, and Friends

#efi#uefi#freebsd#proxmox#boot#multi-boot

The Setup

One machine, one EFI System Partition, multiple operating systems fighting for boot priority. Here’s what coexistence looks like on a Proxmox host that also boots FreeBSD CURRENT.

/boot/efi/EFI/
├── BOOT/        → BOOTx64.EFI (fallback)
├── freebsd/     → loader.efi
├── Linux/       → (empty, remnant)
├── memtest86+/  → memtest86+x64.efi
├── proxmox/     → grubx64.efi
└── systemd/     → systemd-bootx64.efi

Reading Boot Entries

efibootmgr -v
BootCurrent: 0003
Timeout: 1 seconds
BootOrder: 0003,0000,0002,0001
Boot0000* FreeBSD 16-CURRENT  \EFI\FREEBSD\LOADER.EFI
Boot0001  Linux Boot Manager  \EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI
Boot0002  UEFI OS             \EFI\BOOT\BOOTX64.EFI
Boot0003* proxmox             \EFI\PROXMOX\GRUBX64.EFI

Key observations:

Common Operations

Change boot order (FreeBSD first)

efibootmgr -o 0000,0003,0002,0001

One-time boot into FreeBSD (next reboot only)

efibootmgr -n 0000
reboot

Activate/deactivate an entry

# Activate Linux Boot Manager
efibootmgr -a -b 0001

# Deactivate it
efibootmgr -A -b 0001

Set boot timeout

# 5 seconds to pick an OS at firmware level
efibootmgr -t 5

Create a new boot entry

# Add a new FreeBSD entry manually
efibootmgr -c -d /dev/sda -p 1 -L "FreeBSD 16-CURRENT" -l '\EFI\FREEBSD\LOADER.EFI'

Delete an entry

efibootmgr -B -b 0001

Adding FreeBSD to an Existing ESP

When installing FreeBSD alongside Proxmox, don’t let the installer format the ESP. Instead, after install:

# From Proxmox (or any Linux with the ESP mounted)
mkdir -p /boot/efi/EFI/freebsd
cp /path/to/loader.efi /boot/efi/EFI/freebsd/loader.efi

# Register the entry
efibootmgr -c -d /dev/sda -p 1 -L "FreeBSD 16-CURRENT" -l '\EFI\FREEBSD\LOADER.EFI'

From FreeBSD side, mount the ESP:

mount -t msdosfs /dev/ada0p1 /boot/efi
cp /boot/loader.efi /boot/efi/EFI/freebsd/loader.efi

The Fallback Entry

\EFI\BOOT\BOOTX64.EFI is the UEFI fallback — firmware uses it when no boot entries exist or all fail. On this system it’s a copy of systemd-boot. Keep it pointing to whatever you consider your “safe” OS.

Cleanup

Dead entries accumulate. The empty Linux/ directory and inactive Boot0001 are remnants of a previous distro. Clean up:

# Remove the dead entry
efibootmgr -B -b 0001

# Remove the empty directory
rm -rf /boot/efi/EFI/Linux

Gotchas