Disk Quota in Edit Users shows as Unlimited

Good afternoon,

I’ve recently setup a new Cent OS web server running Webmin v1.942 and Virtualmin v6.09 and I’m having an issue with the ‘Disk Quota’ showing as unlimited for any additional users created, regardless of what Virtual Server they’re in.

Editing the selected user and looking at the “Quota and home directory settings” section, shows the Unlimited radio button is selected, however when the accounts were created they were setup with a 100MB quota.
Editing the user and setting both a ‘Home directory quote’ and ‘Mail file quota’ results in the Unlimited radio button still being selected when re-editing the user(s).

Both the initial quota and subsequent updates however do appear to be in place as the user in Webmin -> Disk Quotas shows the expected values and running ‘quota -u [username]’ also shows the quota I’d expect. So it looks like just Virtualmin having issues getting/displaying this information.

The quota does however show correctly for the initial server owner account(s) that get created per virtual server, but all subsequent accounts (mail accounts) seem to not work.

Could someone please help?

Many Thanks,
Luke

Can you check if this is hat you see under Webmin | Disk Quotas …


…along with this under Webmin | Disk and Network File Systems | (Root filesystem)

Under Webmin | Disk Quotas, it is important to have status reflect “User and group quotas active” and this would happen if you had enabled quotas at the time of installing Virtualmin under CentOS.

Hi,

Thanks for coming back to me.

Checking in Webmin -> Disk Quotas, I can confirm it looks like yours apart from having multiple filesystems listed (as I have separate mount points for /, /home and /boot). User and Group quotas are enabled on / and /home, but not on /boot.

In Webmin -> Disk and Network Filesystems, both the root filesystem and the /home mount point have user and groups quotas enabled (although the root filesystem didn’t when I checked, but enabling these and rebooting hasn’t made any difference)

Regards,
Luke

And therein lies a problem: if your /home or /home/domain.com is not on the same physical media as / then one of the quirks of Virtualmin is that it will show the quota in Virtualmin | Edit Users as unlimited / incorrect under the Disk Quota and Quota used columns respectively.

In a nutshell, if you put the files of a virtual server on a mounted drive then Virtualmin fails to display quota correctly. Additionally, there are other quirks in Virtualmin and Usermin which also crop up.

I join you, @lukefoley in seeking a workaround for this. May the force be with us.

Thanks for confirming that there are problems when using multiple partitions and quotas.

To this end, I’ve merged the /home and / volume groups together and now I’m left with just a single volume group mounted on /.
I’ve rechecked the virtualmin config and confirmed that it reports quotas are active as expected.
I’ve also created a new Virtual Server along with a couple of test accounts, but the quotas are still being reported as Unlimited in Virtualmin, but correct using the quota command or in Webmin Disk Quotas section.

Any other ideas where I might go with this next?

Kind Regards,
Luke

Don’t give up just yet, Virtualmin may be displaying cached values whereas your merging of volumes may have solved the problem.

Trust the force, Luke.

Unfortunately, waiting for any caches to expire (as well as restarting the server, and clearing all browser caches), didn’t resolve the issue for me :slightly_frowning_face: All quotas other than the original server owner accounts were still showing as unlimited.

I’ve now managed to work around this issue by enabling external quota commands (found in Virtualmin -> System Settings -> Virtualmin Configuration -> Quota Commands) and have written some custom bash scripts to get/set the quota information.

For anyone else stumbling upon this same issue (and having a similar setup as me), I provide the commands and scripts I used below for reference.

Command to get a users quota: /path/to/file/getquota.sh user
Command to get a groups quota: /path/to/file/getquota.sh group

#!/bin/bash
if [ $1 == “user” ]
then
   quota=`quota --hide-device -u $2 2> /dev/null`
   if [ `echo “$quota” | wc -l` -eq 3 ]
   then
      echo “$quota” | sed -n 3p | awk ‘{print $1,$2,$3}’
   fi
elif [ $1 == “group” ]
then
   quota=`quota --hide-device -g $2 2> /dev/null`
   if [ `echo “$quota” | wc -l` -eq 3 ]
   then
      echo “$quota” | sed -n 3p | awk ‘{print $1,$2,$3}’
   fi
fi

Command to list user quotas: /path/to/file/listquotas.sh users
Command to list group quotas: /path/to/file/listquotas.sh groups

#!/bin/bash
if [ $1 == “users” ]
then
   users=`cut -d: -f1 /etc/passwd`
   while IFS= read -r user; do
      quota=`quota --hide-device -u $user 2> /dev/null`
      if [ `echo “$quota” | wc -l` -eq 3 ]
      then
         quota=`echo “$quota” | sed -n 3p | awk ‘{print $1,$2,$3}’`
         echo “$user $quota”
      fi
   done <<< “$users”
elif [ $1 == “groups” ]
then
   groups=`cut -d: -f1 /etc/group`
   while IFS= read -r group; do
      quota=`quota --hide-device -u $group 2> /dev/null`
      if [ `echo “$quota” | wc -l` -eq 3 ]
      then
         quota=`echo “$quota” | sed -n 3p | awk ‘{print $1,$2,$3}’`
         echo “$group $quota”
      fi
   done <<< “$groups”
fi

Command to set a users quota: /path/to/file/setquota.sh user
Command to set a groups quota: /path/to/file/setquota.sh group

#!/bin/bash
if [ $1 == “user” ]
then
   setquota -u $2 $3 $4 0 0 /
elif [ $1 == “group” ]
then
   setquota -g $2 $3 $4 0 0 /
fi

Hopefully it will help someone else out of a pinch :slight_smile:

Kind Regards,
Luke

1 Like

In a dark place we find ourselves, and a little more knowledge lights our way.

 - Yoda

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.