Skip to contentSkip to conversation

create raid5 with missing disk; not possible?

DISCUSSION Ferenc-Jan 3 participants 6 messages Jan 14, 2005 MD RAID

lore
Share & tools
lore

Ferenc-Jan

author
#0 lore raw

Hello,

I tried to create a raid5 set with 3 partitions and one missing device:

mdadm -C /dev/md1 -R -l5 -n4 /dev/hda3 /dev/hdc3 /dev/hdd3 missing

Later I want to add the fourth device with mdadm /dev/md1 -a /dev/hdb3. But this becomes a spare and I always end up with the missing drive in sync, mdadm -D /dev/md1:

<snip>
3 0 0 0 sync

I want to do this so I can use hdb to transfer data from an harddisk to the raid5 set. Maybe this is only possible with Raid 1 sets?

cheers

Ferenc

#1 lore raw

It should work!

I used your example, and everything worked as expected. mdadm -C /dev/md3 -R -l5 -n4 /dev/ram0 /dev/ram1 /dev/ram2 missing

From mdadm -D /dev/md3:
Number Major Minor RaidDevice State
0 1 0 0 active sync /dev/ram0
1 1 1 1 active sync /dev/ram1
2 1 2 2 active sync /dev/ram2
3 0 0 3 faulty

mdadm /dev/md3 -a /dev/ram3

From mdadm -D /dev/md3:
Number Major Minor RaidDevice State
0 1 0 0 active sync /dev/ram0
1 1 1 1 active sync /dev/ram1
2 1 2 2 active sync /dev/ram2
3 0 0 3 faulty

4 1 3 4 spare rebuilding /dev/ram3

From cat /proc/mdatat:
md3 : active raid5 [dev 01:03][4] [dev 01:02][2] [dev 01:01][1] [dev 01:00][0]

      12096 blocks level 5, 64k chunk, algorithm 2 [4/3] [UUU_]
      [>....................]  recovery =  0.0% (620/4032) finish=8.5min

speed=4K/sec

To slow things down I had run these 2 commands:
echo 1 > /proc/sys/dev/raid/speed_limit_min
echo 2 > /proc/sys/dev/raid/speed_limit_max

Otherwise, the re-sync would complete before I had a chance to type the next command!

Once the re-sync was done, this is the outout from mdadm -D /dev/md3:
Number Major Minor RaidDevice State
0 1 0 0 active sync /dev/ram0
1 1 1 1 active sync /dev/ram1
2 1 2 2 active sync /dev/ram2
3 1 3 3 active sync /dev/ram3

I also tried without the "-R":
mdadm -C /dev/md3 -l5 -n4 /dev/ram0 /dev/ram1 /dev/ram2 missing I had the same results with or without "-R".

I have Kernel 2.4.28 and mdadm 1.8.0.

Guy

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ferenc-Jan
Sent: Friday, January 14, 2005 3:35 PM
To: [email protected]
Subject: create raid5 with missing disk; not possible?

Hello,

I tried to create a raid5 set with 3 partitions and one missing device:

mdadm -C /dev/md1 -R -l5 -n4 /dev/hda3 /dev/hdc3 /dev/hdd3 missing

Later I want to add the fourth device with mdadm /dev/md1 -a /dev/hdb3. But this becomes a spare and I always end up with the missing drive in sync, mdadm -D /dev/md1:

<snip>
3 0 0 0 sync

I want to do this so I can use hdb to transfer data from an harddisk to the raid5 set. Maybe this is only possible with Raid 1 sets?

cheers

Ferenc
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw
Quoted 1 line · Guy

It should work!

I certainly hope so! :-)

Quoted 2 lines

I used your example, and everything worked as expected. mdadm -C /dev/md3 -R -l5 -n4 /dev/ram0 /dev/ram1 /dev/ram2 missing

And I used your example, even literally pasted it, but strangely, I get from mdadm -D /dev/md3:

Number Major Minor RaidDevice State
0 1 0 0 active sync /dev/ram0
1 1 1 1 active sync /dev/ram1
2 1 2 2 active sync /dev/ram2
3 0 0 0 sync

This on two different machines even. -R or not did not make a difference. That last line is not good, is it? Mr. Brown wrote that to me a few weeks back.

Using /dev/hd[a,c,d]3 yields the same results (3 0 0 0 sync). I did do mdadm --zero-superblock /dev/hd[a,c,d]3.

And yeah, I know using two drives on one ide channel is a not advisable. But it is supported, isn't it? Anyway,

mdadm -C /dev/md3 -l5 -n3 /dev/hda3 /dev/hdc3 missing

produces (mdadm -D /dev/md3):

Number Major Minor RaidDevice State
0 3 3 0 active sync /dev/hda3
1 22 3 1 active sync /dev/hdc3
2 0 0 0 sync

This is mdadm - v1.8.1 - 05 November 2004, slackware linux 9.1 kernel 2.4.22, run-of-the-mill 40gb harddisks on a 666mhz p-III. That MHz number might be an omen.

Thanks for the swift replies.

cheers

Ferenc

#3 lore raw
Quoted 8 lines · Ferenc-Jan
Quoted 1 line · Guy

It should work!

I certainly hope so! :-)

And yeah, I know using two drives on one ide channel is a not advisable. But it is supported, isn't it? Anyway,

Of course it is. Nobody is gonna prevent you shooting your own foot. ;)

Quoted 3 lines

This is mdadm - v1.8.1 - 05 November 2004, slackware linux 9.1 kernel 2.4.22, run-of-the-mill 40gb harddisks on a 666mhz p-III. That MHz number might be an omen.

Downgrade to 1.8.0.
1.8.1 is development beta IIRC.

Greetingz from holland
Maarten

#4 lore raw
In reply to Ferenc-Jan

Maybe your mdadm V1.8.1 is an issue!
It is an experimental version.
Try version 1.8.0.

Yes, 2 IDE disks are fine, until one fails!
Then it will be a pain in the @$$.

If 666 scares you, do this to verify your speed. :) grep "CPU clock" /var/log/dmesg

I bet it is closer to 663 MHz. :)

You should trust Mr. Brown! He knows all, well, knows most! :)

I have never seen a "0 0 0 sync" before. It does seem wrong. What does /proc/mdstat have?

Guy

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ferenc-Jan
Sent: Friday, January 14, 2005 5:33 PM
To: Guy; [email protected]
Subject: Re: create raid5 with missing disk; not possible?

Quoted 1 line · Guy

It should work!

I certainly hope so! :-)

Quoted 2 lines

I used your example, and everything worked as expected. mdadm -C /dev/md3 -R -l5 -n4 /dev/ram0 /dev/ram1 /dev/ram2 missing

And I used your example, even literally pasted it, but strangely, I get from mdadm -D /dev/md3:

Number Major Minor RaidDevice State
0 1 0 0 active sync /dev/ram0
1 1 1 1 active sync /dev/ram1
2 1 2 2 active sync /dev/ram2
3 0 0 0 sync

This on two different machines even. -R or not did not make a difference. That last line is not good, is it? Mr. Brown wrote that to me a few weeks back.

Using /dev/hd[a,c,d]3 yields the same results (3 0 0 0 sync). I did do mdadm --zero-superblock /dev/hd[a,c,d]3.

And yeah, I know using two drives on one ide channel is a not advisable. But it is supported, isn't it? Anyway,

mdadm -C /dev/md3 -l5 -n3 /dev/hda3 /dev/hdc3 missing

produces (mdadm -D /dev/md3):

Number Major Minor RaidDevice State
0 3 3 0 active sync /dev/hda3
1 22 3 1 active sync /dev/hdc3
2 0 0 0 sync

This is mdadm - v1.8.1 - 05 November 2004, slackware linux 9.1 kernel 2.4.22, run-of-the-mill 40gb harddisks on a 666mhz p-III. That MHz number might be an omen.

Thanks for the swift replies.

cheers

Ferenc
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to Ferenc-Jan
Quoted 3 lines · Ferenc-Jan

Hello,

I tried to create a raid5 set with 3 partitions and one missing device:

That should work.

Quoted 1 line

mdadm -C /dev/md1 -R -l5 -n4 /dev/hda3 /dev/hdc3 /dev/hdd3 missing

Maybe it's in the syntax. What is that -R doing here ?

Quoted 1 line

Later I want to add the fourth device with mdadm /dev/md1 -a /dev/hdb3.

I do 'mdadm -a /dev/md1 /dev/hdb3'. Maybe that makes a difference ?

Quoted 8 lines

But this becomes a spare and I always end up with the missing drive in sync, mdadm -D /dev/md1:

<snip>
3 0 0 0 sync

I want to do this so I can use hdb to transfer data from an harddisk to the raid5 set. Maybe this is only possible with Raid 1 sets?

No, this should be possible. Many people do this.

P.S.: You _are_ aware of the dangers of using raid-5 on drives that share the same IDE cable ? I see you use hda+hdb and hdc+hdd...
In practise this could mean that if one drive fails you could lose all your data (unless you manually repair / reassemble the array)

(Just making sure you don't make the same mistake I made...)

Maarten