[fixed] Samba claims out of space, While 4TiB are left

Diskpace on samba mac and linux clients showing 16gb left, but I could still make 40GB files and btrfs and rockstor showed terabytes of space left. I checked the quotas and nothing seemed out of place. The issue was likely because drives mounted in subfolders of the share had data stored and the size of the share was determined by the top level only. Fixed with the following smb.conf options, which should also report size correctly for sub folders which are actually drives.


8.6.2 dfree command

This global option is used on systems that incorrectly determine the free space left on the disk. So far, the only confirmed system that needs this option set is Ultrix. There is no default value for this option, which means that Samba already knows how to compute the free disk space on its own and the results are considered reliable. You can override it as follows:


dfree command = /usr/local/bin/dfree

This option should point to a script that should return the total disk space in a block, and the number of available blocks. The Samba documentation recommends the following as a usable script:


df $1 | tail -1 | awk ‘{print $2" "$4}’