Some zfs commands

Query status of pool:

zpool status

Check filesystem:

zpool scrub tank

Create snapshot with name derived from current date:

zfs snapshot tank/data@'date +%Y-%m-%d' (Replace ' with backticks)

List snapshots:

zfs list -t snapshot

Destroy snapshot:

zfs destroy tank/data@snapshotname

Send snapshot over network:

zfs send tank/data@snapshot  | ssh root@192.168.1.1 zfs recv tank/data

Send snapshop unencrypted, but very fast via nc:

nc -w 120 -l -p 8000 | zfs receive tank/data
zfs send tank/data@snapshot | nc -w 20 192.168.1.1 8000

Send incremental snapshots:

zfs send -i tank/data@snapshot1 tank/data@snapshot2  | zfs recv anothertank/data

In case there are changes on the destination filesystem, the snapshot cannot be added and need to be rolled back. This can be done automatically using the -F flag:

zfs send -i tank/data@snapshot1 tank/data@snapshot2  | zfs recv -F anothertank/data

Start transfer and detach process, so shell can be closed. Useful for very long running transfers:

sudo -b nohup sh -c "sudo zfs send backup/archiv@2017-11-04 | sudo zfs recv extern/archiv"

Edit mount point:

zfs set mountpoint=/mnt tank/data