Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 43908 - md1 and md10 can't co-exist
md1 and md10 can't co-exist
Product: Red Hat Linux
Classification: Retired
Component: raidtools (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Arjan van de Ven
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-06-07 17:33 EDT by Alexandre Oliva
Modified: 2007-04-18 12:33 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-09-02 17:47:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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-30 20:23 EDT, 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 12:28 EDT, Nate Faerber
no flags Details | Diff

  None (edit)
Description Alexandre Oliva 2001-06-07 17:33:56 EDT
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 05:26:16 EDT
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 12:27:10 EDT
This is because mkraid/raidstop pass "md1" to strstr.  Call it with "md1 " for
an easy fix.
Comment 3 Elliot Lee 2001-09-20 19:22:41 EDT
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-30 20:18:55 EDT
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-30 20:21:28 EDT
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-30 20:23:32 EDT
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 12:28:36 EDT
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 17:47:37 EDT
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.