For the complete documentation index, see llms.txt. This page is also available as Markdown.

28.4 Updating ZFS Storage Pools

The available features of a ZFS storage pool are controlled by feature flags. After a FreeBSD major version upgrade, you must manually run zpool upgrade to enable the new feature set — this operation is irreversible. Once upgraded, older systems will not be able to recognize the new feature set. Before upgrading, evaluate whether older systems will need to import the pool again in the future.

Warning

Since the ZFS built into older systems is not compatible with the feature set of newer ZFS file systems, please prepare backups and an emergency CD to handle unexpected situations.

Verifying the ZFS Version

First, verify the current system and ZFS version:

  • Check the current system version

# freebsd-version -kru
15.0-RELEASE
15.0-RELEASE
15.0-RELEASE
  • Check the ZFS/zpool related version

# zpool version
2.4.0-rc4-FreeBSD_g099f69ff5
zfs-kmod-2.4.0-rc4-FreeBSD_g099f69ff5

Warning

This means that any operating system with a ZFS version lower than 2.4.0-rc4 may fail to boot after the upgrade.

Performing the Upgrade

After a FreeBSD upgrade, new ZFS feature flags are not available until zpool upgrade is executed. Perform the upgrade:

Status: Some supported and requested features are not yet enabled on the pool. The pool can still be used, but some features are unavailable.

Action: Use 'zpool upgrade' to enable all features. Once this is done, software that does not support these features may no longer be able to access the pool.

Warning

The operation of enabling the new feature set with zpool upgrade is irreversible. Once upgraded, older systems will not be able to recognize the new feature set. Before executing, confirm that all systems that need to access the pool have been upgraded to a compatible version.

Based on the system prompt: The system indicates that an update is needed, but after the update, older systems may fail to boot. First, preview the features that will be updated:

Except for features marked with *, which require manual enabling, the remaining features will be enabled by default after the upgrade.

Note

zpool upgrade does not actually enable these feature flags; it is only used to preview the features that can be enabled. To perform the upgrade, you must also specify the pool name, for example zpool upgrade zroot. See: 'zpool status' gives confusing suggestion with 'zpool upgrade'[EB/OL]. [2026-03-26]. https://github.com/openzfs/zfs/issues/17910. OpenZFS project discussion about the zpool upgrade command issue.

Discussion Question

Some contributors considered the fix PR associated with the above issue to be trivial and insignificant, and rejected it on the grounds that each line must not exceed 80 characters. However, countless users have wasted significant amounts of time on such "minor issues." What is the true cost of ignoring the power of words?

Now perform the actual upgrade:

  • Display the current status and health information of all ZFS pools:

The upgrade completed successfully, and the ZFS pool status is normal.

Appendix: Feature Flags Requiring Manual Enablement

This appendix describes ZFS feature flags that require manual enablement and how to enable them:

Check which feature flags currently require manual enablement (marked with *):

As shown, dynamic_gang_header can be manually enabled. Next, query the status of this feature flag in the ZFS pool:

This feature flag is not enabled. Now enable the dynamic_gang_header feature flag on the zroot pool:

Check the current status of the dynamic_gang_header feature flag in the zroot pool again:

Check the currently upgradeable ZFS pools and their supported feature flags:

Updating the Boot Loader (UEFI Boot)

Warning

Please update loader.efi before updating the ZFS version!

For systems using EFI boot, a copy of the boot loader resides on the EFI System Partition (ESP) and is used by the firmware to boot the kernel. If the root file system is ZFS, the boot loader must be able to read the ZFS boot file system. After a system upgrade and before executing zpool upgrade, the boot loader on the ESP must be updated first, otherwise the system may fail to boot. Although not mandatory, this should also be done when UFS is the root file system.

The command efibootmgr -v can be used to determine the location of the current boot loader. The value of BootCurrent is the boot entry number used to boot the current system. The corresponding entry in the output starts with +, as shown below:

The ESP is typically already mounted at /boot/efi. If not, it can be mounted manually using the partition listed in the efibootmgr output (in this example, nda0p1): mount_msdosfs /dev/nda0p1 /boot/efi. For another example, see loader.efi(8).

The value of the File field in the efibootmgr -v output, such as \efi\freebsd\loader.efi, is the path of the currently used boot loader in the EFI System Partition. If the mount point is /boot/efi, then this file is /boot/efi/efi/freebsd/loader.efi. (On FAT32 file systems, paths are case-insensitive; FreeBSD uses lowercase.) Another common value for File might be \EFI\boot\bootXXX.efi, where XXX is amd64 (i.e., x64), aarch64 (i.e., aa64), or riscv64 (i.e., riscv64); if not configured, this is the default boot loader. You should copy /boot/loader.efi to the correct path within /boot/efi to update both the configured and default boot loaders.

Performing the Update

After a version update, the system may display a prompt during boot indicating that the boot loader version is too old, showing a message similar to the following.

Loader update prompt screen

Note

This screen appears briefly and may flash by on fast-booting systems. You can use a camera to capture and review it.

This indicates that the loader needs to be updated. You can also verify the version with the following commands:

/boot/efi/efi/freebsd/loader.efi is the currently used loader (the version is indeed older).

Copy /boot/loader.efi to the FreeBSD directory on the EFI System Partition to update it:

Rewriting Boot Code (BIOS Legacy Boot)

Under BIOS legacy boot mode, after a storage pool upgrade, you may need to manually rewrite the boot code, otherwise the system may fail to boot properly.

Warning

The bootfs property is a key indicator for ZFS to boot FreeBSD. Ignoring this prompt may not cause immediate problems, but once the underlying risk manifests, it will result in the system failing to boot. Therefore, it is recommended to rewrite the boot code as prompted. Practical experience shows that failing to update the boot code in a timely manner may cause boot failures during subsequent system updates. If there is no freebsd-boot partition in the system, the following steps are not necessary.

List all disks and their partition table information in the system:

Find the partition of type freebsd-boot. Here the partition index is 1, which corresponds to the -i option in the following command, then rewrite the bootcode:

Warning

gpart bootcode will write boot code to the specified partition. Improper operation may cause the system to fail to boot. Please confirm that the partition index (the -i parameter) corresponds to the freebsd-boot partition.

List the status and detailed information of all ZFS pools again:

Last updated