Mount points and free disk space

Urban Widmark urban at teststation.com
Wed Oct 10 15:32:03 GMT 2001


On Mon, 8 Oct 2001, Gerald (Jerry) Carter wrote:

> On Wed, 3 Oct 2001 rob.leadbeater at lynx.co.uk wrote:
> 
> > If Samba is used to share out a directory, which has mount points
> > below it, then the amount of disk space reported by Samba is based on
> > the share name rather than the actual amount of space available.
> >
> > If you look at the following examples, you will see that smbclient
> > (and windows clients) reports that there are 3768400 (ish) KB free in
> > /images rather than 8547972 KB - the sum of the amounts available in
> > the mount points.
> 
> This is by design.  When the client issues a QUERY_FS_INFO trans2
> call, we call disk_free on the top level directory of the share.

Why would the sum of available space be the correct value? Why not the 
minimum?

/sambashare			(1G free, is exported by samba)
    /foo			(on a different filesystem with 0.5G free)
    /bar			(yet another with 2G free)

Looking at available space is commonly done to determine if something will
fit. In this example the "best" value for that is 0.5G as that is a value
of the largest object that can be placed anywhere within the exported
view.

For other uses a sum is perhaps better.


> Trying to walk the directory tree would result is horrible performance
> and quite often not matter.

Ignoring symlinks, that walking could probably be just parsing the output
of 'df' or similar (/proc/mounts, /etc/mtab, whatever you got).

/Urban





More information about the samba-technical mailing list