A snapshot is a quick photograph of a filesystem's state, and replication spreads it elsewhere. This episode covers snapshots for ext4/XFS via LVM and fs-freeze, instant btrfs and ZFS snapshots, then incremental btrfs send/receive and zfs send/receive patterns for offsite backup.

Data corruption and deletion can happen at any time — from bugs, human error, or ransomware attacks. The main shield isn't the filesystem, it's snapshots and backups. Snapshots give you a recovery timeline; backups ensure that timeline survives the physical loss of a disk.
Episode 9 covers snapshots on all four filesystems. For ext4 and XFS, which write in place, snapshots need help from LVM or fs-freeze. For btrfs and ZFS, which are Copy-on-Write, snapshots are nearly instant and cheap. Then we cover replication with btrfs send/receive and zfs send/receive to an offsite location.
The golden rule to remember throughout this episode: a snapshot is not a backup. A snapshot shares physical blocks with the original data — if the disk fails, both are lost together.
LVM (Logical Volume Manager) provides snapshots at the block level: when a snapshot is taken, LVM copies the old blocks before they're overwritten. This is the standard way to photograph ext4 or XFS:
sudo lvcreate -L 1G -s -n snap-data /dev/vg0/lv-data
sudo mount /dev/vg0/snap-data /mnt/snapAn LVM snapshot needs extra space to hold the changes since it was taken — if it fills up, the snapshot becomes invalid. Give it a sufficient size and monitor it with lvs.
For a snapshot to be consistent, the filesystem must be quiescent. fsfreeze temporarily freezes writes:
sudo fsfreeze --freeze /mnt/data
sudo lvcreate -L 1G -s -n snap-frozen /dev/vg0/lv-data
sudo fsfreeze --unfreeze /mnt/dataThe fsfreeze --freeze command forces the journal and buffers to finish before the snapshot is taken — mandatory for consistency-sensitive databases. Without a freeze, a snapshot can contain half-written files.
On btrfs, a snapshot doesn't copy anything — it just points to the same blocks:
sudo btrfs subvolume snapshot -r /mnt/lab/data /mnt/lab/@backups/data-$(date +%F)
sudo btrfs subvolume list /mnt/labThe -r option creates a read-only snapshot that's safe as a restore point. Because of COW, creating it takes zero space — space only grows when the original blocks change.
ZFS snapshots follow the pool/dataset@label pattern:
sudo zfs snapshot labpool/data@hari-$(date +%F)
zfs list -t snapshotZFS and btrfs snapshots give you much tighter backup frequency — even every hour is no problem. This power is why COW filesystems outperform ext4/XFS for data protection.
btrfs send produces a stream of changes. For incremental, give a baseline snapshot with -p:
sudo btrfs send -p /mnt/lab/@backups/data-minggu1 \
/mnt/lab/@backups/data-minggu2 | ssh remote \
"sudo btrfs receive /mnt/backup"-p means parent snapshot — only the differences since the parent are sent. After receive, verify on the remote side with btrfs subvolume list.
ZFS uses zfs send -i for incremental and zfs receive on the receiving side:
sudo zfs snapshot -r labpool@penuh
sudo zfs send -R labpool@penuh | ssh remote "sudo zfs receive backup"
sudo zfs snapshot labpool@inkremental
sudo zfs send -R -i labpool@penuh labpool@inkremental | ssh remote "sudo zfs receive backup"-R sends all descendant datasets, -i states the difference from a previous snapshot. The -R -i combination is the truly production-grade full replication pattern.
For trusted networks and maximum throughput, streams can be sent directly via nc without encryption:
sudo zfs send labpool/data@snap | nc -q 0 backup-host 9000An important note: netcat streams are not encrypted — only use them on private networks or over VPN. For public paths, stick with SSH.
A healthy backup combines local snapshots, a remote replica, and removable media:
Local snapshots handle small mistakes (deleted files, failed updates). Remote replicas handle big scenarios (dead disks, fire). Both have different roles and can't replace each other.
Manual replication is bound to be forgotten. Schedule it in cron or a systemd timer, and verify periodically with test restores:
0 2 * * * sudo zfs snapshot labpool/data@auto-$(date +\%F)
15 2 * * * sudo zfs send -R -i labpool/data@auto-$(date +\%F --date=yesterday) \
labpool/data@auto-$(date +\%F) | ssh remote "sudo zfs receive backup"A backup that's never been tested isn't a backup — test a restore at least once a month.
Snapshots and replication are two sides of the same data protection coin. Snapshots give recovery speed; replication gives geographic resilience. For ext4/XFS, both require LVM and discipline; for btrfs and ZFS, both are nearly free thanks to COW.
Key takeaways:
fsfreeze for consistency.btrfs send -p and zfs send -R -i are the official incremental patterns.In the next episode, episode 10, we cover filesystems for special workloads — how to choose a filesystem for databases, containers and VM images, media file servers, and root filesystems. You'll see why no single filesystem is perfect for every workload.