If the '/home' folder is a bind mount from a file system that has quotas enabled, Virtualmin 'Re-Check Configuration' erroneously reports that '/home' does not have quotas enabled, and disables setting quotas. Details below.
*Q: Is it possible to work around this? E.g. can you override the path used by Virtualmin for setting/checking quotas?*
To recreate this problem you can use this (artificial) example:
1) mv /home /homereal
2) mkdir /home
3) mount --bind /homereal /home
4) Log into Virtualmin and run 'System Settings' -> 'Re-Check Configuration'
5) Note that message is displayed: 'Quotas are not enabled on the filesystem /home which contains home directories under /home and email files under /home. Quota editing has been disabled.'
Tested on Virtualmin 4.10.gpl and Debian 7.
In a real example on Debian 7, /etc/fstab contains:
/dev/mapper/hosting /var/hosting ext4 barrier=1,data=ordered,relatime,grpquota,user_xattr,usrquota,rw 0 0
/var/hosting/home /home none bind 0 0
and mtab contains:
/dev/mapper/hosting /var/hosting ext4 rw,relatime,user_xattr,barrier=1,data=ordered,usrquota,grpquota 0 0
/dev/mapper/hosting /home ext4 rw,relatime,user_xattr,barrier=1,data=ordered,usrquota,grpquota 0 0
The command line quota tools work fine, but correctly report and operate on '/var/hosting' and not '/home'
Virtualmin/Webmin's checking algorithm and possibly quota operations don't seem aware of bind mounts. This could be fixed if 'findmnt' were used.
This might be a result of a deliberate change in Debian, where /etc/mtab is now a soft link to /proc/mount and now the 'bind' option is not listed in mtab.
It is recommended that the 'findmnt' command be used to find the correct source filesystem of a mount. And that works fine:
# findmnt /home
TARGET SOURCE FSTYPE OPTIONS
/home /dev/mapper/hosting[/home] ext4 rw,relatime,user_xattr,barrier=1,data=ordered,usrquota,grpquota
or if you want the correct path to set/check quotas in a script (this works equally well for bind and non-bind mount points)
# findmnt -vno target -s `findmnt -vno source /home`
Until this is fixed, is it possible to work around this, e.g. can you override the path used by Virtualmin for setting/checking quotas?