I'm not new to ZFS. I've been using it a couple of years but I've only just started making snapshots and I've created a cronjob and script to take a daily snapshot of a few of my datasets, which all reside under the same pool.
I was looking for a quick way to list my snapshots in another cron script so that I could destroy the oldest one. The goal is to have a continuously rolling set of 7 snapshots: so I can roll back to any day out of the last 7 days.
I have my script running and I currently only have 1 set of snapshots (today). I found a very cool answer, here by https://serverfault.com/users/15810/AaronLS for finding the oldest snapshot and destroying it. I plan to add this into my bash script, so that it takes a snapshot each day and immediately afterwards it finds the oldest one and destroys it.
The answer by AaronLS is in this question: How to delete all but last [n] ZFS snapshots?
My question is one of ignorance, really. I thought that the first snapshot you made from any given dataset was a complete image of that dataset, with any further snapshots being based on that first snapshot and any more recent snapshots were merely a record of the changes since the first snapshot.
So if I delete the very oldest snapshot, does ZFS then have to alter the second-oldest snapshot in order to have a complete "first snapshot" image again?
Have I explained myself correctly? Surely if you delete the original snapshot then the next oldest now becomes the "orginal" snapshot and would need some data juggling around in it, in order to become a full dataset image?
Could someone explain it to me in laymans terms why my assumptions are wrong? I feel that I kind of understand snapshots but I'm just lacking confidence. I was going to try running my script tonight, on a 10 minute crontab, so that I could simulate a week's worth of snapshots in 70 minutes but I'm not confident that I understand the maths before I go ahead.
I apologize for the bad formatting, too. If I knew how to quote a username and link to another article properly I will edit this post to make it neater. I've not posted on here for a long while.