Author Topic: Incorrect free space on samba-shared drives under windows xp  (Read 8268 times)

wortmanb

  • Regular Poster
  • **
  • Posts: 18
    • View Profile
Incorrect free space on samba-shared drives under windows xp
« on: December 19, 2007, 03:51:49 am »
I've got several drives on my core which are shared via samba:

linuxmce@dcerouter:~$ df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hdb1             15417500  14003108    631228  96% /
varrun                 1037504       296   1037208   1% /var/run
varlock                1037504         0   1037504   0% /var/lock
procbususb             1037504       124   1037380   1% /proc/bus/usb
udev                   1037504       124   1037380   1% /dev
devshm                 1037504         0   1037504   0% /dev/shm
lrm                    1037504     33788   1003716   4% /lib/modules/2.6.20-15-generic/volatile
/dev/sdb1              4008000   1589592   2418408  40% /var
/dev/hdf1             78145768  68232184   9913584  88% /mnt/device/47
/dev/sda1            193400556  67941568 125458988  36% /mnt/device/40
/dev/sdb2            191344364 115945984  75398380  61% /mnt/device/46


I've mounted Dcerouter\public\audio\Internal HDD_CORE (sdb2) [46] as X: and it houses my iTunes library.  Given the freespace shown on device 46 I was surprised when Windows shows this device as:

Network Drive
File System: NTFS
Free Space: 616 MB
Total Size: 14.7 GB

What's up?  Why are all my mapped drives (in Windows) that use sdb2 showing this amount of usage?

Thanks!

wortmanb

  • Regular Poster
  • **
  • Posts: 18
    • View Profile
Re: Incorrect free space on samba-shared drives under windows xp
« Reply #1 on: December 19, 2007, 02:59:38 pm »
Actually, I think this is due to a reflection of the free space on /, not the specific drive and may just be part of how LMCE shares these devices out.  If I find a workaround, I'll post it.

hari

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 2428
    • View Profile
    • ago control
Re: Incorrect free space on samba-shared drives under windows xp
« Reply #2 on: December 19, 2007, 07:21:36 pm »
http://us3.samba.org/samba/docs/man/manpages-3/smb.conf.5.html

dfree command (S)

    The dfree command setting should only be used on systems where a problem occurs with the internal disk space calculations. This has been known to happen with Ultrix, but may occur with other operating systems. The symptom that was seen was an error of "Abort Retry Ignore" at the end of each directory listing.

    This setting allows the replacement of the internal routines to calculate the total disk space and amount available with an external routine. The example below gives a possible script that might fulfill this function.

    In Samba version 3.0.21 this parameter has been changed to be a per-share parameter, and in addition the parameter dfree cache time was added to allow the output of this script to be cached for systems under heavy load.

    The external program will be passed a single parameter indicating a directory in the filesystem being queried. This will typically consist of the string ./. The script should return two integers in ASCII. The first should be the total disk space in blocks, and the second should be the number of available blocks. An optional third return value can give the block size in bytes. The default blocksize is 1024 bytes.

    Note: Your script should NOT be setuid or setgid and should be owned by (and writeable only by) root!

    Where the script dfree (which must be made executable) could be:

     
    #!/bin/sh
    df $1 | tail -1 | awk '{print $(NF-4),$(NF-2)}'

    or perhaps (on Sys V based systems):

     
    #!/bin/sh
    /usr/bin/df -k $1 | tail -1 | awk '{print $3" "$5}'

    Note that you may have to replace the command names with full path names on some systems.

    By default internal routines for determining the disk capacity and remaining space will be used.

    No default

    Example: dfree command = /usr/local/samba/bin/dfree
rock your home - http://www.agocontrol.com home automation