Dataset Snapshots are not being cleaned up automatically

gswhiteuk

Dabbler
Joined
Jul 26, 2023
Messages
23
Hi everyone, question for our community on Snapshots and auto-deletion please?

I logged in to my Trueness Scale server last night and noticed there was a system message. The error was a warning stating "There are to many Snapshots, and that if they are not deleted system performance mod be affected"

So I started investigating snapshots for different directories and older snapshots were not being deleted.

I have two snapshots setup on the complete pool, top down.

One is taken hourly, everyday, but only retain 1 weeks worth.
The other
Is taken monthly, but retained for three months.

I have only had the system built for 4 weeks.

The snapshots appear to be set to 'Not be Destroyed' even though I have set up the tasks to delete after 1 week!

1692347659695.png


So I am having to go into each dataset and delete manually. Which is long and tedious as once you delete a group of snapshots, unless you take another snapshot of that dataset the overall number of snapshots does not update.

Also why would I have over 7000 snapshots of a directory when the system has only been built for a week?

1692349137640.png


--

Does anyone know why this is happening please, have I hit a potential bug?

How would I delete all snapshots and start over please without going through thousands of snapshots manually through the GUI? Is there a ZFS Command line I could use please?

Thanks so much for taking the time to read,

all the best
Gary
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
zfs destroy pool/dataset@oldest-snapshot%newest-snapshot

All you need is the name of the oldest and newest snapshots you want destroyed and the command above will destroy all snapshots in-between.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,700
Any ideas why the snapshots are not being cleared down automatically please, as instructed?
The ix-applications dataset (and associated snapshots) are managed by the apps subsystem, not by your snapshot tasks, so those are "manual" snapshots, hence no expiry set.

There are a bunch of threads complaining about how pools are filling up with snapshots of apps, but I haven't yet seen the explanation about when a "fix" for that is coming or what it will be exactly.
 

gswhiteuk

Dabbler
Joined
Jul 26, 2023
Messages
23
Thanks for the quick reply, understood. I will re-set my snapshots to be a little more liberal and Manu delete what I do not need :)

thanks again
 
Top