zfs destroy: cannot destroy 'foo': dataset already exists

Stefan Bethke stb at lassitu.de
Fri Oct 29 14:24:16 UTC 2010


I just came across an issue which appears to (have been) be triggered by a bug:

When trying to incrementally push snapshots with zfs send/recv, I encountered a snapshot on the target fs which zfs recv complained about.  I was unable to remove the snapshot with zfs destroy.  Also, trying to recursively destroying the whole fs failed:

zfs send | zfs recv error:
cannot restore to tank/jail/gilb.zs64.net at 201010130334: destination already exists

# zfs destroy tank/jail/gilb.zs64.net at 201010130034
cannot destroy 'tank/jail/gilb.zs64.net at 201010130034': dataset already exists
# zfs destroy -r tank/jail/gilb.zs64.net
cannot destroy 'tank/jail/gilb.zs64.net at 201010130034': dataset already exists

I came across this post, which helped me recover:
http://www.openg.info/entry/destroy-zfs-snapshot-dataset-exists

# zdb -d tank | grep %
Dataset tank/jail/gilb.zs64.net/%201010130334 [ZPL], ID 5218, cr_txg 3560162, 8.60G, 323647 objects
# zfs destroy tank/jail/gilb.zs64.net/%201010130334
cannot open 'tank/jail/gilb.zs64.net/%201010130334': dataset does not exist
# zfs destroy -r tank/jail/gilb.zs64.net
#

The post references a Solaris bug CR 6860996.  I could not immediately determine whether this has been ported yet.

This is on 8-stable from sept. 21.

# zpool status
  pool: tank
 state: ONLINE
status: The pool is formatted using an older on-disk format.  The pool can
	still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
	pool will no longer be accessible on older software versions.
 scrub: none requested
config:

	NAME        STATE     READ WRITE CKSUM
	tank        ONLINE       0     0     0
	  ad4s1d    ONLINE       0     0     0

errors: No known data errors


Stefan

-- 
Stefan Bethke <stb at lassitu.de>   Fon +49 151 14070811



More information about the freebsd-fs mailing list