cPanel shows incorrect disk usage

Posted: 14th July 2014 by kunwardharmesh in WHM/cPanel

 

How to fix incorrect disk usage showing for a user in Cpanel

A customer complains that their reported disk usage is too high, that they are not using so much space. What do you do?

cpanel-disk-space-usage

Common reasons for quota problems

– There are files owned by the same user elsewhere on the server
– The backup directory is being counted towards the user’s disk quota
– Extra log files are being counted towards the user’s quota

1. Get their username and login to WHM to see if WHM is actually reporting the amount of space usage they say. If WHM does show extreme disk usage….

2. Login to SSH and cd to their home directory

cd /home/username
du -h

This will give a human readable display of folder by folder listing and space usage, with a total at the end. THIS WILL BE ACCURATE.

3. So, du -h shows a lower number than WHM? Then their is probably a backup file somewhere on the server with the same UID as this user.

4. Now, you need to locate the uid of the customer. You will need to know their username.

grep username /etc/passwd

5. Once get the output, search for their username for UID.

user:x:500:501::/home/user:/bin/bash

That will show a digit number and a smaller number. The larger number should be the UID.

6. Now, go to shell and run the following command (where, in this example, 33025 is the UID of the user)

find / -uid 500

A folder by folder listing will be displayed. It may take some time to process. When completed, you should scroll back through the output to find the files.

Files in /home/username are fine as well as /etc/valiases, etc.

LOOK for files in your backup / other directory that may have the same UID as your user. If found, that is usually the culprit.

Hope you Enjoy!