You are reading this article because you have received a disk warning message from your server similar to the one below.
The email notification below shows that one of our servers drives is nearly full.
This is not good and as we know that our client's files on consume 65GB of the /home drive, there must be something else going on.
We need to log in to the server with SSH/Terminal and run some commands to narrow things down.
This command will scan the drives on the server and present us with the disk usage and in the screenshot, we can confirm that /sda3 partition is using 97%.
Lets narrow this down a bit by searching the / mounted drive and getting the size of each folder to determine which one is eating space.
As you can see in the results, there are a couple of culprits. As you can see, the /home dir is 68G which means the issue is NOT with clients files, its something else.
du -h --exclude /proc --max-depth=1 /
In this case, we will look at the /usr folder so run the command below to tell us the size of each top-level folder in /usr.
From the results, we can see the /usr/share is holding a lot of files. Much more than the other folders.
du -sh /usr/*
Now its a matter of traversing down the folders to determine where the issue lay, so just keep adding paths to the command in step 3 and keep narrowing down.
After some narrowing down, in our case, we found that the PHP logs for PHP 7.1 were HUGE.
du -sh /usr/share/cagefs-skeleton/opt/cpanel/ea-php71/root/usr/var/log/php-fpm/*
Using RM command we removed the log files and server space went back to normal at 43%.
rm -rf /usr/share/cagefs-skeleton/opt/cpanel/ea-php71/root/usr/var/log/php-fpm/error.log-20200906 rm -rf /usr/share/cagefs-skeleton/opt/cpanel/ea-php71/root/usr/var/log/php-fpm/error.log-20200830