Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have my mysql directory /var/lib/mysql mounted in /dev/md0. When I shutdown/reboot my server, the system fails to switch the md0 in read-only mode because devices are busy, obviously by mysql.

During the startup, it causes some delay because of error scan and the drives are not mounted before the system try to reassemble the RAID array and mount it.

I need to service mysqld stop, umount /dev/md0, then mdadm --stop /dev/md0, so the server will shutdown cleanly and restart without any problems.

Is it the standard procedure when there's a software raid or the system should have been able to do it by itself ? Is there a way to do those steps automatically before a shutdown/reboot ?

Thanks for your help !

share|improve this question

The init system should shut down mysqld. Do you have a /etc/rc.d/rc0.d/K*mysqld and /etc/rc.d/rc6.d/K*mysqld? Did you install mysql-server from an RPM?

share|improve this answer
Yes I have K*mysqld in both location, and I have install mysql-server with RPM (5.1.56 on a CentOS 5.5). I don't know if the problem is mysqld not stopping or the /dev/md0 that isn't umount. – Bastien974 Mar 14 '11 at 12:44
You could try manually stopping mysql and then reboot. If /dev/md0 gets unmounted cleanly then it is mysql and you need to try to determine why mysql isn't shutting down properly. – Mark Wagner Mar 14 '11 at 16:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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