Pcornel
Storage · Compression

ZSTD

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

Back to the Topic

Answer

ZSTD (Zstandard) is a lossless compression algorithm with adjustable levels, giving better ratios than LZ4 at moderate CPU cost. It is used in ZFS, Btrfs, backup tools and Linux kernels.

Remember

  • ZSTD has adjustable levels.
  • Higher levels give better ratio and cost CPU.
  • Good for backups and archives.

First checks

  • zfs set compression=zstd-3 <ds> — ZFS zstd level
  • zstd -b3 -e9 <file> — benchmark levels
  • mount -o compress=zstd:3 — Btrfs

Commands

zpool get feature@zstd_compress
zfs send -c
zfs set compression=zstd-3 tank/data
mount -o compress=zstd:3

Verify in this order

data → ZSTD level n → 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=4308

Confirmation

Confirm action

Continue?