Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › data compression

I Turned On ZFS Compression Across My Storage Pool—and It Gave Back More Space Than I Expected

By Freedom251 Team · · 3 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Turning on ZFS compression can produce a surprisingly large space-saving figure, but the setting alone does not tell you why. Compression applies to newly written data, zero-filled blocks can become holes, and ZFS space figures measure different scopes. To explain what happened on a particular pool, you need its before-and-after command output—not an assumed compression rate.

What turning on ZFS compression does—and does not do

ZFS compression is transparent and operates per record. The compression property belongs to a dataset, so enabling it on one dataset does not establish that every dataset in the pool uses compression. Child datasets can inherit the property from a parent unless they override it.

As an Amazon Associate I earn from qualifying purchases.

Changing the property affects only newly written data. Existing blocks are not automatically recompressed when you change the setting. If you need existing data to be compressed under the new property, it must be rewritten—for example, by sending and receiving it, copying it, or using zfs-rewrite. That is a separate operation with its own space and operational consequences, not an automatic result of enabling compression. OpenZFS documents the compression property and its behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the apparent space returned can be larger than expected

Your newly written data may compress well

How much ordinary data compresses depends on its contents and record geometry. A measured ratio from one pool is not a prediction for another workload, and OpenZFS documentation does not provide a general-purpose percentage to expect.

#1 Best Overall
Seagate IronWolf 4TB NAS Internal Hard Drive CMR 3.5 Inch SATA 6Gb/s 5400 RPM 64MB Cache for RAID Network Attached Storage Rescue Services (ST4000VNZ06/006)
  • IronWolf internal hard drives are the ideal solution for up to 8-bay, multi-user NAS environments craving powerhouse performance
  • Store more and work faster with a NAS-optimized hard drive providing ultra-high capacity up to 16TB and cache of up to 256MB
  • Purpose built for NAS enclosures, IronWolf delivers less wear and tear, little to no noise/vibration, no lags or down time, increased file-sharing performance, and much more
  • Easily monitor the health of drives using the integrated IronWolf Health Management system and enjoy long-term reliability with 1M hours MTBF
  • Three-year limited warranty protection plan included and three year Rescue Data Recovery Services included

Zero-filled blocks can be stored as holes

OpenZFS states that any compression setting other than off detects all-zero blocks and stores them as holes, regardless of the selected algorithm. This can contribute to a larger apparent gain when newly written data contains zero-filled blocks. See the OpenZFS compression documentation.

You may be comparing different accounting scopes

used is allocated or charged space, while logicalused represents logical use by a dataset and its descendants and includes metadata. The ratio properties also differ in scope: for a non-snapshot, compressratio includes used space for descendants, while refcompressratio covers referenced space. These are useful ZFS accounting measures, not direct measurements of application file sizes. OpenZFS defines these dataset properties.

Rank #2
Seagate 8TB BarraCuda Internal Hard Drive | SATA 6 Gb/s (ST8000DM004) | Desktop HDD for everyday PC storage, gaming, & computing. Trusted reliability with 2-Year Warranty + 2-Year Rescue
  • Store more, compute faster, and do it confidently with the proven reliability of BarraCuda internal hard drives
  • Build a power house gaming computer or desktop setup with a variety of capacities and form factors
  • The go to SATA hard drive solution for nearly every PC application from music to video to photo editing to PC gaming. Ax. Sustained transfer rate OD: 190MB/s
  • Confidently rely on internal hard drive technology backed by 20 years of innovation
  • Frustration Free Packaging - This is just an anti-static bag. No cables, no box.

Pool-level used and available figures are estimates adjusted for RAIDZ parity overhead. Descendants, reservations, clones, and snapshots can affect where space is charged. Snapshot space is shared rather than exclusively charged to every snapshot; destroying one snapshot can change the accounting shown for others. A change in pool free space therefore cannot be read as the compression ratio of one dataset. OpenZFS explains pool properties and accounting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How to check the compression ratio on your datasets

Capture the output for the same dataset scope before and after a workload or rewrite. OpenZFS provides these commands:

Rank #3
Seagate 8TB IronWolf Internal NAS Hard Drive | SATA 6 Gb/s (ST8000VNZ04) | 24/7 NAS-optimized HDD. AgileArray, All-CMR, RV sensors for multi-bay, 180TB/year. 3-Year Warranty + 3-Year Rescue
  • IronWolf internal hard drives are the ideal solution for up to 8-bay, multi-user NAS environments craving powerhouse performance.date transfer rate:6.0 gigabits_per_second
  • Store more and work faster with a NAS-optimized hard drive providing 8TB and cache of up to 256MB
  • Purpose built for NAS enclosures, IronWolf delivers less wear and tear, little to no noise/vibration, no lags or down time, increased file-sharing performance, and much more
  • Easily monitor the health of drives using the integrated IronWolf Health Management system and enjoy long-term reliability with 1M hours MTBF
  • Three-year limited product warranty protection plan and three year Rescue Data Recovery Services included
zfs get compression,compressratio,refcompressratio pool/data
zfs list -o name,used,logicalused,compressratio -r pool

Replace pool/data with the dataset you want to inspect. The recursive listing shows datasets beneath pool; compare like-for-like scopes and record the full output and timing. Check each relevant dataset’s property rather than assuming a pool-wide change reached every child.

Interpret the figures together: compressratio on a non-snapshot includes descendants, refcompressratio is for referenced space, and logicalused includes descendant usage and metadata. None is a clean substitute for measuring the sizes of application files. For pool-level figures, account for the RAIDZ and snapshot caveats described above.

Rank #4
Western Digital 16TB WD Red Pro NAS Internal Hard Drive HDD - 7200 RPM, SATA 6 Gb/s, CMR, 512 MB Cache, 3.5" - WD161KFGX
  • Available in capacities ranging from 2 to 22TB(1) | (1) 1GB = 1 billion bytes and 1TB = 1 trillion bytes. Actual user capacity may be less depending on operating environment.
  • For RAID-optimized NAS systems with unlimited number of bays
  • Rated for 550TB/yr workload rate(2) | (2) Annualized Workload Rate = TB transferred x (8760 / recorded power-on hours). The maximum rated workload is specified for operating at typical temperature of 40C. Workload Rate will vary depending on your hardware and software components and configurations.
  • Designed to handle the demands of high-intensity 24x7 multi-user NAS environments
  • Western Digital partners with a wide range of NAS system vendors for extensive testing to ensure compatibility with most NAS enclosures
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What does compression=on select?

on selects the current default compression algorithm; it is not a fixed algorithm name. OpenZFS documents that the default is lzjb or lz4 depending on the pool’s enabled feature state. The exact behavior can therefore depend on the pool and OpenZFS release. Check the documentation for the installed release rather than treating a rolling manual as version-specific guidance. The current OpenZFS property manual describes the default.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The title alone cannot establish which algorithm was selected, the amount of data affected, or whether the space change came from compression rather than accounting scope or snapshots. To explain an individual pool’s result, report its OpenZFS version, pool layout, exact datasets changed, prior and new property values, snapshot state, measurement commands, timing, and complete before-and-after output.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

data compressionOpenZFSstoragestorage managementZFS

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.