User Tools

Site Tools


zfs:replication

ZFS - Replication

Replication is incredibly fast compared to traditional file based syncing methods like rsync.

zfs send <local_dataset>@<snapshot> | ssh <remote_user>@<remote host> zfs receive <remote_dataset>

NOTE: Permissions to non-root users may be needing to be set.


ZFS Send / Receive for non-root Account

sudo zfs send testpool/disk1@aug18 | ssh remoteuser@192.168.1.5 zfs recv xyz-pool/testpool-aug18

returns:

cannot receive new filesystem stream: permission denied

Set Permissions on the sender side

Assuming the sender is peter:

sudo zfs allow -u peter send,snapshot,hold testpool

Set Permissions on the receiver side

Assuming the receiver is remoteuser:

sudo zfs allow -u remoteuser compression,mountpoint,create,mount,receive xyz-pool

NOTE After setting the permissions, the sending and receiving of the snapshots should work successfully.


Check the Receiver has received the data

remoteuser@ip-:/dev$ zfs list -t snapshot
NAME                            USED  AVAIL  REFER  MOUNTPOINT
xyz-pool/testpool-aug18@aug18     0B      -  30.4M  -
zfs/replication.txt · Last modified: 2021/10/12 23:20 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki