Linux – Software RAID unmount before shutdown

centoslinuxsoftware-raid

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 !

Best Answer

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?

Related Topic