Skip to contentSkip to conversation

raid1 faulty disk --> hot adding

DISCUSSION Raz Ben-Jehuda(caro) 2 participants 3 messages Jun 9, 2005 – Jun 10, 2005 MD RAID

lore
Share & tools
lore
#0 lore raw

Hello guys.
I tried to to raidhotadd a faulty disk to a mirror and it failed saying that "bd_claim failed on..."
i took a dive into the code and it seems that when a disk in the raid fails the bd_holder fileld in
the block_device struct remained with the old value although the disk was faulty.
So the logical thing to do was to set rdev->bdev->bd_holder to 0x00 . I did it in the error() routine in raid1.c .
This way I manage to hotadd a disk.
Are there anyone here that can point his view regarding this matter ? --
Raz
Long Live the Penguin

#1 lore raw
Quoted 11 lines · On Friday June 10, [email protected] wrote:

Hello guys.
I tried to to raidhotadd a faulty disk to a mirror and it failed saying that "bd_claim failed on..."
i took a dive into the code and it seems that when a disk in the raid fails the bd_holder fileld in
the block_device struct remained with the old value although the disk was faulty.
So the logical thing to do was to set rdev->bdev->bd_holder to 0x00 . I did it in the error() routine in raid1.c .
This way I manage to hotadd a disk.
Are there anyone here that can point his view regarding this matter ?

If a drive fails, and you want to re-add it, what you should do is first remove it, and then add it.
raidhotremove /dev/mdX /dev/sdY
raidhotadd /dev/mdX /dev/sdY

(or equivalent mdadm commands).

clearing bd_holder is certainly not the right thing to do.

NeilBrown

#2 lore raw

Yes. my mistake.
I tried it with two ramdisks and I made some stupid mistake.

thanks Neil

Quoted 25 lines · Neil Brown
Quoted 11 lines · On Friday June 10, [email protected] wrote:

Hello guys.
I tried to to raidhotadd a faulty disk to a mirror and it failed saying that "bd_claim failed on..."
i took a dive into the code and it seems that when a disk in the raid fails the bd_holder fileld in
the block_device struct remained with the old value although the disk was faulty.
So the logical thing to do was to set rdev->bdev->bd_holder to 0x00 . I did it in the error() routine in raid1.c .
This way I manage to hotadd a disk.
Are there anyone here that can point his view regarding this matter ?

If a drive fails, and you want to re-add it, what you should do is first remove it, and then add it.
raidhotremove /dev/mdX /dev/sdY
raidhotadd /dev/mdX /dev/sdY

(or equivalent mdadm commands).

clearing bd_holder is certainly not the right thing to do.

NeilBrown

Signature · 2 lines
Raz
Long Live the Penguin