Pcornel
Storage · Compression

Compression Fundamentals

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

Back to the Topic

Answer

Compression replaces repeated patterns in data with shorter codes. Storage systems use lossless algorithms, and the saving depends on the data: text, logs and databases compress well, media and encrypted data do not.

Remember

  • Text, logs and databases compress well.
  • Media, archives and encrypted data do not.
  • Lossless compression returns data exactly.

First checks

  • zfs get compression,compressratio <ds> — ZFS
  • compsize <path> — Btrfs actual
  • gzip -l <file> — file ratio

Verify in this order

data → compression algorithm → stored

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

Confirmation

Confirm action

Continue?