Fix Unlimited Quota in WHM

Issue: Quota in WHM under Account Information > List Accounts shows “unlimited” for all users in a SolusVM OpenVZ container environment. The following steps will demonstrate how to fix the issue. It will require access to the Node and to the VPS.

1. SSH into the VPS and run this command:

# /scripts/fixquotas

Fail output results:

# /scripts/fixquotas
Installing Default Quota Databases......Done
Quota Mode: Linux
journaled quota support: not available with vzaquota (disabled)
checking out /backup
checking out /backup
Quotas have been enabled, however they may not be up to date as quotacheck has been skipped.
Resetting quota for user1 to 1024 M
No filesystems with quota detected.
Resetting quota for user2 to 2048 M
No filesystems with quota detected.
Resetting quota for user2 to 1024 M
No filesystems with quota detected.
Resetting quota for user2 to 1024 M
No filesystems with quota detected.

2. Run another check in the VPS.

# quotacheck -vagum

Failed output results:

# quotacheck -vagum
quotacheck: Cannot find filesystem to check or filesystem not mounted with quota option.

3. Exit the VPS.

4. SSH into the Node and stop the server with the following command (Assuming VPS has a CT_ID of 106).

# vzctl stop 106

5. Now edit the Openvz configuration file to make sure DISK_QUOTA is set correctly.

# vi /etc/vz/vz.conf

Check to make sure disk quota is set to “yes”. Save and exit.

File Example:

## Disk quota parameters
DISK_QUOTA=yes
VZFASTBOOT=no

6. Next we edit the container configuration file. (Assuming VPS has a CT_ID of 106)

# vi /etc/vz/conf/106.conf

Insert this code to the very bottom of the config file

QUOTAUGIDLIMIT="1000"

Save and exit.

Alternate Command to insert QUOTAUGIDLIMIT into the Config file.
For example here CT_ID is 106 and Disk Space for VPS is 1000GB.

# vzctl set 106 --quotaugidlimit 1000 --save

7. Start the VPS.

# vzctl restart 106

8. Run the command to fix quotas in the VPS.

#  /scripts/fixquotas

9. Check Quota in WHM. It should be set correctly now.

OPTIONAL Steps but may be required

FROM OPENVZ:

WHM/Cpanel, a popular commercial web-based control panel for Linux, has a tendency to overwrite the special quota files in the VE context. I am referring to:

lrwxr-xr-x     1 root root    39 Jun  8 17:27 aquota.group -> /proc/vz/vzaquota/00000073/aquota.group
lrwxr-xr-x     1 root root    38 Jun  8 17:27 aquota.user -> /proc/vz/vzaquota/00000073/aquota.user

The result of these being overwritten will be WHM showing “unlimited” quota reports for all users in the system. An quick solution to this is to run these commands from within the VE as root:


rm -f /aquota.user 2>/dev/null
rm -f /aquota.group 2>/dev/null
for x in `find /proc/vz/vzaquota/ | tail -2 `; do ln -s $x / ; done

admin has written 38 articles