SOLVED Force recalculating cPanel accounts disk quotas?

Benjamin D.

Well-Known Member
Jan 28, 2016
126
17
18
Canada
cPanel Access Level
Root Administrator
Hi, for some reason, after a recent upgrade in WHM, my server never came back up after a restart it asked me to perform. My data center found out that the kernel couldn't boot off of the HDD anymore (- Removed -) so they now make my server boot off of a network boot kernel, which works almost flawlessly in my case! Good news, but... flawlessly except for just 1 little tiny detail:

I no longer have valid disk quotas.

So, in these places, the quotas show 0 or a tiny amount of MB's which is absurd, because all accounts use GB's of space each:

1) In WHM > List Accounts > "Disk Used" column
2) In an account's cPanel > "Statistics" widget on the right column

What's making me pull my hair out is: Every cPanel account actually has 100% valid disk quotas shown under: In an account's cPanel > "Disk Usage" page



How can cPanel perfectly render the disk quota in one place and not in another WITHIN cPanel itself? It's completely absurd and impractical.

Now, my question is how the heck can I force my server to recompute every cPanel account's disk usage NOW? I need this information to bill my hosting customers. inb4 I log in SSH and use a bash command to compute this. I know cPanel can do it for me, because it's doing it right now under the account's cPanel > "Disk Usage" page. Why is cPanel using different scripts to compute this? And how to trigger this manually so that I can have valid quotas disaplyed NOW in WHM? I don't care if tomorrow it's gonna be off by 10MB, I just need it periodically to be 100% valid so I want to know how to trigger the quotas re-computation.

THINGS I HAVE TRIED:

- Exec: /scripts/fixquotas
- Rename/Delete: /home/some-user/.cpanel/datastore
- Log out and log back in WHM and that user's cPanel
- Gracefully reboot the server

Is there a way cPanel could improve a little and make it so quotas work when booting the kernel off of network? Why is it such a mess? It's only a stupid: du -s

Thanks.
 
Last edited by a moderator:

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
7,508
591
263
Houston
cPanel Access Level
DataCenter Provider
Hi @Benjamin D.

It sounds like the issue isn't that cPanel is not supporting this but that the kernel you're using doesn't support filesystem quotas. This is something that you need to work with your provider on.

I'd attempt initializing them first with the following:

Code:
/scripts/initquotas
And if that doesn't resolve the issue I'd suggest going back and working with your provider to obtain a solution that does support filesystem quotas.

Thanks!
 

Benjamin D.

Well-Known Member
Jan 28, 2016
126
17
18
Canada
cPanel Access Level
Root Administrator
@cPanelLauren It used to work before a WHM upgrade asked for reboot, which I did and then the server never came back up by itself, stuck on the loading process, that's when the data center suggested we make it boot from the network kernel, which works for everything except quotas.

Can you answer the question why when you go in an account's cPanel > "Disk Usage" page, it shows the used quota perfectly fine there? But not anywhere else in cPanel nor WHM?

I ran the command you specified. Do I have to wait until tomorrow morning to see if it works or not? Because immediately after running the command, it still shows 2MB, 10MB, 6MB... all which is wrong and super low values compared to the reality.
 
Last edited:

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,902
2,228
363
cPanel Access Level
DataCenter Provider
Twitter
Hello @Benjamin D.,

Can you open a support ticket so we can take a closer look to see why quotas are not working (despite appearing under the Disk Usage section in cPanel)? You can post the ticket number here and we'll link this thread to it.

Thank you.
 

Benjamin D.

Well-Known Member
Jan 28, 2016
126
17
18
Canada
cPanel Access Level
Root Administrator
It won't be necessary as I managed to resolve the issue 2 days ago. Here's what I did. I hope it helps anybody else in the future:

nano /etc/fstab

It contained these entries (plus other irrelevant entries) :

# <file system> <mount point> <type> <options> <dump> <pass>
/dev/md2 / ext4 errors=remount-ro,usrjquota=quota.user,jqfmt=vfsv0 0 1
/dev/md3 /home ext4 defaults 1 2

So I moved ",usrjquota=quota.user,jqfmt=vfsv0" options from / to /home since / is read only (network boot) and /home is writeable and always has plenty of free space available anyway.

Here's what it now looks like.

# <file system> <mount point> <type> <options> <dump> <pass>
/dev/md2 / ext4 errors=remount-ro 0 1
/dev/md3 /home ext4 defaults,usrjquota=quota.user,jqfmt=vfsv0 1 2

I then rebooted. Now all quotas display properly in WHM and cPanel for every account. Back to normal.