Disk warning: The file system is full

Issue: Your server file system's disk space is full and you get such email from cPanel:

The file system /dev/sda3, which is mounted at /usr, has reached warn status because it is 93% full.
Server: server.yourserver.com
Primary IP: XXX.XX.XX.XX
Notification Type: diskwarn
Filesystem: /dev/sda3
Mount Point: /usr
Percentage Full: 93%

Fix: One solution of this issue is straightforward but tedious procedure that you can increase the disk space value at the mount point /usr. But, before that one simple fix you can try. You can check whether logs are consuming more space as sometimes logs are not rotating in the server. If so, you can delete/remove the old logs and enable the log rotation to resolve the issue.

In my case, I could see that system logs present under the directory "/usr/share/locale/" were consuming the 12 GB space in the server. I have moved the system log file to different file system having much space available. You can also delete the logs if its not usable by you.

Then, I enabled log rotation for system logs by adding it in the logrotate configuration file.

Added line in /etc/logrotate.d/syslog to enable log rotation:

/usr/share/locale/zun/LC_MESSAGES/temp

/bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true

Then you need to restart rsyslog service. You would see a major decrease in the disk space usage on your file system now.





Comments

  1. Thanks. It solved my problem. The issue I identified was a DOS attack with DNS queries. Each denied DNS query was logged (More than 200/second) by rsyslog, which was causing log files to be very big (13GB)

    ReplyDelete

Post a Comment

Popular posts from this blog

SVN: File remains in conflict

HowTo: Enable extended logging for exim

12 tweakings for WHM/cPanel to speed up WordPress