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?

  • The best way to find out is to fix the full disk and see if the crashes go away. – David Schwartz May 28 '12 at 18:36
  • I can't remove anything from /, / directory is 100% full – Mohammad Ali Akbari May 28 '12 at 18:52

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

  • Why -skh and not -sh? – Jodie C May 29 '12 at 2:18
  • Habit. du -sk in scripts; add the h for human-readable output. – ewwhite May 29 '12 at 12:36

It's certainly a place to start. Try finding what is filling your / partition and remove some files and see what happens

find / -xdev -maxdepth 1 -exec du -sh {} \;

will help you find out which directory tree is filling the disk.

  • You may be able to do that without GNU find: du -h --max-depth=1 – Jodie C May 29 '12 at 2:19

Yes, according to your MySQL error log it is the reason of crash. You may want to empty log files to free up some space or move the MySQL data directory to some other directory.

Error code 28 represents "No space left on device"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.