SOLVED Share multiple datasets as single folder?

Joined
Jan 1, 2023
Messages
16
Tried looking for some more information on if this is possible, but I couldn't quite figure it out.

I'm setting up a new TrueNAS Scale home server, and planning to make two datasets on the main data pool - one for large files and one for small files (so I can set different recordsizes for the two - this is optional, so if it isn't possible to do what I'm trying I'll just use 128k for everything).

The main user of the server is a Windows desktop, so I'm planning on making a SMB share with the two datasets.

Say I have the following structure on the server:

Code:
drivepool (main data pool)
 ---> large (large files dataset)
     ---> DigitalFoundry
     ---> Music
     ---> Pictures
 ---> small (small files dataset)
     ---> Applications
     ---> Backups
     ---> Random


Question: Is it possible to present the subfolders as part of the same main folder to the SMB share, so that when I access the network share from Windows, I see:

Code:
drivepool
 ---> Applications
 ---> Backups
 ---> DigitalFoundry
 ---> Music
 ---> Pictures
 ---> Random


Just asking because that's how my current setup is - a "pool" created with StableBit's Drivepool software with that folder structure. And this is what I want to move over to TrueNAS.
 

oblivioncth

Explorer
Joined
Jul 13, 2022
Messages
71
I don't think you can do this with pure TrueNAS alone, as I don't believe such functionality is built into ZFS so something like mergefs (Drivepool seems similar to this from the little bit I glanced at it) would need to be used on top of it. Since officially you're not supposed to modify TrueNAS directly (and you shouldn't since it can break stuff and be pretty jank anyway), you're basically out of luck unless something that uses mergefs is available as a chart. Or you could really go out of your way and create a VM, setup the mergefs filesystems there and share everything via SMB from that VM and ignore TrueNAS' share functionality, but obviously this is also pretty cruddy.

I'd be curious to see if someone else knows a better way though.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
I believe it's possible to place everything in the same dataset, then change the recordsize of each child dataset individually and share the parent dataset with SMB.

Code:
YOUR POOL
    PARENT DATASET
        CHILD1 1M
        CHILD2 1M
        CHILD3 128k

Edit: Remember that any recordsize change influences new writes only.
 
Last edited:
Joined
Jan 1, 2023
Messages
16
I believe it's possible to place everything in the same dataset, then change the recordsize of each child dataset individually and share the parent dataset with SMB.

Code:
YOUR POOL
    PARENT DATASET
        CHILD1 1M
        CHILD2 1M
        CHILD3 128k

Edit: Remember that any recordsize changes influence new writes only.
This is great, thanks!

And yeah I haven't written anything to the pool yet so all data will be new writes.

Related question: will having multiple child datasets cause issues with Plex? I'd also want to share the "large" dataset over the network to various devices with Plex, so will the process be the same but I would just add all three "large" child datasets to the Plex app in TrueNAS?
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Related question: will having multiple child datasets cause issues with Plex? I'd also want to share the "large" dataset over the network to various devices with Plex, so will the process be the same but I would just add all three "large" child datasets to the Plex app in TrueNAS?
I am not familiar with Plex but I suppose that with a single, big share you will have to sweat a bit on the ACL or make compromises.
Also you generally don't want your applications in the same HDD pool you use for storage: a different one with 2 SSDs in mirror is usually preferred.
 
Last edited:
Joined
Jan 1, 2023
Messages
16
I am not familiar with Plex but I suppose that with a single, big share you will have to sweat a bit on the ACL.
Also you generally don't want your applications in the same HDD pool you use for storag: a different one with 2 SSDs in mirror is usually preferred.
Yeah in addition to the "drivepool" I also have a "fastpool" with 2x 256GB SSDs in a mirror where I'll install Plex etc.

And yeah, not looking forward to the permissions issues I'm inevitably going to run into ;_;
 

oblivioncth

Explorer
Joined
Jul 13, 2022
Messages
71
I believe it's possible to place everything in the same dataset, then change the recordsize of each child dataset individually and share the parent dataset with SMB.

Code:
YOUR POOL
    PARENT DATASET
        CHILD1 1M
        CHILD2 1M
        CHILD3 128k

Edit: Remember that any recordsize changes influence new writes only.
So I would have mentioned this but the issue is that it wouldn't result in quite what they want.

Doing it this way would result in a share where when viewed on another PC would still have the child datasets appear as folders that have to be traversed to get to the folders they wanted all together (i.e. Applications, Backup, etc.).

It wouldn't be a flat layout as originally shown. The share would look more like the code block in the OPs first post, basically the same as the dataset structure.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Doing it this way would result in a share where when viewed on another PC would still have the child datasets appear as folders that have to be traversed to get to the folders they wanted all together (i.e. Applications, Backup, etc.).
Well, I read the following structure as exactly that though? A shared folder (in this case drivepool) that has different folders (the different datasets).

drivepool
---> Applications
---> Backups
---> DigitalFoundry
---> Music
---> Pictures
---> Random

Have I misunderstood something?
 
Last edited:

oblivioncth

Explorer
Joined
Jul 13, 2022
Messages
71
Well, I read the following structure as exactly that though? A shared folder (in this case drivepool) that has different folders (the different datasets).



Did I misunderstood something?
OK I see, I glanced over your example too quickly.

As long as they make those "sub-folders" datasets and apply the block size properties to those datasets directly then it should work fine.

I was thinking of the CHILD entrées in your example as folders within the outer share instead of actual child datasets (durp).

I was trying to fly through catching up on the thread because I'm at the optometrist having my eyes dilated and it's getting really hard to read :)
 
Joined
Jan 1, 2023
Messages
16
So I would have mentioned this but the issue is that it wouldn't result in quite what they want.

Doing it this way would result in a share where when viewed on another PC would still have the child datasets appear as folders that have to be traversed to get to the folders they wanted all together (i.e. Applications, Backup, etc.).

It wouldn't be a flat layout as originally shown. The share would look more like the code block in the OPs first post, basically the same as the dataset structure.
Well, I read the following structure as exactly that though? A shared folder (in this case drivepool) that has different folders (the different datasets).



Did I misunderstood something?
Thanks for the clarifications.

So, I should just create the child datasets named "Applications", "Backups" etc. and put files and folders directly inside the root folder of each dataset?

e.g. (what I would prefer):
Code:
drivepool (parent dataset)
 ---> Backups (child dataset)
   ---> iTunesBackup (folder at the root of child dataset)
 


So iTunesBackup would be the folder inside the Backups child dataset.

Unlike (what I wouldn't prefer):

Code:
drivepool (parent dataset)
 ---> Backups (child dataset)
   ---> Backups (folder at the root of child dataset)
      ---> iTunesBackup (subfolder in child dataset)
 
 
Last edited:

oblivioncth

Explorer
Joined
Jul 13, 2022
Messages
71
It's almost impossible to read at this point but I think you have it correct.

You put the files directly within those child datasets as you said as if they were the folders.

This won't require any extra thought though as the child datasets will appear as folders when shared over SMB anyway.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
Code:
YOUR POOL
    PARENT DATASET
        Apps
        Backups
        Movies
Screenshot_1.png
If you add other datasets, you also add other folders but if you add folders, you don't add datasets.

I suggest to take a look at the following thread:
 
Last edited:
Joined
Jan 1, 2023
Messages
16
It's almost impossible to read at this point but I think you have it correct.

You put the files directly within those child datasets as you said as if they were the folders.

This won't require any extra thought though as the child datasets will appear as folders when shared over SMB anyway.
If you add other datasets, you also add other folders but if you add folders, you don't add datasets.

I suggest to take a look at the following thread:

Just fyi, this worked! From Windows or Mac over the network, I see:

Code:
drivepool
 ---> Applications
 ---> Backups
 ---> DigitalFoundry
 ---> Music
 ---> Pictures
 ---> Random

where drivepool is the parent dataset, and each folder is a child dataset with appropriate recordsize. And I only had to make one SMB share with the parent dataset!

Thanks!
 
Top