Re: Upgrading Raid1 array to have 2. disks.

3 messages, 3 authors, 2003-05-20 · open the first message on its own page

Re: Upgrading Raid1 array to have 2. disks.

From: Neil Brown <hidden>
Date: 2003-05-07 00:00:49

On Wednesday May 7, afu@fugmann.dhs.org wrote:
Hi,

Sorry if this is the wrong list to post this on.

I have made an error when creating a new raid1 array as I specified that
the raid should consist of only one disk. Now, I would like to add 
another disk, but mdadm insists on adding it as a spare disk, offering 
no data redundancy.

Before:
md0 : active raid1 ide/host0/bus0/target0/lun0/part1[0]
       1048704 blocks [1/1] [U]

After running
# mdadm -add /dev/md/0
     /dev/ide/host0/bus0/target0/lun0/part1[0]

md0 : active raid1 ide/host0/bus1/target0/lun0/part1[1] 
ide/host0/bus0/target0/lun0/part1[0]
       1048704 blocks [1/1] [U]


I have read the manpages, and tried googling without success.
I do not wish to destroy the data on the discs, and recreate the array 
but It might be a last resort. Can anyone help me convince mdadm to add 
the 2. partition as an active disk.
You cannot add a new data drive to a raid1 array.
If you shut down the array and re-create it you should not loose data.
The correct command to use would be something like:
  mdadm --create /dev/md0 --level=1 -n 2 /dev/ide/host0/bus0/target0/lun0/part1 missing

Note the word "missing" at the end.  This tells mdadm to create a
2-drive array with one missing drive (and so only one active drive).
This will have the same data as the old md0.
Now "mdadm --add" should do what you want.

NeilBrown

Regards
Anders Fugmann

P.s.
Please CC me, as I'm not subscribed to the list.


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

Re: Upgrading Raid1 array to have 2. disks.

From: Anders Fugmann <hidden>
Date: 2003-05-08 19:11:21

Neil Brown wrote:
You cannot add a new data drive to a raid1 array.
If you shut down the array and re-create it you should not loose data.
The correct command to use would be something like:
  mdadm --create /dev/md0 --level=1 -n 2 /dev/ide/host0/bus0/target0/lun0/part1 missing

Note the word "missing" at the end.  This tells mdadm to create a
2-drive array with one missing drive (and so only one active drive).
This will have the same data as the old md0.
Now "mdadm --add" should do what you want.
Thanks for the replies.
The method above worked like a charm. The data on the array even surived 
the operation.
NeilBrown
Regards
Anders Fugmann

raid5, 2 drives dead at same time,kernel will Oops?

From: 3tcdgwg3 <hidden>
Date: 2003-05-20 00:33:57

Hi,

I am trying to simulate a case that two drives
in an array fail ad same time.
I use two ide drives, I try to create a 
raid 5 array with 4 arms, created as following:

/dev/hdc1
/dev/hde1
/dev/hdc2
/dev/hde2

This is just for test, I know create two arms on
one hard drive doesn't make much sense.


Anyway, when I run this array, if I power off one
of hard drive (/dev/hde) to simulate two arms failing 
at same  time in an array, I got system Oops. I am using
2.4-18 kernel.

Anyone can tell me if this is normal? or if there is a fix for this?

Thanks in advance.

Here are the output:

=================================
hde: drive not ready for command

md: updating md0 RAID superblock on device

md: (skipping faulty hde2 )

md: hdc2 [events: 00000002]<6>(write) hdc2's sb offset: 3469952

md: (skipping faulty hde1 )

md: hdc1 [events: 00000002]<6>(write) hdc1's sb offset: 16064896

md0: no spare disk to reconstruct array! -- continuing in degraded mode

md: recovery thread finished ...

md: recovery thread got woken up ...

md0: no spare disk to reconstruct array! -- continuing in degraded mode

md: recovery thread finished ...

sector=561a8 i=0 00000000 00000000 8132e840 0

kernel BUG at raid5.c:309!

kupdated(7): Oops

================================================

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help