Rui Santos wrote:
> James Knott wrote:
>   
>> Rui Santos wrote:
>>     
>>> Rui Santos wrote:
>>>   
>>>       
>>>> James Knott wrote:
>>>>     
>>>>         
>>>>> I've now got SUSE 10.2 set up with RAID and LVM on my server.  However,
>>>>> I don't seem to be able to re-add a "failed" drive, without rebooting. 
>>>>> The drives are hot-swapable.  When I use the command mdadm  /dev/md0/
>>>>> -add /dev/sdxx I get a "device busy" error message.  Even removing the
>>>>> drive with the --remove option, before the add command doesn't help.  I
>>>>> still have to reboot to add the drive.  Is there something I'm missing?
>>>>>       
>>>>>           
>>>> If a drive/partition is marked as "failed", you need to remove it from
>>>> the RAID first with:
>>>>     
>>>>         
>>> Sorry - forgot this:
>>>
>>> mdadm --manage --set-faulty /dev/mdx /dev/sdxx
>>>
>>>   
>>>       
>>>> mdadm --manage --remove /dev/mdx /dev/sdxx
>>>>
>>>> Then you can add it again with:
>>>>
>>>> mdadm --manage --add /dev/mdx /dev/sdxx
>>>>
>>>> Hope it helps.
>>>>
>>>>     
>>>>         
>>>>> tnx jk
>>>>>
>>>>>       
>>>>>           
>>>   
>>>       
>> If I go through the --set-faulty, --fail, --add sequence from the
>> command line, I have no problem adding the drive back.  However, if I
>> simulate a drive failure by pulling the drive, that sequence fails with
>> the error message "mdadm: add new device failed for /dev/sdd2 as 4:
>> Invalid argument".  If I then reboot the computer, I can then use --add
>> to add the drive again.  So, there appears to be some difference between
>> using commands to remove a drive and an actual hardware failure.
>>     
>
> The --set-faulty and --fail options are the same... if you say you can
> execute a --set-faulty, then re-add the device, that is new for me.
>
> About you pulling out a hot-swap device, the device should be considered
> failed at that time. Before you add the drive back into the slot, do you
>  use the --remove option on the already removed drive...at that time it
> should still be a part of the RAID but, in faulty mode. You have to firt
> remove it by issuing 'mdadm --manage --remove /dev/mdx /dev/sdxx'. Have
> you done this?
>
> Only then you're able to plug the device back in and re-add the device.
>
> At least that's how I use it... never tryed on hot-swap though, but the
> --set-faulty is supposed to do just that.
>
> There's one other issue: The kernel driver of the device you use should
> be able to disconnect and re-connect the device cleanly. Check 'dmesg'
> to see if it happens as it should...
>
>
>   

After I unplugged the drive, dmesg shows this.

raid5: Disk failure on sdd2, disabling device. Operation continuing on 3
devices
RAID5 conf printout:
 --- rd:4 wd:3 fd:1
 disk 0, o:1, dev:sda2
 disk 1, o:1, dev:sdb2
 disk 2, o:1, dev:sdc2
 disk 3, o:0, dev:sdd2
RAID5 conf printout:
 --- rd:4 wd:3 fd:1
 disk 0, o:1, dev:sda2
 disk 1, o:1, dev:sdb2
 disk 2, o:1, dev:sdc2
md: unbind<sdd2>
md: export_rdev(sdd2)

At this point, I run the remove option.

Then after reinserting the drive, it shows this, even though the drives
are on B.

scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A
scsi1: Someone reset channel A

Then when adding I get this

netfinity:~ # mdadm --add /dev/md0 /dev/sdd2
mdadm: add new device failed for /dev/sdd2 as 4: Invalid argument

If I now reboot, I'll be able to add the drive, using the same command,
like so.

netfinity:~ # mdadm --add /dev/md0 /dev/sdd2
mdadm: re-added /dev/sdd2


-- 
Use OpenOffice.org <http://www.openoffice.org>
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to