This content has been marked as final. Show 1 reply
Yes you can. ‘zfs send’ lets you take a snapshot of ZFS filesystems and output it to a file or stream it into another command. In your situation, you want to send the stream to a file which is stored on the NFS filesystem.
The first step with using ‘zfs send’ is to take a snapshot of the filesystem. Since snapshots are read-only, you do not have to worry about files being written at the time you run ‘zfs send’. Making a snapshot can be done by using zfs snapshot “filesystems name” like so.
# zfs snapshot tank/dataset@20121129
Now you can redirect the zfs send stream to a file:
# zfs send tank/dataset@20121129 > /nfs_storage/backups/tank-dataset.zstream
Now taking the same idea of output to a file, but it is now piped into gzip or bzip2 to compress it.
# zfs send tank/dataset@20121129 | gzip > /nfs_storage/backups/tank-dataset.zstream.gz
# zfs send tank/dataset@20121129 | bzip2 > /nfs_storage/backups/tank-dataset.zstream.bzip2
It's very important, as with any backup, to validate the backup is good. It's no use taking backups if the backups are useless when it comes time to use them. It's useful to use /usr/sbin/zstreamdump to parse the newly created stream to verify no errors.
# zstreamdump < /nfs_storage/backups/tank-dataset.zstream
To use the backup file from a ‘zfs send’ output you just need to stream or pipe it in to ‘zfs receive’. As with 'zfs send' there are may options and arguments to 'zfs receive'. The basic syntax would be:
# zfs receive tank/newdataset < /nfs_storage/backups/tank-dataset.zstream