Error trying to promote ZFS clone - what do I need to do to troubleshoot this?

Steps taken:-

  1. Snapshot an existing ZFS filesystem.
  2. Created clone from snapshot.
  3. Updated files on cloned ZFS filesystem.
  4. Snapshot of cloned ZFS filesystem.
  5. Attempted to promote clone ZFS and get error message. See below.
 #zfs list -rt all /rpool/ai 
 NAME                         USED  AVAIL  REFER  MOUNTPOINT 
 rpool/ai                    28.2G  26.3G  19.3G  /rpool/ai 
 rpool/ai@aisnap               54K      -  19.3G  - 
 rpool/ai/aiclone            8.98G  26.3G  27.2G  /rpool/ai/aiclone 
 rpool/ai/aiclone@clonesnap      0      -  27.2G  - 
 rpool/ai/aiclone%               -      -      -  /rpool/ai/aiclone 
# zfs promote rpool/ai/aiclone 
 cannot determine dependent datasets: recursive dependency at 'rpool/ai'

---------- Post updated at 09:06 AM ---------- Previous update was at 06:07 AM ----------

Ah doesnt work if you create a clone that is sub-directory of the existing one. i.e. rpool/ai/clone from rpool/ai. Only works if you use /rpool/aiclone.

Hi,

Yes, you get the same message sometimes when you are destroying clones - it seems to be something to do with the inherited names.

Regards

Gull04

Which is understandable.
You have created a clone of rpool/ai filesystem as a descendant filesystem of of rpool/ai filesystem.
While this is possible and working, you will not be able to promote that filesystem rpool/ai/my_new_ai_clone due to above condition.
But you will be able to use it as you see fit.

This will work, as you noticed :

somezpool/ai/filesystem1 # filesystem1 is mounted under /somezpool/ai/filesystem1 and contains data.
somezpool/ai/filesystem1@today # take snap
somezpool/ai/filesystem1_clone # create clone under somezpool/ai/filesystem1_clone

zfs promote of filesystem1_clone to filesystem1 will now work.

Do not confuse directories and filesystems in zfs.
zfs will create nested filesystems on top of each other and mount them like that due to mount point inheritance behavior.
/mypool -> zfs create mypool/dump/somefilesystem

Result :

A zfs filesystem mypool/dump/somefilesystem is created and mounted under /mypool/dump/somefilesystem , unless overridden with -o mountpoint=/some/other/mountpoint during zfs create command.

Of course, mountpoint can be changed anytime with zfs set , as long as nothing is accessing the mountpoint.

rollback/promotion/cloning of entire filesystem hierarchy (dataset) is not possible, only one filesystem at the time.
While snapshots, destroy and sending will work on entire dataset recursively if -r is ran against the parent dataset.

Hope that helps
Regards
Peasant.