28.8 Updating OpenZFS
Last updated
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.
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_ge269af1b3The current FreeBSD base system includes OpenZFS 2.2.7 (i.e., from https://github.com/openzfs/zfs/commit/e269af1b3).
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 openzfsInstall using Ports:
# cd /usr/ports/filesystems/openzfs/
# make install cleanAfter 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.
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
# zfs_load=YES # Do not load the built-in ZFS kernel modulezfs_load=NO # Explicitly disable built-in ZFS kernel module loading
openzfs_load=YES # Enable OpenZFS module loading# zfs version
zfs-2.2.7-FreeBSD_ge269af1b3
zfs-kmod-2.3.5-1