Windows not reporting correct used and available disk space on Samba server with ZFS
I have a Samba server running ZFS in Linux.
• It is a standard by-the-book install with no special configuration.
• Each share is mapped to their own ZFS dataset, but not all datasets have their own share.
Oracle Linux 9.2 ZFS 2.1.12 Samba 4.17.5
I used this dfree script to get windows to report the proper used and free space remaining in File Explorer:
This works as intended.
However this is creating confusion to end users: they see the reported capacities for the different shares are slightly different, assume this means they must be different servers, and call me asking why that is.
So I want Windows to report the used space and capacity of the entire ZFS pool regardless of the share, rather than the reported used and available space of the individual datasets their shares are mapped to.
In theory I should simply replace $1 with the name of the pool ("tank" in this case), however the reported disk space does not change in windows:
Various tinkering causes Windows to either report strange values or nothing at all.
The only way I found to make this work so far is to hardcode USED and AVAIL to be what the zfs get commands are supposed to return:
Am I missing something silly? Has anyone got this to work?
Thanks!