cPanel reports incorrect disk usage for accounts. Provider can't seem to fix it...

maestroc

Well-Known Member
Aug 23, 2012
91
2
58
cPanel Access Level
Reseller Owner
Before i get to the question, I'm running on: CENTOS 6.4 i686 virtuozzo – vps WHM 11.38.2 (build 2)

Three weeks ago I noticed that the disk usage reported by WHM for some of my users was much different than what I saw when I used a du -sh. For one of my biggest users WHM reported 23MB when DU said he had over 6 gigs in the account. There were several accounts like this. I also noticed that all of my account quotas had been reset to UNLIMITED.

I ran the fixquotas script (and several others) and that solved the quotas but the disc space issue remained.

I reported this to my VPS provider. They said that there had been a "bug" in cpanel and for the last three weeks they have tried various things to try to fix it. The numbers have come up (in that one example account) to 1100MB but as I said the account still has over 5 more gigs in it that WHM can't seem to see.

Here is what my provider replied in one of the earlier ticket exchanges:

We'll definitely take a look at this (need your password), but we had this exact problem on 3 of our shared hosting servers, and it turned out to be a bug in cPanel. I worked personally with some of their head engineers on this issue. This likely happened sometime after a cPanel update, though it usually doesn't happen immediately.

This occurs when the backup directory is configured within a partition needing usrquota enabled, i.e. the /home directory. WHM tells you when you configure the backup (at least it used to) that you shouldn't use /home/backup, for example. They don't really say why, don't give much of a stern warning, and on a VPS, there aren't necessarily other places to put the backups. We encountered this because we would make our server backups to /home/backup and transfer them off-site from there. It only happened on random servers as well, and not every one of them we run, even though all are configured exactly the same, had the same updates, etc.

The fix was to disable backups in that partition, remove the backups (copy them elsewhere), and remount the /home partition, which may or may not be safe, with user data there. If you aren't putting your backups somewhere in the /home directory, this is likely something we will have to take back to the cPanel folk again.
FYI, My backups have always been in /backup.

They did as they said they would do in that quote but it didn't work. They apparently did other things behind the scenes, didn't work. Last night they apparently did something else that required rebooting the entire node... Still didn't work. The disk usage is still wrong and I can't really charge people for disk space if their cpanel says they aren't using it...

Does anyone know anything I can try to fix this issue?
 

maestroc

Well-Known Member
Aug 23, 2012
91
2
58
cPanel Access Level
Reseller Owner
Something else occurred to me that might (or might not) be significant or may not even be related to the issue...

A few days before the server crash I deleted several gigs of files from a clients account.

After my folder size reporting problems began I realized that the files were mysteriously back in place.

I asked my VPS provider if they had rolled me back to a previous backup for some reason (I did not request it or initiate a restore myself). They said they hadn't but yet I know without a doubt I deleted the files. If I look at the monthly backup from July 17 and compare it to today's stuff I can see that the files are gone on July 17 yet back in place on August 17.

In other words somehow at least one account got restored from a backup at the same time that the cpanel disc usage reporting got screwed up.

Does this make anyone think of another solution to the problem? Like I said, /fixquotas doesn't help at all...
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
You might want to look into hiring a SysAdmin to help you out here a bit. There are listings for that sort of thing on the AppCat:
cPanel App Catalog

Accounts don't get restored on their own. Files may be being restored if the account has been compromised, for example.

A few questions about your OP if I could.

I noticed that the disk usage reported by WHM for some of my users
So this is the case for more than one user then, is that correct?

The numbers have come up (in that one example account) to 1100MB but as I said the account still has over 5 more gigs in it that WHM can't seem to see.
And those files are owned by that user, and are in that users account directory, or no?

You might find the WHM FAQ helpful here:
How can I find out where all a user's files are? - cPanel Documentation

This quote from your provider:
We'll definitely take a look at this (need your password), but we had this exact problem on 3 of our shared hosting servers, and it turned out to be a bug in cPanel. I worked personally with some of their head engineers on this issue. This likely happened sometime after a cPanel update, though it usually doesn't happen immediately
Could you ask them for the cPanel ticket ID on this one so we can look it up on this end?

FYI, My backups have always been in /backup.
Are you saying /backup is on the same drive as your accounts?
 

GIANT_CRAB

Well-Known Member
Mar 23, 2012
89
0
56
cPanel Access Level
Root Administrator
Here's a list of possible issues:

  • File ownership of those files are of another user which is not calculated in. (mentioned by InfoPro too)
  • Quotas might not have been setup properly on the OVZ host kernel.
  • cPanel bug. (Highly unlikely)

>A few days before the server crash I deleted several gigs of files from a clients account.
>After my folder size reporting problems began I realized that the files were mysteriously back in place.

Did you deleted those files via cPanel?
If so, you did not have proper permission to delete those files.

>/fixquotas doesn't help at all...
This increases the likelihood of quotas not being setup properly on OVZ host kernel.