Files from child datasets appearing in parent snapshot

Harsturomai

Cadet
Joined
Nov 7, 2022
Messages
2
Okay, I'm absolutely stumped. I think I understand correctly that ZFS datasets are their own filesystems and snapshots record changes in chunks of a dataset from the previous snapshot.

I have the following two datasets of interest, storage and storage/enc/docker/mongodb. When I snapshot (no previous snapshots) storage and run ls /storage/.zfs/snapshot/2023-12-30_18-08-22/enc/docker I can see mongodb but I cannot see the other child datasets that are mounted at /storage/enc/docker/X. Why?

In the case that the snapshot tracked files in child datasets (which shouldn't be the case) then why are some of them tracked but not others? The other thing I was thinking was that maybe the folder /storage/enc/docker/mongodb actually exists in the storage filesystem, but the storage/enc/docker/mongodb dataset is mounted at /storage/enc/docker/mongodb so this wouldn't make sense either. Frankly, I was expecting to not see ANY entities in the storage snapshot since there are no files in the dataset/filesystem - its the root dataset and all files are contained in child datasets.

Here are the mountpoints (note that factorio cannot be found in the storage snapshot but mongodb can):

Code:
>zfs list -o name,mountpoint
storage                             /storage
storage/enc                         /storage/enc
storage/enc/docker                  /storage/enc/docker
storage/enc/docker/factorio         /storage/enc/docker/factorio
storage/enc/docker/mongodb          /storage/enc/docker/mongodb
 
Joined
Oct 22, 2019
Messages
3,641
Sounds like you have (unintended) "ghost" folders, which share the same name as the child datasets.

Does the space usage of your root dataset (which shouldn't be used to store anything directly) reflect this?
Code:
zfs list -t filesystem -o space storage


You can also unmount the child datasets, but be aware that this can cause an issue with TrueNAS (since they might be used for shares, services, jails, etc), to check directly inside "storage" without the need to navigate its "hidden snapshots".

(TrueNAS does not expect any datasets to be unmounted, with the only exception being "locked" datasets.)
 
Top