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

28.8 Updating OpenZFS

When implementing coexistence of multiple FreeBSD versions, an important consideration is ZFS pool version compatibility. Typically, ZFS pool versions and features change between FreeBSD major versions; for example, zpool usually changes during major version updates, which may prevent mutual access to storage pools.

Coexistence of multiple system versions such as 13, 14, and 15 can be achieved through the OpenZFS implementation in Ports.

Viewing the Built-in OpenZFS Version

First, check the current system's built-in ZFS version information to confirm the version to be replaced.

Display the current ZFS tool and kernel module version information:

# zfs version
zfs-2.2.7-FreeBSD_ge269af1b3
zfs-kmod-2.2.7-FreeBSD_ge269af1b3

The current FreeBSD base system includes OpenZFS 2.2.7 (i.e., from https://github.com/openzfs/zfs/commit/e269af1b3).

Installing filesystems/openzfs

The OpenZFS in Ports provides more flexible version choices than the base system. It can be installed using either pkg or Ports.

  • Install using pkg

# pkg install openzfs
  • Install using Ports:

# cd /usr/ports/filesystems/openzfs/
# make install clean

Editing the /boot/loader.conf File

After installation, you need to configure which ZFS module the system loads at startup. By default, the system loads the ZFS module built into the base system; this behavior needs to be modified.

To prevent the system from loading the base system's built-in ZFS version, add a comment # before zfs_load=YES to disable its automatic loading at boot.

For example:

Then add the following lines:

Restart the system after completion.

Checking the ZFS Version

After configuration and restart, you need to verify that the system has correctly loaded the Ports version of OpenZFS.

After restarting, check the ZFS version:

You can then update other storage pools or enable new features.

Warning

Considering that the OpenZFS version in the base system may not be the latest, it is recommended to use OpenZFS from Ports for all versions to maintain version consistency, including 15.0-RELEASE, which should also replace ZFS using the same method.

Last updated