ubuntu / zsys

ZSys daemon and client for zfs systems
GNU General Public License v3.0
301 stars 43 forks source link

.zfs snapshots don't show date anywhere outside user pool #233

Open danielkrajnik opened 1 year ago

danielkrajnik commented 1 year ago

Describe the bug I am trying to find a quick way to see what date snapshots in the hidden .zfs/snapshots folder were made. I figured you can long list (ls -l) them in .zfs/snapshots directory, but timestamps only show correctly on user pool. Root .zfs snapshot directories show the same date rather than the date they were actually created.

Expected behavior If it isnt possible to append the timestamp to snapshot name I'd like to know how to read creation timestamp on any .zfs snapshots folder.

For ubuntu users, please run and copy the following:

  1. ubuntu-bug zsys --save=/tmp/report
  2. Copy paste below /tmp/report content:
    COPY REPORT CONTENT HERE.

Screenshots If applicable, add screenshots to help explain your problem.

richardelling commented 1 year ago

look at the creation timestamp property for the snapshot

-- richard

On Sep 17, 2022, at 9:14 AM, danielkrajnik @.***> wrote:

 Describe the bug I am trying to find a quick way to see what date snapshots were made. I figured you can long list (ls -l) them in .zfs/snapshots directory, but timestamps only show correctly on user pool. Root .zfs snapshot directories show the same date rather than the date they were actually created.

Expected behavior If it isnt possible to append the timestamp to snapshot name I'd like to know how to read creation timestamp on any .zfs snapshots folder.

For ubuntu users, please run and copy the following:

ubuntu-bug zsys --save=/tmp/report Copy paste below /tmp/report content: COPY REPORT CONTENT HERE. Screenshots If applicable, add screenshots to help explain your problem.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

danielkrajnik commented 1 year ago

Thank you, that's true, but do you know if there is any reason why all creation timestamps show the same date everywhere except for my user's home .zfs/snapshots/*? Ive tried switching to root and they are still all the same.

richardelling commented 1 year ago

I don't understand your question. The creation timestamp is a dataset or snapshot property.

danielkrajnik commented 1 year ago

@richardelling I was hoping that it is possible to read creation date directly from the snapshot directories (inodes) rather than "zfs get creation". I've tried zfs get creation /.zfs/snapshot/*, but "cannot open 'rpool/ROOT/ubuntu_...@autozsys...': snapshot delimieter '@' is not expected here"

ls -l did list creation date on the user home directory snapshots, but I dont know why it didnt on root directories.

richardelling commented 1 year ago

"seeing" the creation time in a stat structure is implemented, but not on Linux. See the details in https://github.com/openzfs/zfs/issues/1133

So you'll need to see the creation property using the correct syntax: zfs get creation datasetname@snapshotname

danielkrajnik commented 1 year ago

thanks for explaining. Are you aware though of any way to append timestamp to the snapshots' name in zsys? That would be really helpful - could avoid a few extra steps of looking up the name --> creation date when accessing snapshots.