Unable to show real free/used disk space in SAMBA mounted drives under Windows

  • I have a NAS machine running OMV 3.0.85 erasmus up to date, and I have several hard drives shared via SAMBA (root directory /).


    But under Windows, both free an used disk space are shown as random sizes (111GB total, 17,5GB used for all drives, although some of them are 10TB in size and they are filled at different %)



    Is there any way to show the real free/used space in SAMBA? I guess it is a SAMBA limitation and it would be difficult if I were sharing a folder instead of the whole drive, but it may be a way when sharing the whole drive (/)


    Thanks in advance.

    omv 5.5.23-1 usul arm64

    omv 5.5.23-1 usul x64


  • Here it works.
    The shared folder is created via OMV-web under /srv
    Unrelated: in the SMB settings I disabled "master-browser"



    Maybe you see the statistics of your system drive (shared via SAMBA (root directory /).

  • Please have a look into this thread: Not enough disk space, post no. 3


    According to the smb.conf documentation for the 'dfree'-command, you have to do this:


    Create this script in your favourite path (e.g. /usr/local/bin), name it 'dfree' and make it executable.


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

    Attention: Maybe you have to adapt the path to the 'df'-command.
    Edit: Correct path is '/bin/df' not '/usr/bin/df' => Corrected!


    It´s a per share command. So add this line to the 'extra options'-field in 'Edit share' and restart the samba service.


    dfree command = /usr/local/bin/dfree

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

    2 Mal editiert, zuletzt von cabrio_leo () aus folgendem Grund: Wrong path to df-command.

  • Thank you.


    Yeah, it replicates the total size and free size of my Windows 10 installation drive. But I do not have it shared in any way (under C:\ it says "Not shared")



    My "Shared Folders" and "SMB Shares" tabs from OMV look like this:




    I do not like the double slash at the end of the relative path, but I do not know the way to share the root of the hard drive in other way.

    omv 5.5.23-1 usul arm64

    omv 5.5.23-1 usul x64



  • Thanks a lot. I will try as soon as I hit home.

    omv 5.5.23-1 usul arm64

    omv 5.5.23-1 usul x64


  • and I have several hard drives shared via SAMBA (root directory /).

    You should not share the root directory of a drive. Always share a subfolder. Common opinion in this forum. Could make troubles.

    OMV 3.0.100 (Gray style)

    ASRock Rack C2550D4I C0-stepping - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1) - Fractal Design Node 304 -

    3x WD80EMAZ Snapraid / MergerFS-pool via eSATA - 4-Bay ICYCube MB561U3S-4S with fan-mod

  • I could not get it to work.


    Created the dfree file, placed it in /usr/local/bin, set it root as owner and write/execute permissions (as smb.conf recommends), and added the extra string in each smb share. I tried to both reset smb service, reboot completely the NAS, reboot my local PC with Windows, and readding the samba share in the explorer, but the total/free space still shows my system disk.


    I tried also by sharing a folder instead a whole drive. I guess it is something related to my Windows PC as @DHGE do not have any problem with it showing correctly.


    Thanks.

    omv 5.5.23-1 usul arm64

    omv 5.5.23-1 usul x64


    2 Mal editiert, zuletzt von jfromeo ()

  • I guess (look at the source to be sure) that OMV only gathers statistics about shares created via Web GUI below /srv.


    So why don't you create on share there and then copy the contents of one of your shares created below / there and see if you get the desired result?

  • I guess (look at the source to be sure) that OMV only gathers statistics about shares created via Web GUI below /srv.


    So why don't you create on share there and then copy the contents of one of your shares created below / there and see if you get the desired result?

    Thanks.


    When you say "below /srv", you mean go to "Shared Folders" tab and create a share giving the absolute path like "/srv/dev-disk-by-label-XXXX/" instead of selecting the drive under the drop menu and selecting the relative path "/" to the drive?


    omv 5.5.23-1 usul arm64

    omv 5.5.23-1 usul x64


  • Sorry to bump this thread now, but I just had the exact same problem with OMV 4.1.3-1 (Arrakis). For me, the correct code in the shell file was THIS:

    Bash
    #!/bin/sh
    /bin/df -k $1 | tail -1 | awk '{print $2" "$4}'

    and NOT the following:


    Please have a look into this thread: Not enough disk space, post no. 3
    ............


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

    ............


    dfree command = /usr/local/bin/dfree

    Notice the changes from $3 --> $2 and $5 --> $4


    Hope this helps someone.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!