Snapshot (mass) delete limit of 100 at a time

somewhatdamaged

Dabbler
Joined
Sep 5, 2015
Messages
49
TrueNAS Core gives the option to delete all snapshots, but SCALE only allows 100 at a time. Infuriating if you have thousands. Any ideas? I don't want to have to resort to the command line ideally
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
TrueNAS Core gives the option to delete all snapshots, but SCALE only allows 100 at a time. Infuriating if you have thousands. Any ideas? I don't want to have to resort to the command line ideally
Making snapshots is very cheap, but deleting snapshots is quite expensive and requires metadata changes.

I assume this is a mechanism that has been added to avoid system performance issues. It should be documented or configurable... I'll check with the (very busy) engineering team.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
TrueNAS Core gives the option to delete all snapshots, but SCALE only allows 100 at a time. Infuriating if you have thousands. Any ideas? I don't want to have to resort to the command line ideally
It looks like this is a bug (perhaps in the UI)... can you report-a-bug?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
zfs list -t snap | awk '/<pattern>/ { printf "zfs destroy %s\n", $1 }' | sh
 

PyCoder

Dabbler
Joined
Nov 5, 2019
Messages
30
Use the shell for stuff like that!

I use as example this command when I want to get rid of all snapshots called "foobar":

Code:
zfs list -H -o name -t snapshot | grep foobar | xargs -n1 zfs destroy -r
 
Last edited:

somewhatdamaged

Dabbler
Joined
Sep 5, 2015
Messages
49
Good morning chaps, thanks for the reply. Yeah, i know that the shell is probably the best option, but i'm not super au fait with the command line stuff, and just wondered why it was so easy on Core, and limited to 100 at a time on Scale. I've managed to delete the snapshots now after some faffing
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
It's super important with these commands to make 200% sure you never delete any snapshot of ix-applications or it's children.
 
Top