Bug 507909 - mdadm still has the destructive udev rules file
mdadm still has the destructive udev rules file
Product: Fedora
Classification: Fedora
Component: mdadm (Show other bugs)
All Linux
low Severity urgent
: ---
: ---
Assigned To: Doug Ledford
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-06-24 13:15 EDT by Andrew McNabb
Modified: 2009-07-22 18:04 EDT (History)
1 user (show)

See Also:
Fixed In Version: 2.6.9-1.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-07-22 18:04:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andrew McNabb 2009-06-24 13:15:01 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?
Comment 1 Doug Ledford 2009-06-29 16:17:26 EDT
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.
Comment 2 Fedora Update System 2009-06-29 16:21:22 EDT
mdadm-2.6.9-1.fc10 has been submitted as an update for Fedora 10.
Comment 3 Andrew McNabb 2009-06-29 16:25:37 EDT
By the way, is it ever a good thing to have udev automatically assemble arrays incrementally?  Doesn't that always make degraded arrays?  Thanks.
Comment 4 Doug Ledford 2009-06-30 10:37:24 EDT
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.
Comment 5 Andrew McNabb 2009-06-30 12:45:52 EDT
Sounds great.  I assume you've made the change for Fedora 11, too.

Thank you!
Comment 6 Fedora Update System 2009-07-02 01:51:57 EDT
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
Comment 7 Fedora Update System 2009-07-22 18:04:31 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.