[zfs-discuss] How to delete hundreds of emtpy snapshots
Ben Rockwood
benr at cuddletech.com
Thu Jul 17 00:32:32 PDT 2008
zfs list is mighty slow on systems with a large number of objects, but there is no foreseeable plan that I'm aware of to solve that "problem".
Never the less, you need to do a zfs list, therefore, do it once and work from that.
zfs list > /tmp/zfs.out
for i in `grep mydataset@ /tmp/zfs.out`; do zfs destroy $i; done
As for 5 minute snapshots.... this is NOT a bad idea. It is, however, complex to manage. Thus, you need to employ tactics to make it more digestible.
You need to ask yourself first why you want 5 min snaps. Is it replication? If so, create it, replicate it, destroy all but the last snapshot or even rotate them. Or, is it fallback in case you make a mistake? Then just keep around the last 6 snapshots or so.
zfs rename & zfs destroy are your friends.... use them wisely. :)
If you want to discuss exactly what your trying to facilitate I'm sure we can come up with some more concrete ideas to help you.
benr.
This message posted from opensolaris.org
More information about the zfs-discuss
mailing list