I was wondering if there is a solution for this. I''ve been able to replicate a similar problem on a different server. Basically I''m still unable to use zfs destroy on a filesystem, that was a parent filesystem and is now a child filesystem after a promotion. bash-3.00# zpool history History for ''testpool'': 2009-04-14.11:30:00 zpool create testpool mirror c14t60060160910B1600E492DCF1071EDE11d0 c14t60060160910B1600585DC330081EDE11d0 2009-04-14.11:30:58 zfs create testpool/testfs 2009-04-14.11:31:16 zfs create testpool/testfs2 2009-04-14.11:31:47 zfs set mountpoint=/devel/testfs testpool/testfs 2009-04-14.11:32:10 zfs create testpool/testfs/dir1 2009-04-14.11:32:12 zfs create testpool/testfs/dir2 2009-04-14.11:32:13 zfs create testpool/testfs/dir3 2009-04-14.12:25:37 zfs snapshot testpool/testfs2 at snap1 2009-04-14.12:29:10 zfs rollback testpool/testfs2 at snap1 2009-04-14.12:30:10 zfs destroy testpool/testfs2 at snap1 2009-04-16.12:42:03 zfs snapshot testpool/testfs2 at snap1 2009-04-16.12:45:30 zfs clone testpool/testfs2 at snap1 testpool/testfs2/clone1 2009-04-16.12:46:57 zfs promote testpool/testfs2/clone1 bash-3.00# zfs list NAME USED AVAIL REFER MOUNTPOINT testpool 1.03M 9.78G 20K /testpool testpool/testfs 76K 9.78G 22K /devel/testfs testpool/testfs/dir1 18K 9.78G 18K /devel/testfs/dir1 testpool/testfs/dir2 18K 9.78G 18K /devel/testfs/dir2 testpool/testfs/dir3 18K 9.78G 18K /devel/testfs/dir3 testpool/testfs2 790K 9.78G 758K /testpool/testfs2 testpool/testfs2/clone1 772K 9.78G 756K /testpool/testfs2/clone1 testpool/testfs2/clone1 at snap1 16K - 756K - bash-3.00# zfs destroy testpool/testfs2 cannot destroy ''testpool/testfs2'': filesystem has children use ''-r'' to destroy the following datasets: testpool/testfs2/clone1 at snap1 testpool/testfs2/clone1 bash-3.00# zfs destroy -r testpool/testfs2 at snap1 cannot destroy ''testpool/testfs2/clone1 at snap1'': snapshot is cloned no snapshots destroyed bash-3.00# zfs destroy -r testpool/testfs2/clone1 cannot destroy ''testpool/testfs2/clone1'': filesystem has dependent clones use ''-R'' to destroy the following datasets: testpool/testfs2 bash-3.00# zfs destroy -R testpool/testfs2/clone1 cannot determine dependent datasets: recursive dependency at ''testpool/testfs2/clone1'' bash-3.00# ----- Original Message ---- From: Grant Lowe <glowe at sbcglobal.net> To: zfs-discuss at opensolaris.org Sent: Wednesday, December 17, 2008 2:48:06 PM Subject: Destroying a zfs dataset I''m having a very difficult time destroying a zone. Here''s the skinny: bash-3.00# zfs get origin | grep d01 r12_data/d01 origin r12_data/d01/.clone.12052008 at 12042008 - r12_data/d01-receive origin - - r12_data/d01-receive at A origin - - r12_data/d01/.clone.12052008 origin - - r12_data/d01/.clone.12052008 at 12042008 origin - - bash-3.00# bash-3.00# zfs destroy r12_data/d01/.clone.12052008 at 12042008 cannot destroy ''r12_data/d01/.clone.12052008 at 12042008'': snapshot has dependent clones use ''-R'' to destroy the following datasets: r12_data/d01/.clone.12052008 r12_data/d01 bash-3.00# zfs destroy -R r12_data/d01/.clone.12052008 at 12042008 cannot determine dependent datasets: recursive dependency at ''r12_data/d01/.clone.12052008 at 12042008'' bash-3.00# zfs destroy -r r12_data/d01/.clone.12052008 at 12042008 cannot destroy ''r12_data/d01/.clone.12052008 at 12042008'': snapshot is cloned no snapshots destroyed bash-3.00# I must be missing a piece of the puzzle. What is that piece?
The dependency is based on the names. Try renaming testpool/testfs2/clone1 out of the hierarchy: zfs rename testpool/testfs2/clone1 testpool/foo Then it should be possible to destroy testpool/testfs2. On Fri, 17 Apr 2009, Grant Lowe wrote:> > I was wondering if there is a solution for this. I''ve been able to replicate a similar problem on a different server. Basically I''m still unable to use zfs destroy on a filesystem, that was a parent filesystem and is now a child filesystem after a promotion. > > bash-3.00# zpool history > History for ''testpool'': > 2009-04-14.11:30:00 zpool create testpool mirror c14t60060160910B1600E492DCF1071EDE11d0 c14t60060160910B1600585DC330081EDE11d0 > 2009-04-14.11:30:58 zfs create testpool/testfs > 2009-04-14.11:31:16 zfs create testpool/testfs2 > 2009-04-14.11:31:47 zfs set mountpoint=/devel/testfs testpool/testfs > 2009-04-14.11:32:10 zfs create testpool/testfs/dir1 > 2009-04-14.11:32:12 zfs create testpool/testfs/dir2 > 2009-04-14.11:32:13 zfs create testpool/testfs/dir3 > 2009-04-14.12:25:37 zfs snapshot testpool/testfs2 at snap1 > 2009-04-14.12:29:10 zfs rollback testpool/testfs2 at snap1 > 2009-04-14.12:30:10 zfs destroy testpool/testfs2 at snap1 > 2009-04-16.12:42:03 zfs snapshot testpool/testfs2 at snap1 > 2009-04-16.12:45:30 zfs clone testpool/testfs2 at snap1 testpool/testfs2/clone1 > 2009-04-16.12:46:57 zfs promote testpool/testfs2/clone1 > > bash-3.00# zfs list > NAME USED AVAIL REFER MOUNTPOINT > testpool 1.03M 9.78G 20K /testpool > testpool/testfs 76K 9.78G 22K /devel/testfs > testpool/testfs/dir1 18K 9.78G 18K /devel/testfs/dir1 > testpool/testfs/dir2 18K 9.78G 18K /devel/testfs/dir2 > testpool/testfs/dir3 18K 9.78G 18K /devel/testfs/dir3 > testpool/testfs2 790K 9.78G 758K /testpool/testfs2 > testpool/testfs2/clone1 772K 9.78G 756K /testpool/testfs2/clone1 > testpool/testfs2/clone1 at snap1 16K - 756K - > bash-3.00# zfs destroy testpool/testfs2 > cannot destroy ''testpool/testfs2'': filesystem has children > use ''-r'' to destroy the following datasets: > testpool/testfs2/clone1 at snap1 > testpool/testfs2/clone1 > bash-3.00# zfs destroy -r testpool/testfs2 at snap1 > cannot destroy ''testpool/testfs2/clone1 at snap1'': snapshot is cloned > no snapshots destroyed > bash-3.00# zfs destroy -r testpool/testfs2/clone1 > cannot destroy ''testpool/testfs2/clone1'': filesystem has dependent clones > use ''-R'' to destroy the following datasets: > testpool/testfs2 > bash-3.00# zfs destroy -R testpool/testfs2/clone1 > cannot determine dependent datasets: recursive dependency at ''testpool/testfs2/clone1'' > bash-3.00# > > > ----- Original Message ---- > From: Grant Lowe <glowe at sbcglobal.net> > To: zfs-discuss at opensolaris.org > Sent: Wednesday, December 17, 2008 2:48:06 PM > Subject: Destroying a zfs dataset > > I''m having a very difficult time destroying a zone. Here''s the skinny: > > bash-3.00# zfs get origin | grep d01 > r12_data/d01 origin r12_data/d01/.clone.12052008 at 12042008 - > r12_data/d01-receive origin - - > r12_data/d01-receive at A origin - - > r12_data/d01/.clone.12052008 origin - - > r12_data/d01/.clone.12052008 at 12042008 origin - - > bash-3.00# bash-3.00# zfs destroy r12_data/d01/.clone.12052008 at 12042008 > cannot destroy ''r12_data/d01/.clone.12052008 at 12042008'': snapshot has dependent clones > use ''-R'' to destroy the following datasets: > r12_data/d01/.clone.12052008 > r12_data/d01 > bash-3.00# zfs destroy -R r12_data/d01/.clone.12052008 at 12042008 > cannot determine dependent datasets: recursive dependency at ''r12_data/d01/.clone.12052008 at 12042008'' > bash-3.00# zfs destroy -r r12_data/d01/.clone.12052008 at 12042008 > cannot destroy ''r12_data/d01/.clone.12052008 at 12042008'': snapshot is cloned > no snapshots destroyed > bash-3.00# > > I must be missing a piece of the puzzle. What is that piece? > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >Regards, markm
On Fri, 17 Apr 2009, Mark J Musante wrote:> > The dependency is based on the names.I should clarify what I mean by that. There are actually two dependencies here: one is based on dataset names, and one is based on snapshots and clones. If there are two datasets, pool/foo and pool/foo/bar, then you cannot destroy pool/foo without also destroying pool/foo/bar. But, if pool/foo/bar is ALSO an ancestor (e.g. clone-of-a-snapshot) of pool/foo, then you cannot destroy pool/foo/bar without destroying pool/foo. That''s the situation that happens in the following sequence: zfs create testpool/testfs2 zfs snapshot testpool/testfs2 at snap1 zfs clone testpool/testfs2 at snap1 testpool/testfs2/clone1 zfs promote testpool/testfs2/clone1 The ''clone'' command creates a double-relationship: it created child dataset of testpool/testfs2 at the same time it created a child dataset of testpool/testfs2 at snap1. And the snapshot is also a child dataset of testpool/testfs2. Thus far, everything is OK. You can still destroy testpool/testfs2/clone1, because both the relationships to testpool/testfs2 is just in one direction: the latter is the parent of the former. But, when the ''promote'' command is used, it inverts *one* of those relationships without inverting the other. In other words, testpool/testfs2 was now a child dataset of the snapshot testpool/testfs2 at snap1 (and therefore a descendant of testpool/testfs2/clone1), *but* it was also the parent of testpool/testfs2/clone1 by virtue of its name. So in the "namespace", testpool/testfs2 is still the parent of testpool/testfs2/clone1. But in the "clonespace", testpool/testfs2 has now become the CHILD of testpool/testfs2/clone1 through the testpool/testfs2 at snap1 snapshot. Then when you try to destroy them both with -R, you end up with the "recursive dependency" error message, otherwise known as CR 6622809. See http://bugs.opensolaris.org/view_bug.do?bug_id=6622809 Regards, markm