Archive for the ‘ZFS’ Category

cannot destroy ‘ldmpool/ldg1/disk0@version1’: snapshot has dependent clones

June 1, 2011 Leave a comment

This is caused by cloning on the snapshot. When trying to destroy the snapshot,  we get the message “cannot destroy ‘ldmpool/ldg1/disk0@version1’: snapshot has dependent clones” prompt. The following I show what happened on a snapshot backup

# zfs list
NAME                          USED  AVAIL  REFER  MOUNTPOINT
ldmpool                      83.8G   160G    32K  /ldmpool
ldmpool/ldg                  38.8G   160G    21K  /ldmpool/ldg
ldmpool/ldg/disk0            38.8G   193G  5.50G  –
ldmpool/ldg/disk0@version1    280M      –  4.87G  –
ldmpool/ldg/disk0@version2   31.7M      –  5.49G  –
ldmpool/ldg1                 35.5G   160G    21K  /ldmpool/ldg1
ldmpool/ldg1/disk0           35.5G   191G  4.60G  –
ldmpool/ldg1/disk0@version1   551K      –  4.60G  – <- snapshot of ldmpool/ldg1/disk0
ldmpool/ldg2                 16.2M   160G    21K  /ldmpool/ldg2
ldmpool/ldg2/disk0           16.2M   160G  4.60G  – <- this image cloned from ldmpool/ldg1/disk0@version1
# zfs destroy ldmpool/ldg1/disk0@version1 <- destroy the snapshot
cannot destroy ‘ldmpool/ldg1/disk0@version1’: snapshot has dependent clones
use ‘-R’ to destroy the following datasets:
# zfs destroy -R ldmpool/ldg1/disk0@version1 <- destroy with -R option. After that the snapshot and dependent clone ldmpool/ldg2/disk0 are removed

# zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
ldmpool                     79.2G   165G    32K  /ldmpool
ldmpool/ldg                 38.8G   165G    21K  /ldmpool/ldg
ldmpool/ldg/disk0           38.8G   198G  5.50G  –
ldmpool/ldg/disk0@version1   280M      –  4.87G  –
ldmpool/ldg/disk0@version2  31.7M      –  5.49G  –
ldmpool/ldg1                30.9G   165G    21K  /ldmpool/ldg1
ldmpool/ldg1/disk0          30.9G   191G  4.60G  –
ldmpool/ldg2                  21K   165G    21K  /ldmpool/ldg2
ldmpool/yckcasz01           1.55G   165G    21K  /ldmpool/yckcasz01

In conclusion, removing a snapshot with dependent clones, we have to take care since the “destroy -R” will automatically remove all dependents clones as well

Categories: LDom, ZFS