Header RSS Feed
 
If you only want to see the articles of a certain category, please click on the desired category below:
ALL Android Backup BSD Database Hacks Hardware Internet Linux Mail MySQL Monitoring Network Personal PHP Proxy Shell Solaris Unix Virtualization VMware Windows Wyse

ZFS: Cannot delete snapshot (snapshot is cloned)? Destroy clone first!
Tuesday - Mar 4th 2014 - by - (0 comments)

On a ZFS backup server, a snapshot couldn't be deleted (destroyed) anymore:

zfs destroy -rR "lowiopool/backups/myserver99@daily-2014-02-01-00:00"
cannot destroy 'lowiopool/backups/myserver99@daily-2014-02-01-00:00': snapshot is cloned
no snapshots destroyed

As the output said, the snapshot was not destroyed and it was still listed in the zfs list output:

zfs list -t snapshot | grep myserver99 | tail
lowiopool/backups/myserver99@daily-2014-01-26-00:00   856M -  1.50T  -
lowiopool/backups/myserver99@daily-2014-01-27-00:00   781M -  1.30T  -
lowiopool/backups/myserver99@daily-2014-01-28-00:00   774M -  1.30T  -
lowiopool/backups/myserver99@daily-2014-01-29-00:00   614M -  1.30T  -
lowiopool/backups/myserver99@daily-2014-02-01-00:00   191M -  1.30T  -

The information "snapshot is cloned" points out that the selected snapshot was previousyl cloned and that the clone is still available.
A snapshot cannot be deleted until all of its clones were destroyed (or promoted to a real file system, but that's another topic).
(Source: http://forums.freenas.org/index.php?threads/replication-problem-delete-a-cloned-snapshot.6625/)

To find the clones, the zfs database (zdb) needs to be consulted:

zdb -d lowiopool |grep "%"
Dataset lowiopool/backups/backups/server23/%daily-2012-12-26-00:00 [ZPL], ID 201724, cr_txg 12724738, 246G, 55 objects
Dataset lowiopool/backups/myserver99/%daily-2014-02-02-00:00 [ZPL], ID 11759, cr_txg 14376982, 1.38T, 3934622 objects

The second entry is our famous clone of the snapshot we tried to delete.

The clone can be deleted like another zfs filesystem or snapshot, using destroy:

zfs destroy lowiopool/backups/myserver99/%daily-2014-02-02-00:00
cannot open 'lowiopool/backups/myserver99/%daily-2014-02-02-00:00': dataset does not exist

Although a warning is shown "dataset does not exist", the clone was deleted:

zdb -d lowiopool |grep "%"
Dataset lowiopool/backups/backups/server23/%daily-2012-12-26-00:00 [ZPL], ID 201724, cr_txg 12724738, 246G, 55 objects

Now the snapshot we have tried to destroy at the begin, can be deleted:

zfs destroy -rR lowiopool/backups/myserver99@daily-2014-02-01-00:00

Verification:

zfs list -t snapshot | grep myserver99 | tail
lowiopool/backups/myserver99@daily-2014-01-25-00:00   473M -  1.30T  -
lowiopool/backups/myserver99@daily-2014-01-26-00:00   856M -  1.50T  -
lowiopool/backups/myserver99@daily-2014-01-27-00:00   781M -  1.30T  -
lowiopool/backups/myserver99@daily-2014-01-28-00:00   774M -  1.30T  -
lowiopool/backups/myserver99@daily-2014-01-29-00:00   628M -  1.30T  -

Yayy!

 

Add a comment

Show form to leave a comment

Comments (newest first):

No comments yet.

Go to Homepage home
Linux Howtos how to's
Nagios Plugins nagios plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

7667 Days
until Death of Computers
Why?