I've been asked this many times over the past 20 years and have never gotten an acceptable answer (and I am not convinced it's answerable today).
Is there any way to determine which files owned the blocks in a snapshot? i.e. given a snapshot, which files are in there?
Related, and probably even harder: Tell me what's been tiered from FabricPool..
#snapshot to files
1 messages · Page 1 of 1 (latest)
Generally, this question is not answerable. All files are in all snapshots. Say you have one file in a volume and take 10 snapshots. Which file "owns" a block in the last snapshot? What if you delete that snapshot, then the "ownership" changes to the second last snapshot. So basically every snapshot owns every block for every file that existed when it was taken.
i.e. given a snapshot, which files are in there?
If you just want to see what files are "in" a snapshot, you can use Windows Explorer's "Previous Versions" tab, or look into the~snapshotdirectory that exists in every directory (but is hidden by default)
If you think of "files existing 'in' snapshots", you're thinking about WAFL the wrong way. That's the Windows VSS way of thinking (because there, files get "copied into" a snapshot space when they're changed.
WAFL works more like a tree on a block level, so only blocks are truly "in" snapshots (but it's hard to tell in which one, since potentially all snapshots require a particular block, yet you don't want to count it 300 times as occupied, usually)
What we're trying to get is given 2 snapshots, what files were deleted between them? Or between the the most recent snapshot and the active file system. Given a 100GB snapshot, what files owned the blocks in that 100GB?
you'd have to inventory the files in both snapshots... NDMP does something like this, iirc
the SnapDiff API can tell you that, but it's not public and SnapDiff v1/v2 have been deprecated in recent ONTAP versions
well except the last part. Files don't "own" blocks in a snapshot. Snapshots "own" blocks. If you delete a snapshot, the still-owned blocks just move to the next older snapshot
you can use the snapshot reclaimable command to calculate how much data would be freed if you delete a single snapshot. But it can't break it down to files
SnapDiff v1/v2 has been re-introduced, if you're looking for a solution to provide the changed files between two Snapshots. You still need a separate data management application to run SnapDiff, though.
https://kb.netapp.com/onprem/ontap/dp/SnapDiff/What_SnapDiff_changes_were_made_in_ONTAP_9.10.1
while that's true, as I understand it, this is only a temporary workaround and v1/v2 will be removed again "soon"... So it's best not to rely too much on it