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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Turning on ZFS compression can make reported space use look better than expected, but changing the setting does not recompress existing blocks. To find out what changed on your pool, compare the same datasets and accounting properties before and after a write or rewrite—and separate dataset compression from pool-wide free-space figures.

What turning on compression changes

ZFS compression is transparent and configured per dataset through its compression property. A dataset can inherit that property from its parent, but a child can also override it, so enabling compression on one dataset does not establish that every dataset in the pool uses it.

The key timing detail is that changing the property affects only newly written data. Existing blocks are not automatically rewritten just because compression was enabled. If space use changed immediately, the property change alone is not proof that old data was recompressed; check what else was written, rewritten, or included in the measurement.

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

With compression=on, ZFS selects the current default algorithm. OpenZFS documents that the default can be lzjb or lz4 depending on the pool’s enabled feature state, so on does not name one fixed codec. See the OpenZFS dataset property manual and the OpenZFS compression documentation for details.

#1 Best Overall
Sale
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

How to check the compression ratio and space accounting

Run the commands against the actual datasets you want to assess, and save the complete output at each measurement point:

zfs get compression,compressratio,refcompressratio pool/data
zfs list -o name,used,logicalused,compressratio -r pool

Replace pool/data and pool with the relevant dataset and pool names. Record the OpenZFS release, exact datasets, property values, command output, and when the measurement was taken. For a useful before-and-after comparison, keep the scope consistent and note whether a workload or rewrite occurred between readings.

Rank #2
Seagate 8TB BarraCuda Internal Hard Drive | SATA 6 Gb/s (ST8000DM004)
  • 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.
  • used is space allocated or charged to a dataset; logicalused reports logical usage for the dataset and descendants and includes metadata.
  • For a non-snapshot dataset, compressratio includes used space for descendants. refcompressratio describes referenced space instead, so the two values have different scopes.
  • These properties help explain ZFS accounting; they are not a direct measurement of application file sizes alone.

Definitions and scope are described in the OpenZFS zfsprops(7) manual. It is a rolling manual; check documentation matching the OpenZFS release installed on your system for version-specific behavior.

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

Why the apparent gain may be surprisingly large

The data written may compress well

Compression savings depend on the data’s contents and record geometry. A workload that contains more compressible data than anticipated can produce a higher observed ratio, but the title alone does not establish a particular saving or percentage.

Rank #3
Seagate 8TB IronWolf Internal NAS Hard Drive | SATA 6 Gb/s (ST8000VNZ04)
  • 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

Zero-filled blocks can become holes

OpenZFS documents that, regardless of the selected algorithm, any compression setting other than off detects all-zero blocks and stores them as holes. That can reduce allocated space substantially for data containing zero-filled records. It does not mean all zeros elsewhere in a file—or all data—will yield the same result.

The comparison may cover different accounting scopes

A dataset’s descendants, metadata, reservations, clones, and snapshots affect how space is counted. A parent’s ratio, a child’s ratio, and a pool’s available-space figure are not interchangeable measures. Check that the before-and-after commands refer to the same datasets and properties.

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

Snapshot sharing can shift charged space

Blocks shared with snapshots are not charged exclusively to each snapshot. Destroying a snapshot can therefore change how space is attributed among remaining datasets or snapshots, even though that is not a compression measurement. OpenZFS explains these pool-accounting caveats in the OpenZFS zpoolprops(7) manual.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why pool free space is not a dataset compression ratio

zpool used and available values are estimates, including adjustments for RAIDZ parity overhead. They describe pool-level accounting, not the compression ratio of one dataset. Differences in descendants, snapshots, reservations, or clones can also affect what is charged where. For that reason, a change in pool free space alone cannot identify how much compression a particular dataset achieved.

What it takes to compress existing data

To apply the setting to blocks already on disk, those blocks must be rewritten. OpenZFS lists send/receive, copying data, and zfs-rewrite as ways to do that. Rewriting is a separate operation, not an automatic consequence of changing the property; consider its space and operational requirements before choosing a method. Consult the OpenZFS compression guidance and documentation for your installed release.

How to make a fair before-and-after comparison

  1. Identify the scope. List the datasets you intend to evaluate, including relevant children, and check whether each inherits or overrides compression.
  2. Capture the starting state. Record the OpenZFS version, pool layout, snapshot state, property values, and output from the inspection commands above.
  3. Apply the setting to the intended dataset. Confirm the effective property on each dataset rather than assuming the parent setting applies everywhere.
  4. Record what happened next. Note the workload, writes, snapshot changes, or rewrite between measurements; distinguish a property change from a data rewrite.
  5. Run the same measurements again. Use the same commands and dataset scope, then interpret dataset ratios separately from pool used and available estimates.

Compression algorithms should be judged using observed ratios on your own data, compression and decompression cost on your hardware and workload, and feature availability on your pool. The documented behavior does not establish a universal best codec or expected saving.

Quick Recap

Bestseller No. 2
Seagate 8TB BarraCuda Internal Hard Drive | SATA 6 Gb/s (ST8000DM004)
Seagate 8TB BarraCuda Internal Hard Drive | SATA 6 Gb/s (ST8000DM004)
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.
$279.99
Bestseller No. 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
Western Digital 16TB WD Red Pro NAS Internal Hard Drive HDD - 7200 RPM, SATA 6 Gb/s, CMR, 512 MB Cache, 3.5" - WD161KFGX
For RAID-optimized NAS systems with unlimited number of bays; Designed to handle the demands of high-intensity 24x7 multi-user NAS environments
$714.99

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.

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