SMB showing space available / total wrong

Kailee71

Contributor
Joined
Jul 8, 2018
Messages
110
Hi all.

I'm on TrueNAS-12.0-U4 (core) and am having an issue with share sizes reported to Windows clients; I have a pool of 2x 4TB mirror vdevs, so 8TB total size. Roughly half is used, with ~3,2TB available as reported by zfs:

1625225557787.png


However, on windows clients, I get this reported:

1625225580576.png


Is there something I'm missing?

Many thanks for any pointers,

Kai.
 

shipser

Dabbler
Joined
Apr 20, 2016
Messages
17
you see exactly what you should.
mirror copies the data on all the drives in it. so you have 4TB of Space, not 8.
and there is some overhead which gives you a total of 3.19TB usable space. TrueNAS and the windows client show the same.
available space in TrueNAS is the total usable space of the pool.
 
Joined
Oct 22, 2019
Messages
3,641
I've noticed it's always behaved this way, whether my client is Windows or Linux.

I see a peculiarity where the capacity reported from the share is always used space + free space, and that this changes based on how much data lives on each share (assuming you're not using quotas.) I think it has something to do with each share being unaware of the used space of the other shares.

So take the following examples. You have a pool that is 10TB in capacity. You have two shares, media and downloads. You're not using quotas. You place 5TB of data under the media share. You place 1TB of data under the downloads share.

----------

Under the TrueNAS dashboard you will see your pool listed as (in units of TB):
  • Capacity: 10
  • Used: 6
  • Free: 4

The properties for the media share will display (in units of TB):
  • Capacity: 9
  • Used: 5
  • Free: 4

The properties for the downloads share will display (in units of TB):
  • Capacity: 5
  • Used: 1
  • Free: 4
----------

It's as if the share asks the server "How much free space do I have left?" Then it simply adds how much data is currently being used on itself to calculate the total capacity.

So for the media share it asks the server "How much free space do I have left? 4 TB? Well, I'm using 5 TB, so that must mean the total capacity is 9 TB! Who is this downloads you speak of? I have no idea about that..."

And for the downloads share it asks the server "How much free space do I have left? 4 TB? Well, I'm using 1 TB, so that must mean the total capacity is 5 TB! Who is this media you speak of? I have no idea about that..."
 
Last edited:

Kailee71

Contributor
Joined
Jul 8, 2018
Messages
110
you see exactly what you should.
mirror copies the data on all the drives in it. so you have 4TB of Space, not 8.
and there is some overhead which gives you a total of 3.19TB usable space. TrueNAS and the windows client show the same.
available space in TrueNAS is the total usable space of the pool.
Hi @shipser. Thanks for your feedback, but I think you misread / misunderstood. I have a total of 4 drives, 4Tb each, in 2 mirror vdevs, so available space is ~8Tb. Of these, 55% is used (see screenshot of pool). So I would like for SMB to show total of share (~8TB) and then what's left available (~3,2TB)... Instead Windows is telling me only a few MB is used when in fact nearly a TB are already on the pool;

1625247784882.png


Anyone have an idea why this is happening?

Kai.
 

shipser

Dabbler
Joined
Apr 20, 2016
Messages
17
Hi @shipser. Thanks for your feedback, but I think you misread / misunderstood. I have a total of 4 drives, 4Tb each, in 2 mirror vdevs, so available space is ~8Tb. Of these, 55% is used (see screenshot of pool). So I would like for SMB to show total of share (~8TB) and then what's left available (~3,2TB)... Instead Windows is telling me only a few MB is used when in fact nearly a TB are already on the pool;

View attachment 48099

Anyone have an idea why this is happening?

Kai.

you are right, missed the part about the 2 vdevs. then i don't know the answer. sorry.
did you split the pool to 2 shares?
 

Kailee71

Contributor
Joined
Jul 8, 2018
Messages
110
Hey @winnielinnie,

no I didn't skip them; they did clarify in more detail what my question was but offered no solution. I just wanted to clarify my setup to @shipser. Ideally, a 10TB pool would show that total to all child dataset shares, the free space as the free space available on the parent pool (or whatever's left in individual dataset quota), and the used space should show what used by the individual dataset. That's just my preference, and I was wondering if there's a way to achieve this (I realize this may not be trivial...).
 

shipser

Dabbler
Joined
Apr 20, 2016
Messages
17
@Kailee71 can you show to pool configuration page? edit: saw it
What baffles me is that TrueNAS itself telling you the pool size is 3.19 at the "Available space" field on the picture you show, so it is a TrueNAS side problem.
somehow it seems that TrueNAS reports only a part of the full pool size.
 
Joined
Oct 22, 2019
Messages
3,641
I think we might be over-complicating things.

Nothing is being displayed incorrectly. TrueNAS / ZFS correctly show that your pool of 7.02 TB total capacity has 3.83 TB currently used, which leaves a remainder of 3.19 TB available.

Your individual SMB shares report how much is currently being taken up in the share and how much available space is being reported by the server, then simply adds the two together to approximate the "total capacity" as far as the share is concerned.

Without using quotas, what the share reports as "available" (i.e, free space) is exactly that. You have that much free space to work with.

I'm not sure if there's a way to report the pool's total capacity, whether as a share-by-share basis or an all encompassing SMB server parameter.
 
Joined
Oct 22, 2019
Messages
3,641
So I would like for SMB to show total of share (~8TB) and then what's left available (~3,2TB)

Wouldn't that look odd? One scenario is you view a network folder's properties and it tells you something like:
  • Total Capacity: 8TB
  • Used: 1TB
  • Free: 2TB

1 + 2 = 3, so "where'd my other 5TB go?"
 

Kailee71

Contributor
Joined
Jul 8, 2018
Messages
110
Well I'm of the opinion that Windows is reporting incorrectly:

1625563034458.png


1625563085829.png

and
1625563126405.png

Both the "data" dataset and the "media" dataset have significant amounts of data in them as you can see above ("zfs list zpool" output). So I'd prefer them both to show "3.20 TB free of 7.02TB TB" (3.83TB + 3.19TB) in the "This PC" listing and show the correct amount of used space in the "Properties" window. No arithmetic needed, or inconsistencies generated. Or am I missing something?

+++++ EDIT +++++
So I'm guessing this has to do with zpool/data and zpool/media being further subdivided into sub-datasets. However, "zfs list" shows what I would like to see on SMB clients, as well as nfs clients (which report the same as SMB);
1625563637078.png

Is there any way of achieving this (i.e. SMB and NFS reporting sizes including child datasets like "zfs list" does)?
 
Last edited:

Chaphasilor

Cadet
Joined
Oct 23, 2022
Messages
1
Hi, this problem has annoyed me for quite some time now, but I think I figured out why this is being displayed in such an unexpected way:
Check the ownership of your files. In my case, many of the files are not owned by the same account that is used to access the SMB share, and TrueNAS seems to report the used disk space for this user account to Windows.

I haven't done extensive testing on this, so I might be a bit off, but maybe someone else can confirm this. If this is actually the case, a solution for things like download managers or cloud applications like Nextcloud could be to create a generic users for any services that store content on a specific data set and use that same account to access the SMB share. This way the correct "Used" size should be shown. The "Total" size can be adjusted using a User Quota for that user, if needed :)
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Hi, this problem has annoyed me for quite some time now, but I think I figured out why this is being displayed in such an unexpected way:
Check the ownership of your files. In my case, many of the files are not owned by the same account that is used to access the SMB share, and TrueNAS seems to report the used disk space for this user account to Windows.

I haven't done extensive testing on this, so I might be a bit off, but maybe someone else can confirm this. If this is actually the case, a solution for things like download managers or cloud applications like Nextcloud could be to create a generic users for any services that store content on a specific data set and use that same account to access the SMB share. This way the correct "Used" size should be shown. The "Total" size can be adjusted using a User Quota for that user, if needed :)
Available space will be adjusted downward if you have a user quota in place for the authenticated user.
 
Top