Odd snapshot dependancies

Status
Not open for further replies.

DigitalADHD

Dabbler
Joined
Jan 13, 2018
Messages
19
Hello,
I am trying to delete a jail snapshot, but for some reason it has dependent clones that are other jails.

user@freenas:/ # zfs destroy tank0/apps/sonarr_1@clean
cannot destroy 'tank0/apps/sonarr_1@clean': snapshot has dependent clones
use '-R' to destroy the following datasets:
tank0/apps/sabnzbd_1@auto-20180523.0622-1w
tank0/apps/sabnzbd_1
tank0/apps/couchpotato_1@auto-20180523.0618-1w
tank0/apps/couchpotato_1


I'm not hung up on deleting it, but i wonder how i got in this mess, If i can get out of it, even better.

Thanks!
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
It's because all of those originally depended on a single template. They're clones of that template dataset.

It's not really a mess and that "@clean" snapshot is probably taking up almost no space. It might even be used by FreeNAS somehow. I know you could roll back to it, rather than recreating, if your jail gets messed up.

If you really want to delete it though, you just need to promote the dependent clones that zfs is complaining about.
This should do it:
Code:
zfs promote tank0/apps/sabnzbd_1
zfs promote tank0/apps/couchpotato_1

You should then be able to destroy the snapshot.
 

DigitalADHD

Dabbler
Joined
Jan 13, 2018
Messages
19
Thanks, but i have promoted them, it seems over and over. It is like a moving target.

When I try through the CLI it seems to work, but then another jail becomes a dependency.


user@freenas:/ # zfs promote tank0/apps/sonarr_1
user@freenas:/ # zfs promote tank0/apps/couchpotato_1
user@freenas:/ # zfs promote tank0/apps/sabnzbd_1

user@freenas:/ # zfs list -t snapshot | grep clean
tank0/apps/sabnzbd_1@clean 45.7M - 539M -

user@freenas:/ # zfs destroy tank0/apps/sabnzbd_1@clean
cannot destroy 'tank0/apps/sabnzbd_1@clean': snapshot has dependent clones
use '-R' to destroy the following datasets:
tank0/apps/couchpotato_1
tank0/apps/sonarr_1

user@freenas:/ # zfs promote tank0/apps/couchpotato_1
user@freenas:/ # zfs promote tank0/apps/sonarr_1
user@freenas:/ # zfs destroy tank0/apps/sabnzbd_1@clean
could not find any snapshots to destroy; check snapshot names.
user@freenas:/ # zfs list -t snapshot | grep clean
tank0/apps/sonarr_1@clean 45.2M - 539M -

user@freenas:/ # zfs destroy tank0/apps/sonarr_1@clean
cannot destroy 'tank0/apps/sonarr_1@clean': snapshot has dependent clones
use '-R' to destroy the following datasets:
tank0/apps/sabnzbd_1
tank0/apps/couchpotato_1

user@freenas:/ # zfs promote tank0/apps/sabnzbd_1
user@freenas:/ # zfs promote tank0/apps/couchpotato_1
user@freenas:/ # zfs destroy tank0/apps/sonarr_1@clean
could not find any snapshots to destroy; check snapshot names.
user@freenas:/ # zfs list -t snapshot | grep clean
tank0/apps/couchpotato_1@clean 45.2M - 539M -

user@freenas:/ # zfs destroy tank0/apps/couchpotato_1@clean
cannot destroy 'tank0/apps/couchpotato_1@clean': snapshot has dependent clones
use '-R' to destroy the following datasets:
tank0/apps/sabnzbd_1
tank0/apps/sonarr_1
user@freenas:/ # zfs promote tank0/apps/sabnzbd_1
user@freenas:/ # zfs promote tank0/apps/sonarr_1
user@freenas:/ # zfs list -t snapshot | grep clean
tank0/apps/sonarr_1@clean 45.2M - 539M -

user@freenas:/ # zfs destroy tank0/apps/sonarr_1@clean
cannot destroy 'tank0/apps/sonarr_1@clean': snapshot has dependent clones
use '-R' to destroy the following datasets:
tank0/apps/sabnzbd_1
tank0/apps/couchpotato_1
user@freenas:/ #
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
hah, that looks like a fun time indeed.
It's been a while since I've deleted jail snapshots, and I'm not sure what FreeNAS is using the clean snapshots for. I seem to remember being able to promote and destroy in a relatively straightforward process.
Maybe try only promoting one of the dependencies? Though it looks like the snapshot is moving to whatever the most recent promotion is.
I'll try to remember to look at my system later and see if I have these still or what I've done to clear them out.
 

DigitalADHD

Dabbler
Joined
Jan 13, 2018
Messages
19
It's all good, Thanks for the tips
 
Status
Not open for further replies.
Top