Bug 43908 - md1 and md10 can't co-exist
Summary: md1 and md10 can't co-exist
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: raidtools
Version: 7.1
Hardware: i686
OS: Linux
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-06-07 21:33 UTC by Alexandre Oliva
Modified: 2007-04-18 16:33 UTC (History)
2 users (show)

Clone Of:
Last Closed: 2003-09-02 21:47:37 UTC

Attachments (Terms of Use)
Here is the patch to fix references to cfg (this includes the md10 vs md1 fix) (3.03 KB, patch)
2002-08-31 00:23 UTC, Nate Faerber
no flags Details | Diff
here is better fix to the cfg reference problem (includes md10 vs md1 fix) (3.04 KB, patch)
2002-09-03 16:28 UTC, Nate Faerber
no flags Details | Diff

Description Alexandre Oliva 2001-06-07 21:33:56 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.2-2 i686; en-US; rv:0.9)

Description of problem:
I had configured 12 RAID devices on a machine at installation time.  I had
set up / as /dev/md10 and /l as /dev/md11, and then 10 other RAID/ext2
partitions /l/md[0-9] as /dev/md[0-9].
Installation went fine, except that /l/md1 couldn't be created.
After installation, I tried to create it by hand, to no avail.  mkraid
/dev/md1 would say the raid device was active, but it didn't appear in
/proc/mdstat and raidstop wouldn't stop it.
As soon as I replaced /dev/md1 with /dev/md12 in /etc/raidtab, I could
create the device and everythign was fine.
My guess is that the existence of a /dev/md10, started before /dev/md1
because md10 contains the root device, causes /dev/md1 to not work
correctly, because md1 is a prefix of md10.

How reproducible:
Didn't try

Steps to Reproduce:
1.Install the root filesystem in /dev/md10
2.Try to set up another RAID device named /dev/md1

Actual Results:  mkraid and raidstop won't work.

Expected Results:  It should work just fine.

Additional info:

Comment 1 giulioo 2001-06-09 09:26:16 UTC
I have the same problem on a rh6.x system with rh6x raidtools-0.90-13.
Temporary workaround is to comment out from /etc/raidtab the device that 
confuses raidtools. This bug is very similar to bug #10111, which was about 
parsing of /etc/mtab.

For RedHat:
if you update the rpm for rh71, will it be compatible, unofficially, for rh6x 
too (ie: can we rebuild src.rpm and use it)? I see in the changelog "updated to 
support multipath in 2.4.2 kernel" is this something that may cause problems on 

Comment 2 Chip Christian 2001-08-07 16:27:10 UTC
This is because mkraid/raidstop pass "md1" to strstr.  Call it with "md1 " for
an easy fix.

Comment 3 Elliot Lee 2001-09-20 23:22:41 UTC
Given that the release in rawhide is raidtools-0.90-23, can you confirm that the
behaviour still exists with that version?

Comment 4 Nate Faerber 2002-08-31 00:18:55 UTC
This bug exists in the most recent rawhide raidtools-1.00.2-3.3.  That means 7.2
through 8.0 is affected including Advanced Server.

To reproduce, just create a raidtab with md10 and md1 defined then:
mkraid /dev/md10
mkraid /dev/md1

You will get an error telling you to run 'raidstop' on /dev/md1.  A simple patch

--- raid_io.c.old       Wed Aug 28 15:55:15 2002
+++ raid_io.c   Wed Aug 28 15:59:20 2002
@@ -523,6 +523,7 @@
        if ((ch = strstr(p->md_name, "/md")) == NULL)
                return 0;
        strcpy(buffer, ch+1);
+       strcpy(buffer, strcat(buffer, " "));
        if ((fp = fopen("/proc/mdstat", "r")) == NULL)
                return 0;
        while (1) {

Comment 5 Nate Faerber 2002-08-31 00:21:28 UTC
More bugs in raidtools:

We had a system in which check_active was confusing md8 with md11 in our config.

There are several errors in the code related to a global variable named 'cfg'
that is almost always local to a function.  This patch fixes that so it's local
everywhere.  More importantly, it fixes the call to check_active that wasn't
checking the correct metadevice data structure leading to md8 being confused
with md11...

Comment 6 Nate Faerber 2002-08-31 00:23:32 UTC
Created attachment 74127 [details]
Here is the patch to fix references to cfg (this includes the md10 vs md1 fix)

Comment 7 Nate Faerber 2002-09-03 16:28:36 UTC
Created attachment 74704 [details]
here is better fix to the cfg reference problem (includes md10 vs md1 fix)

Comment 8 Alexandre Oliva 2003-09-02 21:47:37 UTC
I've finally managed to get a system set up in which I could test that the fix
does indeed work.  Thanks!

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