How does ZFS snapshots work and how would I implement a retention policy similar to OpenSolaris'?

Walter asked:

I’ve been using ZFS for a while and have snapshots piling up.

I believe I can start deleting the old snapshots, but want to be doubly sure. A ZFS snapshot would be essentially similar to a git tag where it is a read-only reference to a point in time version of the repository. The active data set would be HEAD and would remain unaffected if I delete a pointer to that point in time?

So, if that is the case, then if I want to have a 30-day retention policy, I can merely look at the creation date for the snapshot and discard anything > 30 days?

Are those assumptions accurate?



My answer:

That’s pretty accurate.

Consider using the sanoid tool to automate the creation and destruction of such snapshots on whatever schedule you desire.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.