Hans de Goede wrote:
Can you explain the second hunk of this patch please?
Why the change ?
The problem is with starting isw array, which don't have all members,
so I've commented md_array.setup()
If anaconda find first disk as mdmember, it'll create MDRaidArrayDevice
with name of container and then using mdraid.mdadd_no_degraded will add disk to array
using for example command:
mdadm --incremental --auto=md --no-degraded /dev/sdb
This command create container /dev/md/imsm0 (/dev/md127) with one disk.
When the next disk is founded for the same array it'll be added to md_array using
md_array._addDevice(device), and this function will call mdraid.mdadd(device.path)
For example:
mdadm --incremental --auto=md /dev/sdc
This command add disk to container /dev/md/imsm0 and start array /dev/md126
I've tested this on raid1 with isw format and native format, and raid1 was created and activated correctly.
Also can you please prefix your patches with:
1 A single line briefly describing the patch
2 (after an empty line) a longer more detailed
explanation
On 04/08/2009 03:14 PM, Jacek Danecki wrote:
activate mdmember
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 7383547..e4cab60 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1297,14 +1297,23 @@ class DeviceTree(object):
return
# find the first unused minor
- minor = 0
- while True:
- if self.getDeviceByName("md%d" % minor):
- minor += 1
- else:
- break
+ if md_level == "container":
+ minor = 0
+ while True:
+ if self.getDeviceByName("imsm%d" % minor):
+ minor += 1
+ else:
+ break
+ md_name = "imsm%d" % minor
+ else:
+ minor = 0
+ while True:
+ if self.getDeviceByName("md%d" % minor):
+ minor += 1
+ else:
+ break
+ md_name = "md%d" % minor
- md_name = "md%d" % minor
md_array = MDRaidArrayDevice(md_name,
level=md_level,
minor=minor,
@@ -1313,12 +1322,19 @@ class DeviceTree(object):
sysfsPath=sysfs_path,
exists=True,
parents=[device])
- try:
- md_array.setup()
- except (DeviceError, MDRaidError) as e:
- log.info("setup of md array %s failed: %s"
- % (md_array.name, e))
+# try:
+# md_array.setup()
+# except (DeviceError, MDRaidError) as e:
+# log.info("setup of md array %s failed: %s"
+# % (md_array.name, e))
self._addDevice(md_array)
+ try: + # FIXME: this should be mdraid.mdadd with parameter + #
no_degraded parameter depends on which member is added
+ # it was tested only for isw raid 1 array with 2 disks
+ mdraid.mdadd_no_degraded(device.path)
+ except MDRaidError as e:
+ log.warning("failed to add member to md array %s" % e)
def handleUdevDMRaidMemberFormat(self, info, device):
log_method_call(self, name=device.name, type=device.format.type)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list