i found one sent snapshot of a file system on my backup server. It’s definitely a little bit different and i think i might have forgotten that i left it there to compare it, to make sure it’s safe to throw it into oblivion.
I noticed there is zfs-diff. But it does not really seem to be overly useful when comparing 6TB of user folders, to parse millions of lines to check for deleted or new files, especially since the real information is: even if it has been moved, is it still in?
I looked a little bit and zfs-snapshot-diff might be useful.
What do you use? How do you approach the problem? Can you share some example tidbits? What are your experiences?
Different compared to the snapshot that was sent or different compared to the live file system? Snapshots are used to replicate since it prevents any kind of live file changes to affect data in flight… I’d be surprised if any data is different from what was originally sent over snapshot.
different to the current live file system living on a different host. Ages in between. There is no more snapshot known between the sent snapshot and the life FS.
root@TRUENASSMALL[~]# zfs diff -F hdd-pool/bkp_truenas/Tank/Users@auto-2025-05-20_21-34 hdd-pool/bkp_truenas2/Tank/Users > zfsdiffUsers.txt
Not an earlier snapshot from the same fs: invalid name
like i said, the datasets were sent and due to the long time in between, they don’t share a common snapshot
If these are two different filesystems, it doesn’t matter where the second one originated from. You won’t be able to use ZFS tools to compare them.
The next best option is to use an rsync dry run with -n to print out the differences.
This is much less efficient and will require crawling the entire filesystem.
I would make a snapshot of the dataset so that rsync doesn’t complain about changes during the operation. It’s also safer because you will not risk deleting anything on the live filesystem.
bsdtar also has an mtree mode IIRC. Mtree files can be used in various creative ways. For example, we release / publish mtree of root fs we distribute if you get super-paranoid and want to check hashes on every file in /usr for example to see if anything has been changed out from what we distribute.