FreeNAS-11.3-U4.1 expired snapshots remain

JustinOtherBobo

Dabbler
Joined
Aug 21, 2018
Messages
26
This is a "fresh" FreeNAS-11.3-U4.1 install to which an old 11.1 config file was loaded.

I have been noticing a lot of "stale" snapshots hanging in there, well past a few days post expiry. Replication tasks using the snapshots show as completed (and last sent snapshots seem to be current.)

Shift left click doesn't seem to work over multiple pages of snapshots, so manually choosing several hundred expired snapshots to delete is painful.

Is this unique to my environment, or is it a common issue with 11.3-U4?

Any command line or other suggestions on how I can find and delete "stale" snapshots more efficiently?

Thank you.
 

JustinOtherBobo

Dabbler
Joined
Aug 21, 2018
Messages
26
Looks like I am the only one having the problem?

Due to deficient automation skills this was time consuming and tedious.

Created a list of all existing snapshots:
Code:
zfs list -t snapshot -oname > /mnt/poolname/shareddataset/snaplist.txt

Then used a text editor to edit snaplist.txt, leaving me with a list of expired snapshots.

Would have been nice to know how to issue the destroy command against the filenames in the list! :)

-n tests what will die.
Remove -n to actually execute.
Note to self: -d to destroy a snapshot with an explicit zfs hold.

Code:
zfs destroy -n -v poolname/dataset@snapname
for a range:
zfs destroy -n -v poolname/dataset@snapname_oldest%snapname_newest


Replications may be deliberately holding snapshots past their expiry date in order to complete a transfer. Don't delete everything leaving yourself without a common snapshot on both ends of your replication. Ask me how I know!
 
Last edited:
Top