Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Mar 2011 11:41:58 -0400
From:      Dillon Kass <lists@loveturtle.net>
To:        current@freebsd.org
Subject:   ZFSv28 zfs destroy -r bug.
Message-ID:  <813ECD73-4FAA-4FA4-BAE7-016ACCBA5626@loveturtle.net>

next in thread | raw e-mail | index | archive | help
Hello. I posted this to freebsd-fs yesterday regarding 8.2-R & ZFSv28 =
patches, this morning I confirmed the same behavior on HEAD so I figured =
I'd also post it here (and there's higher volume :-)

I also tested this on Solaris 11 express to make sure it's specific to =
FreeBSD and not some kind of "feature" in newer ZFS versions..

It used to be the case that if you zfs destroy -r pool@snapshot as long =
as any child dataset had @snapshot the command would destroy it. In =
other words, pool@snapshot didn't need to exist as long as =
pool/dataset1@snapshot existed.=20

Here's how it should work (Solaris 11)

turtle@solaris11vm:~# zfs list -t all -r rpool1/test
NAME                         USED  AVAIL  REFER  MOUNTPOINT
rpool1/test                  127K  6.34G    34K  /rpool1/test
rpool1/test/test2             31K  6.34G    31K  /rpool1/test/test2
rpool1/test/test2@testsnap      0      -    31K  -
rpool1/test/test3             31K  6.34G    31K  /rpool1/test/test3
rpool1/test/test3@testsnap      0      -    31K  -
rpool1/test/test4             31K  6.34G    31K  /rpool1/test/test4
rpool1/test/test4@testsnap      0      -    31K  -

turtle@solaris11vm:~# zfs destroy -r rpool1@testsnap

turtle@solaris11vm:~# zfs list -t all -r rpool1/test
NAME                USED  AVAIL  REFER  MOUNTPOINT
rpool1/test         127K  6.34G    34K  /rpool1/test
rpool1/test/test2    31K  6.34G    31K  /rpool1/test/test2
rpool1/test/test3    31K  6.34G    31K  /rpool1/test/test3
rpool1/test/test4    31K  6.34G    31K  /rpool1/test/test4
turtle@solaris11vm:~#=20

All snapshots named @testsnap are deleted even though rpool1@testsnap =
doesn't exist. This is normal behavior.

Here's FreeBSD-CURRENT with v28

fbsd9vm# zfs list -t all -r
NAME                     USED  AVAIL  REFER  MOUNTPOINT
testpool                 475K  19.6G    21K  /testpool
testpool/test             22K  19.6G    22K  /testpool/test
testpool/test@testsnap      0      -    22K  -

fbsd9vm# zfs destroy -r testpool@testsnap
cannot destroy 'testpool@testsnap': dataset does not exist
no snapshots destroyed

fbsd9vm# zfs list -t all -r
NAME                     USED  AVAIL  REFER  MOUNTPOINT
testpool                 475K  19.6G    21K  /testpool
testpool/test             22K  19.6G    22K  /testpool/test
testpool/test@testsnap      0      -    22K  -

fbsd9vm# uname -a
FreeBSD fbsd9vm 9.0-CURRENT FreeBSD 9.0-CURRENT #2 r208649M: Mon Mar 21 =
22:28:02 EDT 2011     root@:/usr/obj/usr/src/sys/GENERIC  amd64

I noticed this because zfSnap is unable to destroy old snapshots (except =
for ones that are done to the entire pool where pool@snapshot exists)

Cheers,
Dillon=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?813ECD73-4FAA-4FA4-BAE7-016ACCBA5626>