Reading metrics from old snapshots

Hi

I would like to build some understanding around snapshots. Sanoid/syncoid seems to work fine. For example, subvol-109-disk-0 seems to be replicated from prod1 to pc12 as expected.

root@prod1:/srv/subvol-109-disk-0# ls
bin boot dev etc home lib lib64 media mnt moodle-backup opt proc root run sbin srv sys tmp usr var

havard@pc12:/zfs/prod1/subvol-109-disk-0$ ls
bin boot dev etc home lib lib64 media mnt moodle-backup opt proc root run sbin srv sys tmp usr var

We have access to the latest snapshot. That is cool. Also, it seems to be possible to look at older snapshots. That is very cool. Like this:

root@pc12:/zfs/prod1/subvol-109-disk-0/.zfs/snapshot/syncoid_ls3_2024-12-12:19:10:10-GMT00:00# ls
bin boot dev etc home lib lib64 media mnt moodle-backup opt proc root run sbin srv sys tmp usr var

So we have a boatload of snapshots on PC12. Now, I would like to read out some metrics from these snapshots. For example:

  • when did changes occur in a folder
  • when was a file changed
  • when was a file deleted
  • how many files was added to a folder

Do you know any good tools for tasks like this?

zfs diff can tell you what changed between snapshots. You can use its output plus stat in the .zfs/snapshots directory to get the time of the latest change.

1 Like

Try hot tub time machine.

2 Likes

Thanks mgerdts

This is cool for showing high level information about datasets. Like what proxmox subvolumes are added since last summer. I can see if subsets are added, moved or deleted.

root@pc12:/# zfs diff zfs/prod1@autosnap_2025-06-18_19:45:01_monthly zfs/prod1
+       /zfs/prod1/subvol-105-disk-0
+       /zfs/prod1/subvol-104-disk-0
M       /zfs/prod1/
+       /zfs/prod1/subvol-101-disk-0
+       /zfs/prod1/subvol-108-disk-0
+       /zfs/prod1/subvol-107-disk-1
+       /zfs/prod1/subvol-109-disk-0
+       /zfs/prod1/subvol-112-disk-1
+       /zfs/prod1/subvol-103-disk-0
+       /zfs/prod1/subvol-102-disk-0
+       /zfs/prod1/subvol-115-disk-0

I now believe that the zfs list command will not show changes for files inside of a zfs subset. Please let me know if this is wrong.