Pcornel
Storage

Compression

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

Back to the Topic

Answer

Storage compression encodes data in fewer bytes, usually with fast algorithms like LZ4 or ZSTD, to save capacity and sometimes speed up I/O. Already compressed or encrypted data gains little.

Remember

  • Compression happens before deduplication and encryption in most systems.
  • Already compressed or encrypted data does not shrink.
  • Fast algorithms can increase throughput by writing fewer bytes.

First checks

  • zfs get compressratio <ds> — ZFS ratio
  • btrfs filesystem du / compsize <path> — Btrfs
  • Get-Volume (compression attribute) — NTFS compression

Verify in this order

write → compress → fewer blocks

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=4303

Confirmation

Confirm action

Continue?