Thursday, February 11, 2016

centos - Can disk space be the reason for a server crash?



After looking into the MySQL error file, I found an error regarding disk space. Now I think its the reason for MySQL crashing:




[root@xxxx ~]# cat /var/lib/mysql/xxxx.com.err
120528 17:45:05 [Note] Crash recovery finished.
/usr/sbin/mysqld: Disk is full writing './mysql-bin.~rec~' (Errcode: 28). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space)


Could this be the reason behind the crashes?


Answer



Yes, disk space can cause a system crash. It's a dangerous situation that should be avoided. Processes can run out of space, log files can fill up, etc. Certain applications and daemons (e.g MySQL) will halt or crash if they run out of disk space.



In your case, it seems like your system doesn't have any partitions. You should provide the output of df -h to start...




From there, you may want to see which directories are consuming the greatest amount of space:



du -skh /* should provide an accounting of which top-level directories are the largest. I prefer the ncdu utility for this, but you can't expect that to be installed on most systems.



With du -skh /*, you'll get an output like this:



[root@xx /]# du -skh /*
8.4M /bin
37M /boot

124K /dev
110M /etc
192K /home
.
.
.
5.8G /usr
3.7G /var
41G /yum



If you wanted to drill down into /var, for instance, cd /var and run du -skh * and look for the largest consumers of space... But of course, the process of discovering this has been covered numerous times on this site. Check these related questions for more suggestions:



How does one find which files are taking up 80% of the space on a Linux webserver?



How do I find out what is using up all the space on my / partition?



Disk usage treemap software for headless Linux


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...