Last night, I found that I had a number of unused ZFS snapshots. I decided to destroy some of them. The first destroy locked up the system. Nagios reported everything was dead. I remotely power cycled the system. After it came back, I noticed that a scrub was in progress. This had not been initiated because of the power cycle. The scrub was a weekly automatic operation which started some hours before my destroy attempt.
I decided to let the scrub complete before proceeding.
Here is what I stared with:
$ zpool status pool: storage state: ONLINE scan: scrub repaired 0 in 20h24m with 0 errors on Wed Oct 3 23:38:44 2012 config: NAME STATE READ WRITE CKSUM storage ONLINE 0 0 0 raidz2-0 ONLINE 0 0 0 gpt/disk01-live ONLINE 0 0 0 gpt/disk02-live ONLINE 0 0 0 gpt/disk03-live ONLINE 0 0 0 gpt/disk04-live ONLINE 0 0 0 gpt/disk05-live ONLINE 0 0 0 gpt/disk06-live ONLINE 0 0 0 gpt/disk07-live ONLINE 0 0 0 errors: No known data errors $ zfs list NAME USED AVAIL REFER MOUNTPOINT storage 7.99T 911G 14.5G /storage storage/compressed 7.96T 911G 53.3K /storage/compressed storage/compressed/bacula 7.59T 911G 4.66T /storage/compressed/bacula firstname.lastname@example.org 2.93T - 3.46T - storage/compressed/home 2.75G 911G 2.75G /storage/compressed/home storage/compressed/jails 373G 911G 373G /storage/compressed/jails storage/pgsql 13.8G 911G 13.8G /storage/pgsql $ zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT email@example.com 93.8K - 14.5G - firstname.lastname@example.org 38.4K - 51.2K - email@example.com 8.90G - 2.29T - firstname.lastname@example.org 159K - 2.29T - email@example.com 78.9K - 2.29T - firstname.lastname@example.org 78.9K - 2.29T - email@example.com 1.12M - 2.58T - firstname.lastname@example.org 360G - 3.46T - email@example.com 122K - 2.75G -
As you can see, I have some snapshots which are nearly two years old. I don’t need them any more. Let’s let them go.
# zfs destroy firstname.lastname@example.org # zfs destroy email@example.com # zfs destroy firstname.lastname@example.org # zfs destroy email@example.com # zfs destroy firstname.lastname@example.org # zfs destroy email@example.com # zfs destroy firstname.lastname@example.org # zfs destroy email@example.com # zfs destroy firstname.lastname@example.org
Now I have:
$ zfs list NAME USED AVAIL REFER MOUNTPOINT storage 5.06T 3.82T 14.5G /storage storage/compressed 5.03T 3.82T 53.3K /storage/compressed storage/compressed/bacula 4.66T 3.82T 4.66T /storage/compressed/bacula storage/compressed/home 2.75G 3.82T 2.75G /storage/compressed/home storage/compressed/jails 373G 3.82T 373G /storage/compressed/jails storage/pgsql 13.8G 3.82T 13.8G /storage/pgsql
I’ve gone from 8T to 5T in use. Which means I have 3T to grow. That’s enough for now. :)