Offsite ZFS Snapshot Replication with Syncoid and SSH
Replicate ZFS datasets across Linux VPS instances with Syncoid, leveraging atomic block-level snapshots, mbuffer acceleration, and non-root SSH.
Netbay Cloud Team
Netbay Engineering
On this page
While file-level backup tools scan directory trees and read each file sequentially, OpenZFS operates directly at the storage block layer. Because ZFS is a copy-on-write (CoW) filesystem, snapshots are created instantaneously with zero runtime performance penalty. ZFS can compare two snapshots and generate an incremental binary stream containing only the disk blocks that modified between them.
Using Syncoid (part of the Sanoid suite), you can automate incremental zfs send and zfs receive pipelines over SSH, complete with mbuffer network smoothing, LZ4 compression, and non-root permission delegation.
Block-Level vs File-Level Replication
Traditional file synchronization tools like rsync must crawl the filesystem hierarchy, reading metadata for millions of inodes to identify modified files. On multi-terabyte datasets containing millions of files, this metadata crawl alone can take hours before a single byte of data begins transferring.
In contrast, OpenZFS knows exactly which disk blocks modified the moment a transaction commits to the ZFS Intent Log (ZIL). Generating an incremental delta between snapshot@yesterday and snapshot@today requires no directory traversal; ZFS simply reads the modified block pointers directly from the uberblock tree. The result is an instantaneous, block-for-block identical replica transmitted across the private network.
Setting Up OpenZFS on Ubuntu 24.04
Ubuntu provides native, kernel-level OpenZFS support. Install the ZFS utilities and create a dedicated pool:
# Install ZFS package utilities
sudo apt-get update
sudo apt-get install -y zfsutils-linux sanoid mbuffer
# Create a dedicated ZFS dataset with LZ4 compression enabled
sudo zfs create -o compression=lz4 -o atime=off rpool/data
sudo zfs set recordsize=128k rpool/data
sudo zfs listSetting compression=lz4 significantly accelerates replication because ZFS sends pre-compressed data blocks directly over the network without recompression.
Configuring Non-Root ZFS Replication Privileges
Never run offsite backup replication over unrestricted root SSH accounts. ZFS includes fine-grained permission delegation via zfs allow, allowing an unprivileged system user to manage replication:
# Create dedicated replication user on the source host
sudo useradd -r -m -s /bin/bash syncoid_user
sudo mkdir -p /home/syncoid_user/.ssh
sudo chmod 700 /home/syncoid_user/.ssh
# Grant delegated ZFS snapshot and send permissions
sudo zfs allow syncoid_user send,snapshot,hold rpool/data
# On the target host, grant receive, mount, and create permissions
sudo zfs allow syncoid_user receive,mount,create,rollback bpool/backup_dataAdd the SSH public key from the source host into /home/syncoid_user/.ssh/authorized_keys on the target VPS.
Running Automated Replications with Syncoid
Syncoid handles snapshot creation, finding common base snapshots between source and target, calculating incremental deltas, and streaming blocks through mbuffer:
# Execute an incremental replication test
syncoid --sshkey=/home/syncoid_user/.ssh/id_ed25519 --no-privilege-elevation --mbuffer-size=128M --compress=lz4 syncoid_user@10.0.0.4:rpool/data bpool/backup_dataThe mbuffer parameter absorbs network jitter across the private interface, keeping the ZFS send pipeline continuously fed at wire speed.
Create a systemd service unit to automate syncoid replication every 15 minutes:
# /etc/systemd/system/syncoid-replication.service
[Unit]
Description=Incremental ZFS Dataset Replication via Syncoid
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
User=syncoid_user
ExecStart=/usr/sbin/syncoid --quiet --no-privilege-elevation --mbuffer-size=64M rpool/data syncoid_user@10.0.0.8:bpool/backup_data
[Install]
WantedBy=multi-user.targetVerifying Snapshots and Disaster Recovery
Verify replicated snapshots on the target host:
# Inspect snapshots on target host
zfs list -t snapshot -r bpool/backup_data
# In a disaster scenario, promote the standby dataset instantly
zfs rollback bpool/backup_data@syncoid_node-01_2026-09-29:12:00:00
zfs set readonly=off bpool/backup_data
ls -la /bpool/backup_dataZFS block streaming provides recovery point objectives (RPO) measured in minutes and recovery time objectives (RTO) measured in seconds.
Deploy high-capacity ZFS storage servers and Linux VPS on Netbay in under 60 seconds with High-Speed SSD in Lucknow DC01 — netbayhosts.in.
Keep reading
Follow along on a real VPS
Deploy Linux in under 60 seconds
These guides are written against Ubuntu, Debian, and RHEL-family images — the same ones on NetBay.
Deploy an instance