[PATCH 1/3] Handle v0.90 md metadata in preexisting arrays.

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

 



mdadm --examine doesn't output metadata version for 0.90 superblocks
to preserve backwards compatibility so if no metadata version is
indicated we must assume 0.90.
---
 pyanaconda/storage/devices.py    |    2 +-
 pyanaconda/storage/devicetree.py |    5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 15c3e49..b8f8223 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -2731,7 +2731,7 @@ class MDRaidArrayDevice(StorageDevice):
         self.chunkSize = 512.0 / 1024.0         # chunk size in MB
         self.superBlockSize = 2.0               # superblock size in MB
 
-        if not isinstance(metadataVersion, str):
+        if not self.exists and not isinstance(metadataVersion, str):
             self.metadataVersion = "default"
         else:
             self.metadataVersion = metadataVersion
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 7b411e6..265ba89 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -1397,6 +1397,7 @@ class DeviceTree(object):
                 return
 
             md_name = None
+            md_metadata = None
             minor = None
 
             # check the list of devices udev knows about to see if the array
@@ -1417,10 +1418,12 @@ class DeviceTree(object):
                 if dev_uuid == md_uuid and dev_level == md_level:
                     md_name = udev_device_get_name(dev)
                     minor = udev_device_get_minor(dev)
+                    md_metadata = dev.get("MD_METADATA")
                     break
 
             md_info = devicelibs.mdraid.mdexamine(device.path)
-            md_metadata = md_info.get("metadata")
+            if not md_metadata:
+                md_metadata = md_info.get("metadata", "0.90")
 
             if not md_name:
                 # try to name the array based on the preferred minor
-- 
1.7.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