Pcornel
Storage · Compression

Compression Ratio

Cheat sheet · https://pcornel.dk/topic.php?topic=4306

Back to the Topic

Answer

Compression ratio is original size divided by compressed size, for example 2:1 means data takes half the space. Check it per dataset or volume (zfs get compressratio) to see where compression pays off.

Remember

  • 2:1 means data uses half the space.
  • Ratio varies by dataset.
  • Measure on real data.

First checks

  • zfs get compressratio,logicalused,used <ds> — ratio
  • compsize <path> — Btrfs
  • array report — compression ratio

Commands

zfs get compressratio
zfs get used,logicalused,compressratio tank/logs

Verify in this order

logical ÷ physical → ratio

Where it usually breaks

First mismatch in media/provider → controller/pool → logical object → path/protocol → filesystem/share/object namespace → consumer workload; preserve identity/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4306

Confirmation

Confirm action

Continue?