I'm running a FreeBSD host with ZFS.
Let's pretend that I am storing a series of incremental ZFS snapshot images on a remote host using
zfs send -i zpool/data/foo@04hoursago zpool/data/foo@10hoursago > /nfs/backups/foo.zfs
Or perhaps I want to send the stream through an FTP server:
% ftp backup ftp> put "| zfs send -i zpool/data/foo@04hoursago zpool/data/foo@10hoursago" /backups/foo.zfs
I would like to validate this remote image. I'd like to print a list of snapshots that are in this image, or optionally extract a checksum or other metadata to help check that the image is valid and contains the snapshots like I expected.
How can I query the image file and see what is inside?
I have tried
zfs receive with the
verbose) flags to list the snapshots within the image, but this may not work on a live system:
# zfs receive -nv zpool < /nfs/backups/foo.zfs cannot receive new filesystem stream: destination 'zpool' exists must specify -F to overwrite it # zfs receive -nv -F zpool < /nfs/backups/foo.zfs cannot receive new filesystem stream: destination has snapshots (eg. zpool@09hoursago) must destroy them to overwrite it