force mdadm to be read-only on disk failure

2

Is it possible to configure mdadm to become read-only when a drive fails?

I want to leave users with the most robust mdadm failure notification system. I've seen people ignoring a "degraded array" messages for a year, with obvious consequences. So a read-only filesystem is perhaps the most robust way, and does not require monitoring an email etc.

Maxim Imakaev

Posted 2017-04-20T23:29:21.087

Reputation: 151

Answers

1

After reading through the mdadm man page, I believe that this functionality is not built in to mdadm - and indeed, I don't think that an mdadm drive that is in use can even be forced into readonly mode.

You can probably hack a script together and add an option PROGRAM /path/to/script to /etc/mdadm.conf. Parameter 1 is, I believe, the event and parameter 2 is the device. (note I have not tested this)

davidgo

Posted 2017-04-20T23:29:21.087

Reputation: 49 152

Thank you! I couldn't find the info either... but I have seen read-only mdadm arrays on failure. But not always. I tested it by inducing a failed drive, and nothing happened. Maybe someone else will have more insights. – Maxim Imakaev – 2017-04-21T14:18:09.620