While diffing mounted snapshots would work, it sounds like it could be horribly slow in many cases.
Is there btrfs specific functionality for diffing snapshots? (I was unable to find any in the docs)
It sounds like you're looking for btrfs send/receive, which will appear in Linux 3.6. The
I'm running Debian stable which does not have
If you have snapshot1 and snapshot2 and you want to know what changed in the later one, snapshot 2, since snapshot1 was made you can use the script below which provides
which will list all files changed in newsnapshot/ since oldsnapshot/.
e.g. take the daily snapshot of a subvolume case:
What changed between snap1 and snap2?
So we can see the new file, see the modified file, but the deletion is not reported. This is because the command reports on files that exist, not ones that now don't.
What changed between snap2 and the live subvolume?
the renamed file is not reported. Its data has not changed.
Now what if we add data to the renamed file
OK, makes sense. But let's make a new file
eh! where's lala?. If you add another file,
However, the oddness comes when you compare a live subvolume against a previous state, not when you're comparing (read-only) snapshots. So this could still be useful unless you want to also identify deleted files.