{upstream} madam: no devices found for /dev/md0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mdadm |
New
|
Undecided
|
Unassigned | ||
mdadm (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: mdadm
Attempting to assemble an array using the command:
mdadm -A /dev/md0 /dev/mapper/raid5a /dev/mapper/raid5b /dev/mapper/raid5c
produces the error message:
madam: no devices found for /dev/md0
The problem is that the Assemble routine in Assemble.c silently ignores all devices for which "used" is nonzero. The "used" field is not initialized, so whether or not the used field is non-zero depends on what happens to be in memory. The above error message appears when the "used" fields for all of the arguments are nonzero.
The patch below set the "used" fields to zero before the main loop is entered for the first time, which appears to fix the problem.
*** Assemble.c-orig 2009-07-18 16:09:55.000000000 -0400
--- Assemble.c 2009-07-18 16:31:27.000000000 -0400
***************
*** 184,189 ****
--- 184,198 ----
else if (mdfd >= 0)
inargv = 1;
+ /*
+ * Initially mark all devices as not used.
+ */
+ for (tmpdev = devlist;
+ tmpdev;
+ tmpdev = tmpdev->next) {
+ tmpdev->used = 0;
+ }
+
try_again:
tmpdev = devlist; num_devs = 0;
ProblemType: Bug
Architecture: amd64
Dependencies:
DistroRelease: Ubuntu 9.04
NonfreeKernelMo
Package: mdadm None [modified: /var/lib/
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: mdadm
Uname: Linux 2.6.28.9 x86_64
UnreportableReason: This is not a genuine Ubuntu package
summary: |
- madam: no devices found for /dev/md0 + {upstream} madam: no devices found for /dev/md0 |
Changed in mdadm (Ubuntu): | |
status: | New → Invalid |
Changed in mdadm (Ubuntu): | |
status: | Invalid → New |
tags: | added: patch |
I see that Launchpad changed the indentation in the included patch, but it's short so you can retype it. The version of mdadm I had installed was 2.6.7.1-1ubuntu8; the version number wasn't picked up in the bug report because I uninstalled the mdadm package.