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

    • OMV 3.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • 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 4.0.14 | kernel 4.9.0 | omvextrasorg 4.1.0 ||
    • 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.

      Shell-Script

      1. #!/bin/sh
      2. /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.90 (Gray style)
      ASRock Rack C2550D4I - 16GB ECC - 6x WD RED 3TB (ZFS 2x3 Striped RaidZ1)- Fractal Design Node 304

      The post was edited 2 times, last by cabrio_leo: 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 4.0.14 | kernel 4.9.0 | omvextrasorg 4.1.0 ||
    • cabrio_leo wrote:

      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.

      Shell-Script

      1. #!/bin/sh
      2. /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' => 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

      Thanks a lot. I will try as soon as I hit home.
      || omv 4.0.14 | kernel 4.9.0 | omvextrasorg 4.1.0 ||
    • 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 4.0.14 | kernel 4.9.0 | omvextrasorg 4.1.0 ||

      The post was edited 2 times, last by jfromeo ().

    • DHGE wrote:

      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 4.0.14 | kernel 4.9.0 | omvextrasorg 4.1.0 ||