Unfortunately the mdadm and mdadm.conf man pages are not quite up to par. I would like to enable the --write-mostly flag for my RAID, but neither the man pages nor the internet will tell me how. I am not aware of any place to put default arguments for mdadm, nor aware of when it would be launched and by what.

It seems the logical place to add this information is mdadm.conf, but the flag is unmentioned in man mdadm.conf. Where and how can I enable --write-mostly? Thank you.

link|improve this question

50% accept rate
feedback

2 Answers

up vote 1 down vote accepted

Your kernel-panic bug is fixed in 3.1.10, 3.2.2, and 3.3.-rc1.

It only affects arrays in which all devices are 'write-mostly'.

You can set a device to be write mostly with e.g.

echo writemostly > /sys/block/md0/dev-sda1/state

and clear the writemostly status with

echo -writemostly > /sys/block/md0/dev-sd1/state

If you have other questions about mdadm or Linux Software RAID, please post them to linux-raid@vger.kernel.org

(you do not need to be subscribed).

link|improve this answer
feedback

It's been over a week, so to answer my own question:

Apparently you pass it as a command-line argument to mdadm when you create a new RAID array; just take the example in the man page and add --write-mostly. The man page says all devices after it will have write-mostly enabled; this is vague language so I can only assume it means the reasonable thing: that it applies to the next argument.

However I DO NOT recommend trying --write-mostly nor --write-behind, as it triggered a kernal panic (kernel 3.1) in [something...]scsi.c during some critical step, and destroyed my RAID array.

Also if you are splitting your array, make sure you know what you're doing. I found that my array had new UUIDs (possibly due to a new major metadata version) and was unsure how to proceed.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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