Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Force recalculating cPanel accounts disk quotas?

Discussion in 'Workarounds and Optimization' started by Benjamin D., Mar 20, 2019.

Tags:
  1. Benjamin D.

    Benjamin D. Well-Known Member

    Joined:
    Jan 28, 2016
    Messages:
    126
    Likes Received:
    17
    Trophy Points:
    18
    Location:
    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.
     
    #1 Benjamin D., Mar 20, 2019
    Last edited by a moderator: Mar 20, 2019
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,472
    Likes Received:
    505
    Trophy Points:
    263
    Location:
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Benjamin D.

    Benjamin D. Well-Known Member

    Joined:
    Jan 28, 2016
    Messages:
    126
    Likes Received:
    17
    Trophy Points:
    18
    Location:
    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.
     
    #3 Benjamin D., Mar 23, 2019
    Last edited: Mar 23, 2019
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,531
    Likes Received:
    2,181
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Benjamin D.

    Benjamin D. Well-Known Member

    Joined:
    Jan 28, 2016
    Messages:
    126
    Likes Received:
    17
    Trophy Points:
    18
    Location:
    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.
     
    cPanelMichael and cPanelLauren like this.
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice