Open helamonster opened 4 years ago
Issues with this request:
Mounted snapshots still change the timestamp to be the timestamp on the root directory of the snapshot's filesystem.
There's actually a lot of disk IO needed to read the snapshot's creation time. It's the same problem where zfs list -o name -s name
is the optimal way to list snapshots as fast as possible and still results in poor performance.
If you're willing to fall back to the zfs list
method you might as well do it. Forcing the .zfs/snapshot
directory to show modification times isn't going to be significantly faster.
Hmm, if having this feature requires the same method of listing snapshot creation times that zfs list does, then this is definitely a no go. I'm wondering if there is a more optimal method that can be done. But if there were, I would imagine it would already have been implemented for zfs list.
Any other ideas?
For my tools, I may have to be creative and cache snapshot info in an sqlite database or something.
most people simply embed it into the name of the snapshot.
It's still annoying that you need relatively complex and verbose syntax to achieve what ls -rt
does very succinctly.
Possible workaround: maybe write a zsnap_ls
script that implements some of the more common switches of ls but lists the snapshots of the zfs instance(s) whose .snapshot
directory it got passed on the command line.
Would anyone be interested in such a script?
System information
Describe the problem you're observing
When listing the zfs snapshot directories for a mounted dataset, the timestamps do not appear to be of any useful value. Currently, the snapshot directory timestamps appear to be undefined (or maybe the first access time of the .zfs/snapshot directory since the dataset was last mounted?), or at least not based on snapshot creation times.
It would be nice if the zfs snapshot directory timestamps contained useful values, specifically and at least the snapshot creation time. The mtime value makes the most sense. I'm not sure how the atime or ctime could be used, but they could simply be set to the same value.
Describe how to reproduce the problem
Here's an example:
How this change can be helpful
Generally, it would be nice to see the snapshot creation times when listing zfs snapshot directories (whether listing from a terminal or a file browser).
Also: I have some tools that list zfs snapshots in 1 of 2 ways:
I want to make some changes to my tools that require knowing both the snapshot creation times AND names. This effectively makes method 1 unusable so the second method must be used and is WAY slower.