[PATCH] Work around a bug in mdadm incremental assembly.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We write out a temporary mdadm.conf so that mdadm doesn't assign
preexisting arrays bizarre minor numbers like 126.
---
 storage/devices.py    |   11 +++++++++--
 storage/devicetree.py |    4 ++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index 064ebc1..ce23d7d 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2029,6 +2029,9 @@ class MDRaidArrayDevice(StorageDevice):
             raise DeviceError("cannot find class for 'mdmember'")
 
         #self.probe()
+        if self.exists and self.uuid:
+            open("/etc/mdadm.conf", "a").write("ARRAY %s UUID=%s\n"
+                                                % (self.path, self.uuid))
 
     @property
     def size(self):
@@ -2163,9 +2166,13 @@ class MDRaidArrayDevice(StorageDevice):
         self.devices.append(device)
         device.addChild()
 
-        if self.status:
-            device.setup()
+        device.setup()
+        udev_settle(timeout=10)
+        try:
             mdraid.mdadd(device.path)
+        except MDRaidError as e:
+            log.warning("failed to add member %s to md array %s: %s"
+                        % (device.path, self.path, e))
 
     def _removeDevice(self, device):
         """ Remove a component device from the array.
diff --git a/storage/devicetree.py b/storage/devicetree.py
index b1ecaa6..93ac747 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1491,6 +1491,10 @@ class DeviceTree(object):
             self._handleInconsistencies(leaf)
 
         self.teardownAll()
+        try:
+            os.unlink("/etc/mdadm.conf")
+        except OSError:
+            log.info("failed to unlink /etc/mdadm.conf")
 
     def teardownAll(self):
         """ Run teardown methods on all devices. """
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux