Trying OpenZFS 2 on FreeBSD 12.2-RELEASE


OpenZFS 2 is a huge achievement, and makes me bullish about the long term prospects for the world’s most trustworthy and nicest to use storage system. You can even use try it today on FreeBSD 12.2-RELEASE, though I recommend tracking -CURRENT for these sorts of features.

The rule of thumb for packages with drivers or kernel extensions is to see when they were built. IIRC at the time of writing the current openzfs and openzfs-kmod packages were built for 12.1-RELEASE, so you won’t be able to boot with them with 12.2. But they’re easy to install from ports.

First make sure you have base source for your release:

# svnlite checkout /usr/src 

Then download the latest ports tree, either with portsnap or subversion:

# svnlite checkout /usr/ports

You can build the ports with the usual make install clean, but I still use portmaster(8) after all these years:

# portmaster sysutils/openzfs
# portmaster sysutils/openzfs-kmod

Now enable, assuming this has been set to YES:

# sed -i '.backup' 's/zfs_enable/openzfs_enable/' '/boot/loader.conf'

Then update your path to use the new userland tools in /usr/local/sbin, and reboot. You may need to reimport your pools created with these tools each reboot, or use this rc.d script that PMc raised in the FreeBSD forums. That caught me out the first time.

The only other caveats are to be careful when trying new features if you intend to share pools with other -RELEASE machines. ZFS does a good job with backwards compatibility, but older versions won’t recognise an encrypted OpenZFS pool, for example. 12.2-R also doesn’t support encrypted zroot boot volumes. By reading this post you acknowledge this responsibility!

Refer to the OpenZFS website and FreeBSD Handbook for more information about the process, and for the canonical documentation.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.