ZFS send receive
June 21, 2018
To send a zfs
dataset being no root, on the origin server:
# zfs allow -g wheel send,snapshot,hold tank/foo
On the receiver, create the dataset and allow users in group wheel:
# zfs create -o mountpoint=/foo tank/foo
# zfs allow -g wheel compression,mountpoint,create,mount,receive tank/foo
# umount /foo
On the origin server create the snapshot to send:
# zfs snapshot -r tank/foo
On the origin server send the dataset by using:
$ zfs send -Rc tank/foo@today | ssh -p 23 [email protected] 'zfs receive -sFvu tank/foo'
-c
is for compress" on the origin, and-s
to resume on the receiver if ssh goes down
Then you may need to mount it on the receiver:
# zfs mount tank/foo
🔗pbzip
To send the dataset locally:
# zfs send -Rv tank/vmail@today | pbzip > vmail.bz2
To receive:
# pbzip2 -dc | zfs receive -Fv tank/vmail