SOLVED Mapped SMB share doesn't report available space quota set for the Dataset. Instead, it reports the quota for the SMB user's dataset.

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
Sorry if this question has come up before. All of the forum results I could find seemed to be for different issues. This one is likely simple and I know I've done it correctly in the past but can't figure it out for the life of me this time around.

The NAS has ~10TiB available all allocated to one vDev. The SMB share in question is a 4 TiB dataset allocated from those 10 TiB. What I'm expecting is for the mapped network drive to show up reporting x TiB free of 4 TiB (the SMB dataset) instead of reporting free space out of the full 10 TiB of the vDev. I know that this can and does work as expected as my other TrueNAS server I set up years ago reports out the correct used and allocated space for the SMB dataset. But I can't find what's configured differently between the two.

What super obvious thing have I missed here? Thanks!



1701298942912.png


1701299000565.png
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
What's the output of zfs list -o space?
 

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
What's the output of zfs list -o space?
1701302515993.png


1701302535657.png



I'm seeing a disconnect here between the 4 TiB reported for the SMB Dataset vs the 10 TiB reported for the smb_user which is used to map the SMB share. (That iSCSI share is technically a 2 TiB allocation but I'm pretty sure that it's reporting that way because it's a zVol.)
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Bah, stupid WebGUI console, I hate that thing. If you haven't setup SSH yet, you should make that a priority...

In the meantime, what's the output of zfs list -o name,avail,used,quota -r vdev_Data? I should also point out that it's silly to name a pool "something vdev", it's like naming a car "something tire".
 

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
Bah, stupid WebGUI console, I hate that thing. If you haven't setup SSH yet, you should make that a priority...

In the meantime, what's the output of zfs list -o name,avail,used,quota -r vdev_Data? I should also point out that it's silly to name a pool "something vdev", it's like naming a car "something tire".
Here's the output:
1701306125728.png



You're definitely right! It's a habit I got into when I was just getting started in ZFS and I found it helpful for keeping track of which 'layer' of the ZFS filesystem I was working in. Now, it's just habit.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
OK, let's see refquota instead of quota. At this point it better be 4 TB... once you've confirmed it, you can change it with zfs set refquota=none or whatever value works for you. If you want it to apply to descendent datasets, remove the refquota and set a normal quota.

You can edit this from the GUI as well, in each dataset's advanced properties menu.
 

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
OK, let's see refquota instead of quota. At this point it better be 4 TB... once you've confirmed it, you can change it with zfs set refquota=none or whatever value works for you. If you want it to apply to descendent datasets, remove the refquota and set a normal quota.

You can edit this from the GUI as well, in each dataset's advanced properties menu.
1701308926027.png


It looks like the refquota for the SMB Dataset is 4 TiB (which is what I wanted and expected).

Is the issue that vDev_Data/Dataset_1_SMB/smb_user is showing an Available space of 10 TiB and no refquota? That's the service user that has access to the SMB share for connecting devices.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Well, smb_user as unaffected by the parent's refquota, so you can write into it up to the real capacity, so Samba presents that as the capacity, I guess.
 

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
Well, smb_user as unaffected by the parent's refquota, so you can write into it up to the real capacity, so Samba presents that as the capacity, I guess.
Is that the actual cause of why the capacity is reporting incorrectly? Or, is there a more direct cause?
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
I would expect it to be the cause, but I'm not an expert on Samba.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I would expect it to be the cause, but I'm not an expert on Samba.
It's not clear what you're presenting via SMB, but generally File Explorer doesn't report on stats / capacity of nested filesystems within a mapped share. This is just a GUI presentation issue. If on Windows you were to:

1) share a drive with 4 GiB capacity
2) mount a different drive with 8 TiB capacity within it
3) mount (1) in a Windows client

The File Explorer GUI will show a 4 GiB capacity for the mapped network drive.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
As far as filesystem space usage stats go, samba uses stat / statfs output, the same as any other process on the server (depending on client reading this data it may get presented in different ways - some better and some worse). ZFS space accounting is complicated and if you want nuanced data, you should use proper management tools to get it.
 

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
I think I've finally found the issue by comparing to my older TrueNAS installation. It has a similar setup. However, on that installation, the smb_user account did not create a child directory under the SMB dataset. (I hadn't previously noticed the dropdown.) On this installation, this account wound up with a child dataset. And, that is clearly showing the 10 TiB available space.

Where would the smb_user child dataset have come from? Is it there because I set up an ACL for the SMB share?


1701533489810.png



1701533513034.png

Dataset_2 is the SMB dataset
 

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
You probably have the SMB share configured to automatically create child datasets for users.
Thanks! I double checked and I see that selecting Time Machine under settings for the SMB share results in the automatic creation of user datasets. This was not a feature I was experimenting with previously.

I think I will forgo the use of the Time Machine feature as I have some alternate options for backing up the NAS. In this case, where the user dataset has already been created, what options do I have for deleting that dataset after turning off Time Machine? Both the user dataset and the primary SMB dataset report the same storage used (per the earlier screenshots). So, I assume that the data is in the child dataset and would be deleted in the deletion of that dataset.
 

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
You probably have the SMB share configured to automatically create child datasets for users.
I did also find your older post discussing this same behavior as well. If the 'No Preset' option is selected for the purpose of the SMB share, does that allow the continued use of the Time Machine feature without the creation of the user sub-datasets?
 

bvh

Cadet
Joined
Nov 29, 2023
Messages
9
Thanks for the help everyone!

It looks like this one was fairly simple after all, with the only wrench in the mix being the experimentation with the Time Machine feature in TrueNAS. For anyone looking into this in the future, here's a quick overview:


First off, the Time Machine feature, by default, will result in the creation of child datasets under the one for which the feature is turned on.

Secondly (the obvious part), there are two options for setting quotas on Datasets in TrueNAS. Under the 'Edit Options' for a dataset, you should be able to see a 'Quota for this dataset' option and a 'Quota for this dataset and all children' option. If you have only set the first of these options, the child dataset created for the SMB user (if Time Machine is enabled) will not report the storage quota of the parent dataset accurately.

The simple fix is to also enter your desired storage quota for the dataset into the 'Quota for this dataset and all children' field. After doing so, the storage allocation will report correctly.
 
Top