Sharing of nested datasets (or merging to parent)

,

So I currently have the following structure:
/foo/bar/ds1
/foo/bar/ds2
/foo/bar/ds3

Each dsX is also an SMB share. I would like to now share /foo/bar over SMB and have dsX datasets as folders within the SMB share.

Just enabling the SMB share on /foo/bar gives me an empty shared folder. Is there a way to share nested datasets in this case? If not, I guess I’ll have to copy the data to the parent /foo/bar dataset, but that will probably give me a big reset (I’ve ran these dsX-es for over 7 years now). I would like to keep all the created and modified file properties, the history, etc. Snapshots, cloud sync tasks and replications are currently already done on /foo/bar/ level

I found this topic, but it is of no help: freebsd - Destroying zfs dataset, migrating data to parent dataset - Server Fault

Any suggestions, other than to make folders on the /foo/bar SMB share and copy over via file explorer (intentionally putting out the worst option to get suggestions that make a modicum of sense compared to this one)?

Which version of TrueNAS? What SMB options? What client?

On TrueNAS Core 13.3, if I share a parent dataset over SMB, then I can browse into child datasets as if they were folders in the same share.[1]


  1. As long as the user has sufficient permissions. ↩︎

TrueNAS: Scale Electric Eel 24.10.1
Client: Windows 10 PC, File Explorer
SMB options:
-ACL filesystem permissions copied from one of the dsX datasets to the /foo/bar parent and then propagated (recursive and include child datasets), so all correct permissions enabled.
-SMB share options enabled: Purpose is private SMB datasets and shares, ACL enabled, browsable to Network Clients, Enable Shadow Copies, Data Streams and SMB2/3 Durable Handles. The rest is turned off.

No additional comments?

This might be one for @awalkerix.

Did you try creating a new test SMB share with the default preset to see if it works at all?

Not really. Looks like a simple user misconfiguration. If user has configured “private datasets”, then on SMB connection a new dataset is created for the user and the SMB session is locked into that dataset. If your share path is /mnt/dozer/share/bob, then you of course won’t have access to /mnt/dozer/share. If this isn’t the desired behavior, don’t enable the feature :wink:

@Primoz wants to do the opposite.


If they share /mnt/dozer/share, then they also want to be able to access and navigate into the nested child datasets, as if those are subfolders.

Share this:
/mnt/dozer/share

Have access to and navigate into these:
/mnt/dozer/share/ds1
/mnt/dozer/share/ds2
/mnt/dozer/share/ds3

All from a single SMB share with the root directory /mnt/dozer/share.

He explicitly configured the SMB share to not do what you’re talking about.

True. :slightly_smiling_face:

So @Primoz:

Tried it, looks to be working. If I choose ‘Default share parameters’ it works. I had ‘Private SMB Datasets and Shares’ chosen before when I was testing things.

Anyone willing to elaborate on what the difference between the two options (or all of them in the dropdown) is?

We have documentation for this.

After multiple searches and links visited from both here and Reddit - this was the winner after I had to reset my TrueNAS config. You rule!