The Tridecadal Korean (astralblue) wrote,
The Tridecadal Korean

Quick tip: Figuring out which ZFS snapshot is older (of the same dataset)

Task at hand: You have two snapshots, say mypool/myfs@omgwtf and mypool/myfs@kthxbye, and you need to know which one predates the other.  A common trick is to compare their creation property, which is essentially their timestamp.

Problem: creation property isn't reliable, because system clock (from which its value is captured) may go back in time, especially when NTP “steps” system clock instead of slewing it.

Solution: ZFS does keep the snapshots fully ordered, i.e. they are sequential, and the ordering between two snapshots may be determined by dry-running incremental send:

zfs send -n -i @omgwtf mypool/myfs@kthxbye
zfs send -n -i @kthxbye mypool/myfs@omgwtf

One of these commands will succeed (zero exit code) with nothing printed out; the other will fail (nonzero exit code) saying that the incremental source (the one after -i) is newer than the target.  Take the one that succeeds: Its incremental source comes before the other.


  • Feeling All Exhausted…

    Plus feeling all pumped up after an intense workout session, like it being so damn hard to get my arms onto the keyboard to type this. It's the best…

  • Two Different Feelings of Tightness

    A shirt feeling tight because of body fat… -vs- A shirt feeling tight because of muscle mass. Man, this is so tight. ♥

  • Law of Catabolism Dictates That…

    No matter how well I eat, I lose weight when I'm sick. And my weight training took a hit too (in terms of numbers). Oh well. しっかりしろ、ユジン。 Off…

  • Post a new comment


    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.