How to access "Other Usage" on disk usage?

whipworks

Well-Known Member
Aug 19, 2014
169
7
68
cPanel Access Level
Reseller Owner
Hi Support,

We've been having this issue for the longest time, and there's really no proper solution given to this. We need to know how to access this "other usage" that is taking up space on the disk usage. Why it's being generated randomly and why can't we (and even users) gain access to it to clear it.

1593176704458.png

This is just a small sample of one account on our servers. We have multiple customers/accounts getting their disk space filled up because of this. Hopefully we can get more explanation and a better solution (hopefully a permanent one) to fix this. Thank you.
 

Handssler Lopez

Well-Known Member
Apr 30, 2019
60
18
8
Guatemala
cPanel Access Level
Root Administrator
Generally this "Other" disk usage is generated by email accounts that delete messages but these are not completely purged.

You can verify this using horde to see in each of the email accounts the messages that have been deleted, and you can purge them by clicking in the upper right corner Other >> Purge deleted

Maybe someone can give you a better help or answer and I hope I have helped you!
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
@Handssler Lopez you are partially correct, there are other reasons for this as well, such as backup files owned by the user outside of their home directory. Basically OTHER usage is files owned by that user anywhere else on the server outside of the homedir - typically a root-level user would need to search for these items and let you know where what the other usage is attributed to.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
For other usage we use some of the following to identify these:

Find user-owned files outside of the user's home directory ("other usage")
The following command will create a files_outside_homedir.txt list of files belonging to that user outside of their home directory. Make sure that you set the cpaneluser variable before running it Otherwise, it will fail with an error message. If they have a non-standard home directory, such as /mnt/"${cpaneluser}" rather than /home/"${cpaneluser}", replace that as well.

Code:
find / -path /home/virtfs -prune -o -path /home/"${cpaneluser:?remember_to_set_variables}" -prune -o -user "${cpaneluser}" -ls > files_outside_homedir.txt 2>/dev/null
If you want only a specific filesystem, and not the whole server, specify the mountpoint (such as /home/ or /home4/ rather than /), and include the -xdev or -mount flag (see GNU Find for more information).

Afterward, if you want to find the disk space used by everything in the list, sum up the second column, which will get you the number of filesystem blocks used (filesystem quotas are based on blocks).

Code:
awk '{SUM += $2} END {print SUM}' files_outside_homedir.txt
To get an idea of the conversion between blocks and size (this can vary based on the filesystem on the server):

Code:
stat -c "%b blocks of %B bytes per block" /path/to/file
For example, if a file is using 16 blocks that are 512 bytes each, the total size of that file on disk is 8K, even though the file might only actually appear to be 5.4K.


To check for files that are being held open


Check for deleted but open files for the user.
Deleted, but still open files will show up in a user's filesystem quota, but be missed by du. This can contribute to "other usage".

For example:

Code:
[[email protected] ~]cPs# quota -svu hb1
Disk quotas for user hb1 (uid 1001):
     Filesystem   space   quota   limit   grace   files   quota   limit   grace
      /dev/vda1    959M      0K      0K             436       0       0
Code:
[[email protected] ~]cPs# du -hs /home/hb1
4.5M    /home/hb1
Code:
[[email protected] ~]cPs# lsof -nP +L1 | grep hb1
less      745288     root    4r   REG  253,1 1000000000     0 29386493 /home/hb1/deleted_file (deleted)
Code:
[[email protected] ~]cPs# ls -lhH /proc/745288/fd/4
-rw-r--r-- 0 hb1 hb1 954M Dec 27 18:02 /proc/745288/fd/4
There is a 950MB deleted file owned by hb1 being held open by a less process from the root user. Since the filesystem quotas still report this space, it shows up as "other usage" in cPanel. This will clear out once the less is terminated.