raid1 faulty disk --> hot adding
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
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_claimfailed on..."
i took a dive into the code and it seems that when a disk in the raid fails thebd_holderfileld in
theblock_devicestruct remained with the old value although the disk was faulty.
So the logical thing to do was to setrdev->bdev->bd_holderto0x00. I did it in theerror()routine inraid1.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
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_claimfailed on..."
i took a dive into the code and it seems that when a disk in the raid fails thebd_holderfileld in
theblock_devicestruct remained with the old value although the disk was faulty.
So the logical thing to do was to setrdev->bdev->bd_holderto0x00. I did it in theerror()routine inraid1.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_holderis certainly not the right thing to do.NeilBrown
Signature · 2 lines
Raz Long Live the Penguin