Cannot destroy ZFS snapshot: dataset already exists

Solution 1:

This issue has now been answered, courtesy of Cindy Swearingen (cindys) here: http://opensolaris.org/jive/thread.jspa?messageID=484242&tstart=0

Summary: If you do incremental receives, this might be CR 6860996:

A temporary clone is created for an incremental receive and in some cases, is not removed automatically.

1. Determine clone names:

# zdb -d <poolname> | grep %

2. Destroy identified clones:

# zfs destroy <clone-with-%-in-the-name>

It will complain that 'dataset does not exist', but you can check
again(see 1)

3. Destroy snapshot(s) that could not be destroyed previously

Solution 2:

After having upgraded to more recent patch sets, I could delete this snapshot successfully. Clearly was a bug somewhere that Sun squashed.


Solution 3:

Whilst this solution is probably unrelated to the OP's issue, I also had this same cryptic error message when trying to delete a zvol.

In my case, the zvol had been created by an interrupted zfs receive, which was sent using the "-s" resumable feature. The resume token was preventing it from being destroyed.

To fix it, I ran zfs receive -A <pool/zvol> (on FreeBSD 10.3)


Solution 4:

I don't expect this is the issue (I think you get a different error message), but do you have any clones based on that snapshot?

Tags:

Solaris

Zfs