How to reduce or free space in /usr partition

1. Restart the httpd service. This might free a little space some times.

2. Check for apache logs like error_log, access_log , suexec_log in /usr/local/apache/logs . These can either be cleared off or if you need the logs then you can take a zipped copy and keep it aside.

3. Same can be done for the files in cPanel logs (/usr/local/cpanel/logs) as well .

4. Domlogs – Get into the /usr/local/apache/domlogs/ directory. Run the following command :-

# ls -al -SR | head -10 —> It will list 10 files in the decreasing order according to their size

If the domlog file is too large for a domain then it is possible that awstats is not running . Check whether cpanellogd is running on the server using pstree . If not, restart it .
Else, it is possible that awstats for only that particular domain is not updating. Get into the directory /usr/local/cpanel/base and check if any file as ‘awstats.domainname.com.conf’ exists. If yes , delete that file.

Now, run /scripts/runweblogs for that user. It will update the awstats and automatically clear the domlogs file thereafter. Do not delete the domlogs file itself.

5. Remove old and unwanted backups of ‘apache’ that might have been taken long ago. Also, check for any other duplicate folders that can be removed safely.

6. Remove core files, if any . Normally, some core files (like core.1234) might be present in /usr/local/cpanel/whostmgr/docroot . Check for these and remove them.

7. Restart your server, the quota might be off for that partition and reboot will correct it. Keep in mind if there is a harddrive error this can leave the server offline while the system or admin tuns a FSDK.

——

Also check how to find large files

2 thoughts on “How to reduce or free space in /usr partition”

  1. Just as a heads up you indicated that restarting httpd might save some space in my case, it appeared that there was 7.0G that was used on /usr.

    After restarting httpd and having a heart stopping moment as the process failed to start through whm. (Thank you “/etc/init.d/httpd start” for bringing the process back up) at first didn’t want to come back up. A second try brought the service back up and then checking the disk usage via df indicated that there was only 3.5 G being used.

    So restarting httpd can definitely free a lot of space. One of the key tips offs for me was that df and adding up the du entries from du entries significantly disagreed.

  2. Additional hint: remove older rollbacks of CPanel located at

    >cd /usr/local/cpanel-rollback

    To check how much space they use, use this command:

    >du -sh *

Comments are closed.