MySQL Error writing file (Errcode: 28)

In this post we will show the solution to get rid of the known error (Errcode: 28) when you start MySQL service on a Linux machine.

This error means no disk space left on file system.

[root@DB-Host01~]# perror 28
OS error code 28: No space left on device

You will be seeing following entries in the MySQL log when start the service.

[root@DB-Host01 ~]#
[root@DB-Host01~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting mysqld: [FAILED] [root@ DB-Host01~]#
[root@DB-Host01~]# tail -n 5 /var/log/mysqld.log
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer…
140711 6:16:17 InnoDB: Started; log sequence number 0 474481171
140711 6:16:17 [ERROR] /usr/libexec/mysqld: Error writing file ‘/var/run/mysqld/’ (Errcode: 28)
[root@DB-Host01 ~]#

We can confirm the disk usage on the system using ‘df-h‘ command

[root@DB-Host01~]# df -h
Filesystem Size Used Avail Use% Mounted on
5.8G 5.8G 0 100% /
/dev/hda1 99M 20M 75M 21% /boot
tmpfs 499M 0 499M 0% /dev/shm

As we see, disk usage is 100% for root directory. Either we have to delete the  unwanted files or must have to extend the size if you are under LVM partition.

You can use variety of linux commands to find the largest files in the used file system. One of the simple command to use would be “find

To find the file larger than 1GB, we can use the following command

[root@DB-Host01~]#find / -type f -size +1G

And for finding directory lareger than 1GB,

[root@DB-Host01~]#find / -type d -size +1G

Once you have made sure that you have the enough disk space is available on the system, try restarting MySQL service again and it should be Ok this time.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts