How to check that all ZFS snapshots within a pool are without holds before destroying that pool
- by Graham Perrin
Question
Already I can check each snapshot of a filesystem individually, manually.
I would prefer to check all at once (all with a single command or script). Please:
can that be done with a script?
Background
From the man page for zfs(8):
zfs holds [-H] [-r] snapshot…
… -r Specifies that a hold with the given tag is applied recursively to the snapshots of all descendent file systems.
I wondered whether recent snapshots are treated as descendants of older snapshot. No:
Last login: Sat Dec 8 09:02:26 on ttys003
macbookpro08-centrim:~ gjp22$ zfs holds -r gjp22@2012-12-08-081957
NAME TAG TIMESTAMP
macbookpro08-centrim:~ gjp22$ zfs holds -r gjp22@2012-10-28-212255
NAME TAG TIMESTAMP
gjp22@2012-10-28-212255 problem with LocalStorage for WOT for Safari Mon Oct 29 6:44 2012
macbookpro08-centrim:~ gjp22$ zfs hold experiment gjp22@2012-12-08-081957
macbookpro08-centrim:~ gjp22$ zfs holds -r gjp22@2012-10-28-212255
NAME TAG TIMESTAMP
gjp22@2012-10-28-212255 problem with LocalStorage for WOT for Safari Mon Oct 29 6:44 2012
macbookpro08-centrim:~ gjp22$ zfs holds -r gjp22@2012-12-08-081957
NAME TAG TIMESTAMP
gjp22@2012-12-08-081957 experiment Sat Dec 8 9:04 2012
macbookpro08-centrim:~ gjp22$ zfs holds -r gjp22@2012-10-28-212255
NAME TAG TIMESTAMP
gjp22@2012-10-28-212255 problem with LocalStorage for WOT for Safari Mon Oct 29 6:44 2012
macbookpro08-centrim:~ gjp22$