Announcement

New LTS for FreeBSD is now available in an initial release  Learn More

Klara

Key Article Takeaways 

  • Enable OpenZFS 2.3 features because a workload needs them, not because they're available. Plan upgrades carefully: feature flags can break compatibility with older systems. 
  • JSON output is a low-risk improvement for monitoring and automation, while Fast Dedup and Direct IO should be applied selectively and measured against real workloads. 
  • Scope RAIDZ expansion and long filenames to the datasets that need them. Don't enable either everywhere. 

OpenZFS 2.3 is one of the most feature-dense releases the project has shipped in years, and we've spent the last month covering the headliners in depth. This piece is the practical companion: what you should focus on enabling, in what order, with the commands to do it. The kind of article you keep open in a terminal split. 

One principle to remember as we get started: each new pool feature is a one-way door. Once a feature flag is active, older systems can no longer import the pool. Enable things because a workload needs them, not because the changelog is exciting. You can always enable it later, but you can’t roll back. 

Step 0: Know Where You Stand

Check what you're running and what your pools can use: 

$ zfs version 
zfs-2.3.0-1 
zfs-kmod-2.3.0-1
$ zpool get all tank | grep feature@ | grep disabled 

Firstly: make sure the two ZFS versions listed, the userspace tools and the kernel module match. If there is a mismatch, you’ll want to fix that first, before starting any pool upgrades. 

Document the “before” start of your pool, so that if you run into any trouble, you have the details to help with diagnosing the issue. 

$ zpool status -v > zpool.status.before 

Now we are good to start enabling the new features. 

Anything listed as disabled will become available after a pool upgrade: 

$ zpool upgrade tank      # one-way: older hosts can't import afterward 

Or you can enable individual features: 

$ zpool set feature@block_cloning=enabled tank # turn on only one feature 

If a pool must stay importable by older systems (a rescue environment, a replication target on 2.2), pin it instead of upgrading blindly: 

$ zpool set compatibility=openzfs-2.2 tank 

That property is the adult supervision for everything below: it stops an enthusiastic zpool upgrade from stranding your pool by enabling more features than you need. 

One special case deserves extra consideration: boot pools. If the pool you're upgrading is the one your system boots from, confirm your bootloader understands each of the new feature flags before you upgrade. An upgraded boot pool with an older bootloader is the classic recipe for a machine that stops booting, and it is entirely avoidable: upgrade the loader first or leave the boot pool pinned to a compatibility set and keep the new features for your data pools, which is where they matter anyway. 

1. JSON Output: Start Using It Today, Everywhere

The least glamorous feature in 2.3 is the one every operator should adopt first. Core commands now emit JSON: 

$ zpool status -j | jq '.pools.tank.state' 
"ONLINE"
$ zfs list -j -o name,used,avail | jq '.datasets[] | select((.properties.used.value | tonumber) >= 100000000000 )' 

If you have ever written a regex against zpool status output and had it break on a resilver, this is your liberation. Monitoring integrations, fleet inventory, EoL audits: all of it becomes a jq one-liner instead of a parsing project. A concrete example: a capacity check across a fleet that used to need a fragile awk pipeline: 

$ zpool list -j | jq -r '.pools[] | select((.properties.capacity.value | rtrimstr("%") | tonumber) > 80) | .name' 

Feed that to your monitoring/alerting, and you have the 80% fill-level warning from Part 1 of our ZFS misconfigurations series, implemented in one line. There is nothing to enable and no risk. No more trying to screen-scrape or regex your way through it. 

2. Fast Dedup: For the Datasets That Earn It

We covered the theory for successfully leveraging Fast Dedup in Misconfigurations Part 2. Now we’ll get into the practical steps to make the most of this new feature. Fast Dedup is worth turning on where you have a significant amount of data duplication, such as with: VM image stores, backup targets holding many similar systems, and build artifact archives. It is still not for general-purpose datasets, as they rarely have much duplicate data. 

To get started: 

$ zpool upgrade tank                        # feature@fast_dedup needs to be enabled 
$ zfs create -o dedup=on tank/vm-images     # scope to a dataset, never pool-wide
$ zpool set dedup_table_quota=24G tank      # Set a ceiling to constrain memory usage
$ zpool status -D tank                      # watch table size and dedup ratio 

Then we get to the bit that makes Fast Dedup so interesting. Once you hit the dedup_table_quota, ZFS will basically stop adding newly created data to the DDT and only deduplicate any data that matches what is already in the DDT. This severely limits the usefulness of dedup, since it is the new data that is most likely to contain the first and second copies of new data. To address this, there is a new maintenance command that legacy dedup doesn’t support: 

$ zpool ddtprune -d 30 tank    # evict single-reference entries older than 30 days 

This will evict any older blocks that are taking up space in the DDT but have not yet found a duplicate. This makes room for blocks to be added to the table, so that when a duplicate does arrive, it is found and space is saved, instead of both copies of the new block being threaded as unique because the DDT was full. 

For the quota value, start from your ARC budget, ensuring you are not using the majority of your useful cache just for the DDT. Decide how much memory you can actually spare for the DDT, set the quota there, and let the pruning process keep the working set within that threshold. A bounded table that misses some duplicates is a fine outcome. An unbounded one that evicts useful data from your ARC is not. 

Give it a month, then judge with numbers: if zpool status -D shows a dedup ratio under about 1.3x, the workload didn't earn it. Turn it off (new writes stop deduping) and let compression do the heavy lifting. 

3. Direct IO: For Databases on NVMe, After You Measure

With Direct IO, an application explicitly says: This data doesn’t need to be added to the cache. So, if an application is reading or writing some data, and it is fairly certain it won’t ask for that data again any time soon, like a full table scan of a database, or a nightly backup, it allows ZFS to avoid evicting useful data from the ARC for data that is unlikely to be requested again. 

The new direct dataset property controls whether reads and writes can bypass the ARC: 

$ zfs get direct tank/pgsql 
NAME        PROPERTY  VALUE     SOURCE
tank/pgsql  direct    standard  default 

The default, standard, is already the right setting for almost every workload: applications that explicitly request O_DIRECT get the benefit, everything else keeps using the ARC as normal. The best advice is less "turn it on" and more "let your applications turn it on if they can make use of it." If you run PostgreSQL or MySQL on fast NVMe and the application is configured for direct I/O, you now get the benefit without doing anything. 

Reserve direct=always for very narrow specific cases: an NVMe pool, an application with its own cache, and benchmarks of your workload showing it really does help. Short of that, it discards ZFS's best feature. If you test it well, with your recordsize, your level of concurrency, and a realistic working set, not just the fio defaults, then you can consider overriding the default. 

4. Long Filenames: For the Datasets That Hit the Wall

Filenames up to 1023 bytes long. If you are dealing with Unicode or emojis, that is only 255 characters, so it isn’t quite as exaggerated as it sounds. Enable it per dataset, only when you really need it: 

$ zfs set longname=on tank/objects 

Most workloads never touch the old 255-byte limit and should leave this alone, since enabling the feature flag affects pool importability like any other. The datasets that need it know who they are: object storage gateways mapping S3 keys to files, scientific datasets with encoded metadata in names, and anything receiving files from systems that already allow long names. 

5. RAIDZ Expansion: When Growth Arrives One Disk at a Time

This topic has a full article of its own this month, but here is a quick overview: 

$ zpool attach tank raidz1-0 da4    # 4-wide becomes 5-wide, online 

It is excellent for growing small RAIDZ pools without buying a second set of disks. Remember the fine print: existing blocks keep their old data-to-parity ratio until rewritten, parity level never changes, and IOPS don't improve. For the full decision matrix, read our in-depth article on RAIDZ expansion.  

The Monday Morning List 

In order of effort to payoff: 

  1. Convert one monitoring script to zpool status -j (an hour, zero risk)

  2. Set compatibility= on pools that replicate (five minutes of insurance)

  3. Audit dedup candidates: backup and VM datasets (run zdb -S tank to simulate)

  4. Check your database's direct I/O configuration (apps that need it request it)

  5. Put zpool ddtprune in cron if you enabled dedup (monthly is plenty) 

Number 3 deserves some more detail: zdb -S tank simulates dedup on existing data and prints the ratio you would get, before you commit to anything. It is the cheapest way to find out whether Fast Dedup will earn its memory on your actual data, and almost nobody runs it. 

The Theme 

Every feature in 2.3 rewards the same discipline: scope it, measure it, and let the workload justify it. The days of ZFS having a reputation for eating RAM or surprising operators were never about bad features; they were about good features enabled everywhere because they were new. 2.3 gives you more capability than any release in recent memory, and the same tools to use it properly. Turn on what your data needs. Leave the rest for the workloads that need them. 

 

Back to Articles