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 !