Snapshots & Replication — the killer feature.
ZFS snapshots are point-in-time copies of the filesystem that take milliseconds to create
and use zero extra space until data changes. Combined with zfs send/recv,
they enable block-level incremental replication that makes traditional backup tools obsolete.
Snapshots are NOT backups.
Snapshots protect against accidental deletion and logical corruption.
They do NOT protect against hardware failure, pool corruption, or site-wide disasters.
If the pool fails, all snapshots are lost with it.
Always use zfs send/recv to replicate snapshots to a separate system.
Basic operations
# Create a snapshot
zfs snapshot rpool/srv/data@before-upgrade
# List snapshots
zfs list -t snapshot -o name,creation,used -s creation
# Roll back to a snapshot (destroys all changes since)
zfs rollback rpool/srv/data@before-upgrade
# Access snapshot contents without rolling back
ls /srv/data/.zfs/snapshot/before-upgrade/
# Compare changes between snapshots
zfs diff rpool/srv/data@before-upgrade rpool/srv/data@after-upgrade
Replication
# Full replication to another machine
zfs send -R rpool/srv/data@snap | ssh backup "zfs recv -F backup/srv/data"
# Incremental (only changed blocks since last sync)
zfs send -R -I @old-snap @new-snap | ssh backup "zfs recv backup/srv/data"
# Encrypted replication (ciphertext only — receiver can't read the data)
zfs send -w rpool/srv/data@snap | ssh backup "zfs recv backup/srv/data"
# With mbuffer for progress and I/O smoothing
zfs send -R rpool/srv@snap | mbuffer -s 128k -m 1G | ssh backup "zfs recv -F backup/srv"
Automation: Sanoid & Syncoid
Sanoid — automated snapshot management
Defines snapshot policies per dataset via a simple INI config. Automatically creates and prunes snapshots based on retention rules.
# /etc/sanoid/sanoid.conf
[rpool/home]
use_template = default
recursive = yes
autosnap = yes
autoprune = yes
hourly = 24
daily = 7
weekly = 4
monthly = 12
Syncoid — automated replication
Wraps zfs send/recv for secure, incremental replication over SSH. One command.
syncoid --recursive --sendoptions="--compressed" \
rpool/home remoteuser@backup:tank-backup/home
zrepl — daemon-based replication
For complex setups: bi-directional sync, resume tokens, network drop resilience, many-to-many replication. YAML config. Ideal for managing many ZFS hosts at scale.