How to fix disk quotas on a cPanel server

On this post we will show you how to check the health of your system quotas, you will also learn how to fix disk quotas on cPanel systems. As it’s very common to face disk quota issues running WHM/cPanel software.

Fix disk quotas on cPanel

The first thing that you must do while analyzing quotas on a new system is to check if quotas are actually enabled.

Verify that your system is using quotas

Login as root and type:

mount | grep quota -i

You should see something like this if you have at least one of your partitions quota enabled:

[[email protected]:~]mount | grep quota
/dev/sda3 on / type ext3 (rw,usrjquota=quota.user,jqfmt=vfsv0)
[[email protected]:~]

This was defined at /etc/fstab as you see it:

/dev/sda3 / ext3 usrjquota=quota.user,jqfmt=vfsv0 1 2

If you see usrjquota then your quotas are enabled. If you don’t see any output, that means your system is not enabled to work with disk space quotas. You will have to enable disk quotas

Easy method: enable Quotas using WHM

Move to: WHM – Server Configuration – Initial Quota Setup

This will do all the quota setup procss automatically for you.

Alternative method: enable quotas from shell

To enable quotas on a certain partition you will have to edit /etc/fstab file and add the usrquota variable to the Options column. Example:

LABEL=/boot /boot ext3 defaults,usrquota 1 2

Then run mount and remount commands to remount the file system. Example for /boot partition:

mount -o remount /boot

Finally, run the following command to confirm that your quotas are enabled on the device:

repquota -a

If you already have quotas enabled but not working, how do you fix it?

Try fixing your quotas using this script:

/scripts/fixquotas

This script will reset all the quotas to the default configurations and 99% of the times it does fix the problem. The output should be something like:

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

Do you know other ways to fix disk quota issues on cPanel? Please share your knowledge with us

About the Author: Santiago Borges

Experienced Sr. Linux SysAdmin and Web Technologist, passionate about building tools, automating processes, fixing server issues, troubleshooting, securing and optimizing high traffic websites.

Leave a Reply

Your email address will not be published. Required fields are marked *