Comparing Source against replication on file level

Hi Experts

Quick question, can I do a files level comparison (not snapshot) between my source data set vs the replication? I search a bit and some saying uses rsync task with dry run but not finding some solid pages telling the exact step/command line…

Rgds

JL

You need to post a bit more on details of what you have currently set up and what you are trying to do. I can’t tell if you are already using ZFS replication with snapshots and you are just attempting to verify or something else entirely.

A successful ZFS replication is identical to the source snapshot. Unless it was aborted, failed[1], or your system had a memory issue, the result is identical to the source.


  1. Unlike file-based syncs, aborted or failed ZFS replications do not exist as “partial” completions. It either completes or it does not. The replication must start all over again if a “resume token” was not created on the target dataset. ↩︎

For a file level check between source and replica, rsync in dry run with checksums works, for example rsync -rcn --itemize-changes /mnt/source/dataset/ /mnt/replica/dataset/ and anything it lists differs. Mount or browse the replica from its latest snapshot, since the replica dataset is usually read only. Keep in mind it reads every file on both sides, so it can take a long time on big datasets. As winnielinnie said, a completed ZFS replication is already block identical to the source snapshot, so this is mostly useful as a sanity check. Disclosure: I work at CyberSnap.