Red Hat Bugzilla – Bug 507909
mdadm still has the destructive udev rules file
Last modified: 2009-07-22 18:04:52 EDT
This thread describes how the mdadm udev rules file can be destructive.
Basically, it causes two separate arrays to be loaded, both in degraded mode. This is incredibly dangerous because either one can be loaded as the main array at next boot. There is also the annoyance of spending many hours on a RAID rebuild and the risk of disk failure during rebuild.
The mdadm package in Fedora 11 has removed this destructive file, but it still exists in Fedora 10. Can this please be removed immediately to avoid further data loss?
The mdadm udev incremental file was only part of the problem. The actual issue was a race condition between udev after udev_start in rc.sysinit and the subsequent call to mdadm -As in rc.sysinit. Fixing the udev rules so that they refuse to run during rc.sysinit time solved the problem in F11 and should resolve it here as well.
mdadm-2.6.9-1.fc10 has been submitted as an update for Fedora 10.
By the way, is it ever a good thing to have udev automatically assemble arrays incrementally? Doesn't that always make degraded arrays? Thanks.
No. Incremental assembly produces an auto-read-only array once it reaches enough devices to assemble the array in degraded mode when incremental assembly is performed with the --run option. In this state, it will switch to normal read-write only if a write is performed on the array prior to the remaining drives being added. As the remaining drives are typically already in udev's queue of events to be processed, they come in rather quickly. Once all the drives are in the array, it transitions to read-write without ever entering a degraded state.
However, since I modified the incremental assembly rules to only be run outside of rc.sysinit, I was able to leave running of degraded arrays to specifically rc.sysinit only. In other words, the initrd will start the root array (if it exists) with the --run option because you need it to start whether it's degraded or not or else the system doesn't boot. The call to mdadm -A in rc.sysinit also runs arrays even if they are degraded because they might be referenced in /etc/fstab. The udev rules don't start working until after rc.sysinit has completed and all local filesystems referenced in /etc/fstab have been checked, so I removed the --run option from the udev incremental assembly command which causes us to never start an array until all devices are present when auto assembling arrays via udev.
Sounds great. I assume you've made the change for Fedora 11, too.
mdadm-2.6.9-1.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
su -c 'yum --enablerepo=updates-testing update mdadm'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-7263
mdadm-2.6.9-1.fc10 has been pushed to the Fedora 10 stable repository. If problems still persist, please make note of it in this bug report.