Hi,
I created a dataset from a snapshot in the same pool as the snapshot is from.
Mainpool/… ← one snapshot of all datasets
Now I can’t delete the “snapshot”-dataset
root@truenas[~]# zfs list | grep Mainpool
Mainpool 3.35T 8.95T 160K /mnt/Mainpool
Mainpool/.system 1.94G 8.95T 1.47G legacy
Mainpool/.system/configs-ae32c386e13840b2bf9c0083275e7941 25.5M 8.95T 25.5M legacy
Mainpool/.system/cores 128K 1024M 128K legacy
Mainpool/.system/netdata-ae32c386e13840b2bf9c0083275e7941 460M 8.95T 460M legacy
Mainpool/.system/nfs 149K 8.95T 149K legacy
Mainpool/.system/samba4 368K 8.95T 368K legacy
Mainpool/Bilder 378G 646G 378G /mnt/Mainpool/Bilder
Mainpool/Data 2.86T 8.95T 2.86T /mnt/Mainpool/Data
Mainpool/Musik 114G 86.2G 114G /mnt/Mainpool/Musik
Mainpool/ix-applications 1.10G 255G 186K /mnt/Mainpool/ix-applications
Mainpool/ix-applications/catalogs 77.0M 255G 77.0M /mnt/Mainpool/ix-applications/catalogs
Mainpool/ix-applications/default_volumes 128K 255G 128K /mnt/Mainpool/ix-applications/default_volumes
Mainpool/ix-applications/k3s 1.03G 255G 1.02G /mnt/Mainpool/ix-applications/k3s
Mainpool/ix-applications/k3s/kubelet 485K 255G 485K legacy
Mainpool/ix-applications/releases 128K 255G 128K /mnt/Mainpool/ix-applications/releases
Mainpool/ix-apps 183M 8.95T 149K /mnt/.ix-apps
Mainpool/ix-apps/app_configs 128K 8.95T 128K /mnt/.ix-apps/app_configs
Mainpool/ix-apps/app_mounts 128K 8.95T 128K /mnt/.ix-apps/app_mounts
Mainpool/ix-apps/docker 1.04M 8.95T 1.04M /mnt/.ix-apps/docker
Mainpool/ix-apps/truenas_catalog 182M 8.95T 182M /mnt/.ix-apps/truenas_catalog
Mainpool/manual-2025-04-10_17-58-clone 149K 8.95T 149K /mnt/Mainpool/manual-2025-04-10_17-58-clone
root@truenas[~]# zfs destroy Mainpool/manual-2025-04-10_17-58-clone
cannot destroy 'Mainpool/manual-2025-04-10_17-58-clone': filesystem has children
use '-r' to destroy the following datasets:
Mainpool/manual-2025-04-10_17-58-clone@manual-2025-04-10_17-58
root@truenas[~]# zfs destroy -r Mainpool/manual-2025-04-10_17-58-clone@manual-2025-04-10_17-58
cannot destroy 'Mainpool/manual-2025-04-10_17-58-clone@manual-2025-04-10_17-58': snapshot has dependent clones
use '-R' to destroy the following datasets:
Mainpool/manual-2025-04-10_17-58-clone@manual-2025-04-10_17-58
Mainpool/manual-2025-04-10_17-58-clone
Mainpool/Musik
Mainpool/Bilder
Mainpool/Data
Mainpool/.system/netdata-ae32c386e13840b2bf9c0083275e7941
Mainpool/.system/samba4
Mainpool/.system/cores
Mainpool/.system/nfs
Mainpool/.system/configs-ae32c386e13840b2bf9c0083275e7941
Mainpool/.system
Mainpool/ix-apps/app_mounts
Mainpool/ix-apps/app_configs
Mainpool/ix-apps/docker
Mainpool/ix-apps/truenas_catalog
Mainpool/ix-apps
Mainpool/ix-applications/releases
Mainpool/ix-applications/catalogs
Mainpool/ix-applications/k3s/kubelet
Mainpool/ix-applications/k3s
Mainpool/ix-applications/default_volumes
Mainpool/ix-applications
Mainpool
root@truenas[~]#
How can I delete the dataset?
What were you trying to accomplish in the first place?
Did you intentionally want to make a clone (“dataset birthed from a snapshot”)?
Then you made a snapshot for the cloned dataset, which is why -r
is needed to destroy the clone (dataset).
Before you do anything destructive, please make a checkpoint for your pool:
zpool checkpoint Mainpool
zpool get checkpoint Mainpool
zpool status Mainpool | grep checkpoint
Once you confirm there’s a checkpoint, do a “dry run” destruction (using the -n
flag) of the cloned dataset and its snapshot(s). Paste the output of what it would have destroyed:
zfs destroy -nvr Mainpool/manual-2025-04-10_17-58-clone
1 Like
root@truenas[~]# zpool checkpoint Mainpool
root@truenas[~]# zpool get checkpoint Mainpool
NAME PROPERTY VALUE SOURCE
Mainpool checkpoint 1.12M -
root@truenas[~]# zpool status Mainpool | grep Mainpool
pool: Mainpool
Mainpool ONLINE 0 0 0
root@truenas[~]# zfs destroy -nvr Mainpool/manual-2025-04-10_17-58-clone
cannot destroy 'Mainpool/manual-2025-04-10_17-58-clone': filesystem has dependent clones
use '-R' to destroy the following datasets:
Mainpool/Musik
Mainpool/Bilder
Mainpool/Data
Mainpool/.system/netdata-ae32c386e13840b2bf9c0083275e7941
Mainpool/.system/samba4
Mainpool/.system/cores
Mainpool/.system/nfs
Mainpool/.system/configs-ae32c386e13840b2bf9c0083275e7941
Mainpool/.system
Mainpool/ix-apps/app_mounts
Mainpool/ix-apps/app_configs
Mainpool/ix-apps/docker
Mainpool/ix-apps/truenas_catalog
Mainpool/ix-apps
Mainpool/ix-applications/releases
Mainpool/ix-applications/catalogs
Mainpool/ix-applications/k3s/kubelet
Mainpool/ix-applications/k3s
Mainpool/ix-applications/default_volumes
Mainpool/ix-applications
Mainpool
root@truenas[~]#
I’m not exactly sure what you did or tried to do. It’s like some crazy infinite loop of the pool’s root dataset somehow being dependent on a cloned dataset?
What does this show?
zpool history Mainpool | grep clone
root@truenas[~]# zpool history Mainpool | grep clone
2025-04-10.17:59:11 py-libzfs: zfs clone Mainpool@manual-2025-04-10_17-58
2025-04-10.17:59:19 py-libzfs: zfs promote Mainpool/manual-2025-04-10_17-58-clone
root@truenas[~]#
You didn’t need to do that…
You can navigate the contents of ZFS snapshots, as it is.
There’s no need to clone a snapshot into a new dataset or promote this cloned dataset.
1 Like
What does this show?
zfs get -t filesystem,volume -r origin Mainpool | grep "@"
root@truenas[~]# zfs get -t filesystem,volume -r origin Mainpool | grep "@"
Mainpool origin Mainpool/manual-2025-04-10_17-58-clone@manual-2025-04-10_17-58 -
root@truenas[~]#
You have a snake eating its own tail.
This should hopefully reverse what you did.
zfs promote Mainpool
Not sure if this will explode your server.
2 Likes
winnielinnie:
zfs promote Mainpool
root@truenas[~]# zfs promote Mainpool
root@truenas[~]# zfs get -t filesystem,volume -r origin Mainpool
NAME PROPERTY VALUE SOURCE
Mainpool origin - -
Mainpool/.system origin - -
Mainpool/.system/configs-ae32c386e13840b2bf9c0083275e7941 origin - -
Mainpool/.system/cores origin - -
Mainpool/.system/netdata-ae32c386e13840b2bf9c0083275e7941 origin - -
Mainpool/.system/nfs origin - -
Mainpool/.system/samba4 origin - -
Mainpool/Bilder origin - -
Mainpool/Data origin - -
Mainpool/Musik origin - -
Mainpool/ix-applications origin - -
Mainpool/ix-applications/catalogs origin - -
Mainpool/ix-applications/default_volumes origin - -
Mainpool/ix-applications/k3s origin - -
Mainpool/ix-applications/k3s/kubelet origin - -
Mainpool/ix-applications/releases origin - -
Mainpool/ix-apps origin - -
Mainpool/ix-apps/app_configs origin - -
Mainpool/ix-apps/app_mounts origin - -
Mainpool/ix-apps/docker origin - -
Mainpool/ix-apps/truenas_catalog origin - -
Mainpool/manual-2025-04-10_17-58-clone origin Mainpool@manual-2025-04-10_17-58 -
root@truenas[~]#
root@truenas[~]#
Looks good.
Now we can try this again:
zfs destroy -nvr Mainpool/manual-2025-04-10_17-58-clone
1 Like
Deletion of the dataset has worked now - Thanks!
1 Like
Please be careful going forward.
Next time ask about something before you experiment with commands outside of the GUI.
You would have learned that the contents of a ZFS snapshot are browsable, without the need to clone or promote anything.
If you feel safe at this point, you can discard the pool checkpoint.
zpool checkpoint -d Mainpool
zpool get checkpoint Mainpool
The second command should result with a -
under the “VALUE” column, as no checkpoint exists now.
I’m assuming you actually deleted the dataset (clone) without the “dry run”?
The checkpoint is removed.
And the destroyed the clone by using the command without the n parameter.
Be honest with me. Was it ChatGPT? Did you get the idea to do what you did from an AI chatbot?
It’s okay. I won’t judge you.
1 Like
I saw a youtube video explaining to show the content of an snapshot in TrueNAS by cloning and promoting. Both is possible using the web-ui.
Video
Starting from the 11:00 mark until 12:50, I think it’s a bit too much just to browse or recover files from a snapshot.
Without cloning, you can do the following:
In the command-line, navigate to /mnt/<pool>/<dataset>/.zfs/snapshot/
, which will present your read-only snapshots in the form of browsable “folders”.
Over a network share (SMB, NFS), you can visit \\<server.address>\<sharename>\.zfs\snapshot\
, to browse and copy files from read-only snapshots. This assumes you’re sharing a dataset’s root path, and not some subfolder within a dataset.
No need to clone, and definitely no need to promote anything.
The .zfs
folder is hidden, so you must manually type in this directory when using the command-line or a graphical file browser’s address bar.
1 Like
Youtube videos (without understanding the things they are telling you) about as bad as chatgpt.