Bug 294338 - FreeBSD 14.0-RELEASE Release Notes: Upgrading from Previous Releases of FreeBSD misses several boot loader usecases
Summary: FreeBSD 14.0-RELEASE Release Notes: Upgrading from Previous Releases of FreeB...
Status: New
Alias: None
Product: Documentation
Classification: Unclassified
Component: Website (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-doc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-04-08 17:08 UTC by Michael Osipov
Modified: 2026-04-08 18:29 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Osipov freebsd_committer freebsd_triage 2026-04-08 17:08:20 UTC
I have upgraded several servers from 13 to 14 via /usr/src and wanted to install new boot loaders as recommended by the release notes. Made several observations where the documentation is lacking and/or problematic and needs to be updated.

Constellations:
* ZFS + BIOS boot
* UFS + UEFI boot

ZFS + BIOS boot:
> root@deblndw014x:~
> # zpool status zroot
>   pool: zroot
>  state: ONLINE
> status: Some supported and requested features are not enabled on the pool.
>         The pool can still be used, but some features are unavailable.
> action: Enable all features using 'zpool upgrade'. Once this is done,
>         the pool may no longer be accessible by software that does not support
>         the features. See zpool-features(7) for details.
> config:
> 
>         NAME          STATE     READ WRITE CKSUM
>         zroot         ONLINE       0     0     0
>           mirror-0    ONLINE       0     0     0
>             gpt/zfs0  ONLINE       0     0     0
>             gpt/zfs1  ONLINE       0     0     0
> 
> errors: No known data errors
> root@deblndw014x:~
> # gpart show
> =>       40  585937424  da11  GPT  (279G)
>          40       1024     1  freebsd-boot  (512K)
>        1064        984        - free -  (492K)
>        2048   33554432     2  freebsd-swap  (16G)
>    33556480  552380416     3  freebsd-zfs  (263G)
>   585936896        568        - free -  (284K)
> 
> =>       40  585937424  da3  GPT  (279G)
>          40       1024    1  freebsd-boot  (512K)
>        1064        984       - free -  (492K)
>        2048   33554432    2  freebsd-swap  (16G)
>    33556480  552380416    3  freebsd-zfs  (263G)
>   585936896        568       - free -  (284K)
> 
> root@deblndw014x:~
> # gpart show -l
> =>       40  585937424  da11  GPT  (279G)
>          40       1024     1  gptboot0  (512K)
>        1064        984        - free -  (492K)
>        2048   33554432     2  swap0  (16G)
>    33556480  552380416     3  zfs0  (263G)
>   585936896        568        - free -  (284K)
> 
> =>       40  585937424  da3  GPT  (279G)
>          40       1024    1  gptboot1  (512K)
>        1064        984       - free -  (492K)
>        2048   33554432    2  swap1  (16G)
>    33556480  552380416    3  zfs1  (263G)
>   585936896        568       - free -  (284K)

The notes do NOT tell that I have to update the boot code on all drives in the ZFS mirror, for novices likely not obvious because ZFS seems like magic to many.

This would of course apply to ZFS + UEFI in a mirror as well.

UFS + UEFI boot:
I have mounted the ESP to /mnt to update the default loader BOOTX64.efi and FREEBSD/loader.efi, but constantly received errors from cp(1) with broken files. Started digging...
> root@deblndw011x:~
> # gpart show da0
> =>       40  585871888  da0  GPT  (279G)
>          40     409600    1  efi  (200M)
>      409640    4194304    2  freebsd-ufs  (2.0G)
>     4603944   16777216    3  freebsd-swap  (8.0G)
>    21381160    8388608    4  freebsd-ufs  (4.0G)
>    29769768    8388608    5  freebsd-ufs  (4.0G)
>    38158376   16777216    6  freebsd-ufs  (8.0G)
>    54935592   25165824    7  freebsd-ufs  (12G)
>    80101416  505413632    8  freebsd-vinum  (241G)
>   585515048     356880       - free -  (174M)
> 
> root@deblndw011x:~
> # mount -t msdosfs /dev/da0p1 /mnt/
> root@deblndw011x:~
> # df
> Filesystem                                1K-blocks     Used    Avail Capacity  Mounted on
> ...
> /dev/da0p1                                      778      385      393    50%    /mnt
> root@deblndw011x:~
> # df /mnt/
> Filesystem 1K-blocks Used Avail Capacity  Mounted on
> /dev/da0p1       778  385   393    50%    /mnt
> root@deblndw011x:~
> # file -s /dev/da0p1
> /dev/da0p1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "BSD4.4  ", root entries 512, sectors 1600 (volumes <=32 MB), sectors/FAT 5, sectors/track 63, heads 1, serial number 0xbd4111ee, label: "EFISYS     ", FAT (12 bit), followed by FAT
> root@deblndw011x:~
> # tree -D /mnt/
> [Dec 31  1979]  /mnt/
> └── [Apr 16  2018]  efi
>     └── [Apr 16  2018]  boot
>         ├── [Apr 16  2018]  BOOTx64.efi
>         └── [Apr 16  2018]  startup.nsh
> 
> 3 directories, 2 files

This does not make any sense, but explains why I was not able to fix /boot/loader.efi twice onto the ESP.

It turned out that there was a period where the FAT12 image of the ESP was copied via dd on to the 200 MiB ESP. This was "fixed" in db8b56134506840832bec2d1ce07b9e00d4d6d71.

The notes MUST put such systems into consideration when recommending adding both loader images into this tiny FS. I was sweating blood and tears because it didn't add up and I thought I messed up with the ESP leaving the system unbootable.

Loader before upgrade:
> # ll /mnt/efi/boot/BOOTx64.efi
> -rwxr-xr-x  1 root  wheel  393216 2018-04-16 10:12 /mnt/efi/boot/BOOTx64.efi*

Loader after upgrade:
> # ll /mnt/efi/boot/BOOTx64.efi
> -rwxr-xr-x  1 root root 662528 2026-04-08 13:01 /mnt/efi/boot/BOOTx64.efi*

As a cherry on top maybe a paragraph could describe how to convert this fauly partition into a real FAT32 ESP with 200 MiB size.
Comment 1 Michael Osipov freebsd_committer freebsd_triage 2026-04-08 17:12:54 UTC
FWIW:
> root@deblndw011x:~
> # df -h /mnt/
> Filesystem    Size    Used   Avail Capacity  Mounted on
> /dev/da0p1    779K    649K    130K    83%    /mnt
> root@deblndw011x:~
> # efibootmgr -v
> Boot to FW : false
> BootCurrent: 0009
> Timeout    : 0 seconds
> BootOrder  : 0008, 000A, 0009, 0000, 0002, 0001, 0003, 0004, 0005, 0006, 0007, 000C, 000B, 000D
>  Boot0008* Generic USB Boot UsbClass(0xffff,0xffff,0xff,0xff,0xff)
>  Boot000A* Embedded SATA Port 10 CD/DVD ROM : hp DVDRW GUD0N  PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0x5,0x0,0x0)
> +Boot0009* Embedded RAID 1 : Smart Array P440ar Controller - 279.37 GiB, RAID 1 Logical Drive(Target:0, Lun:0) PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/Scsi(0x0,0x0)
>  Boot0000  Embedded UEFI Shell Fv(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(c57ad6b7-0515-40a8-9d21-551652854e37)
>  Boot0002  System Utilities Fv(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(1fd631e5-44e0-2f91-10ab-f88f3568ef30)
>  Boot0001  Diagnose Error Fv(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(0849279d-40d5-53ea-e764-2496766f9844)
>  Boot0003  Intelligent Provisioning Fv(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(4a433501-ddaa-490b-96b2-04f42d8669b8)
>  Boot0004  Boot Menu Fv(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(d3fd6286-43c5-bb8d-0793-07b70aa9de36)
>  Boot0005  Network Boot Fv(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(ee8b26b0-37e9-11e1-b86c-0800200c9a66)
>  Boot0006  Embedded Diagnostics Fv(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(b57fe6f1-4f49-d46e-4bba-0a8add34d2f3)
>  Boot0007  View Integrated Management Log Fv(cdbb7b35-6833-4ed6-9ab2-57d2acddf6f0)/FvFile(93c92423-d1c6-4286-be67-b76b6671047e)
>  Boot000C* Embedded LOM 1 Port 1 : HPE Ethernet 1Gb 4-port 331i Adapter - NIC (PXE IPv4)  PciRoot(0x0)/Pci(0x1c,0x4)/Pci(0x0,0x0)/MAC(20677cd4180c,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)
>  Boot000B* Embedded LOM 1 Port 1 : HPE Ethernet 1Gb 4-port 331i Adapter - NIC (PXE IPv6)  PciRoot(0x0)/Pci(0x1c,0x4)/Pci(0x0,0x0)/MAC(20677cd4180c,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000)
>  Boot000D* Embedded RAID 1 : Smart Array P440ar Controller - 1676.64 GiB, RAID 5 Logical Drive(Target:0, Lun:1) PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)/Scsi(0x0,0x1)
> 
> 
> Unreferenced Variables:
>  Boot000E* iLO Virtual USB 2 : HPE iLO Virtual USB CD/DVD ROM PciRoot(0x0)/Pci(0x1d,0x0)/USB(0x0,0x0)/USB(0x0,0x0)

ESP is mounted, but does not appear here. Maybe due to the broken ESP.
Comment 2 Michael Osipov freebsd_committer freebsd_triage 2026-04-08 17:15:24 UTC
ziaee@

any idea who to address this? According to https://github.com/freebsd/freebsd-doc/blame/b15a9b72ba9dd47ad1fba25fcb1a499789a235c7/website/content/en/releases/14.0R/relnotes.adoc last one to work on was Mike Karels, but unfortunately he passed away.
Comment 3 Alexander Ziaee freebsd_committer freebsd_triage 2026-04-08 18:29:58 UTC
Hmm... Thanks for tagging me. I agree that we should fix this, even though it's historical. I'll cc some loader experts, and see if they know what to do. If we have a patch, I can approve it to be put in the release notes.