[Samba] Quota/disk space display in windows

DA Forsyth iwrTech at iwr.ru.ac.za
Thu Nov 11 17:57:45 GMT 2004


Hi all

I have just noticed that Windows (98 and 2000) are not displaying the 
correct figure for disk space on any of my shares.

FreeBSD 5.2.1-R
Samba 3.0.7 from ports
quotas enabled on the ufs2 filesystems
samba compiled '--with-quotas'

ok, a user gets a quota set like this
   edquota -e /home:8672278:8774678:0:0 denis
now, those numbers are in 512 byte blocks and should represent 
4234Mb, right?  Certainly to FreeBSD they do.

but windows 'MY computer' displays 8.27Gb for the drive mapped to 
that share 

a quick bit of calculating shows that 8.27GB results if you regard 
the number
   8672278
as kilobytes
8672278 / 1204 / 1024 = 8.27

so, I take it then that Samba is unaware that the FreeBSD quotas work 
with 512 byte blocks!

I see there is a 'dfree command' and a 'get quota' command option in 
the global section.  I do not see exacly how those commands are used 
by Samba.  Are they called every time a windows client requests the 
disk status?  What is the difference between doing that and what it 
does by default?
The obvious fix to me is to allow the setting of a 'free block size' 
or 
'quota is in X units, multiply by Y to get bytes' = Y 
parameter that would fix this calculation internal to samba.

I see in the globals there is a 'block size' setting but I find the 
help for it confusing

I quote
--------
block size (S)

  	This parameter controls the behavior of smbd(8) when reporting
   	disk free sizes. By default, this reports a disk block size of
    1024 bytes. 

    Changing this parameter may have some effect on the efficiency
    of client writes, this is not yet confirmed. This parameter was
    added to allow advanced administrators to change it (usually to
    a higher value) and test the effect it has on client write
    performance without re-compiling the code. As this is an
    experimental option it may be removed in a future release. 

    Changing this option does not change the disk free reporting
    size, just the block size unit reported to the client. 

    No default
--------

I have just tried setting that to 512 and restarting samba but there 
is no change, the disk size is still wrong, and still 8.27GB.
My web searches on this show arguments about what should be shown.
Forget all that.  What the user needs to see is his allocated space, 
and his free space.  Total size of the server drive is not his 
concern, and at the moment Samba is reporting neither the real quota 
size (actually twice the set size), NOR the real disk size so this is 
clearly a BUG.

Please help Samba to be 'correct', not 'worked around'.  My server 
goes live on 26 November and I'd really like it to work correctly.




--
       DA Fo rsyth            Network Supervisor
Principal Technical Officer  -- Institute for Water Research
http://www.ru.ac.za/institutes/iwr/





More information about the samba mailing list