SOLVED Rename a snapshot? Can I rename an "auto" snapshot to save it permanently?

Joined
Oct 22, 2019
Messages
3,641
If I rename a snapshot (which was created automatically from my Periodic Snapshots), will it be spared from being deleted after its 6-month expiration?

Here's an example:

  • I have a Periodic Snapshop task for the dataset "userhomes", which is taken weekly, and automatically deleted after six months
  • The naming convention yields a snapshot named auto-20191130.0000-6m (November 30, 2019)
  • I decide to rename this specific snapshot to saved-20191130.0000

Will the snapshot saved-20191130.0000 be permanently safe even after its 6-month expiration? Or will FreeNAS "know" it is expired and delete it automatically anyways? How does FreeNAS determine this: simply by the name or some other database?
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
If you want to avoid automatic deletion of a snapshot (which is related to the timestamp in the file, not the name), use the hold function.

To avoid reinventing the wheel, this is described here: https://www.thegeekdiary.com/understanding-holding-a-zfs-snapshot-feature/

Essentially zfs hold tag pool/dataset@snapshot (where tag is some kind of note to classify why the hold was placed, so when you search for held snapshots, you can see that)
 
Joined
Oct 22, 2019
Messages
3,641
Brilliant! Thank you so much, sretalla! That's exactly what I was looking for.

I went all over the web, using all types of search queries, and "zfs hold" never came up, or perhaps was underplayed and not really highlighted. I kept bumping into "cloning" a dataset from a snapshot, and eventually gave up.

This works perfectly, and I hope other Google-search adventurers stumble upon this thread.
 
Top