Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have linux software raid (RAID10),

md2 : active raid10 sda6[4](F) sdd5[3] sdc5[2] sdb6[1]
  390620160 blocks 64K chunks 2 near-copies [4/3] [_UUU]

which has degraded state. Can i start recovery operation without removing and adding back failed item of array?

I have already tryed to start the resync operation,

echo 'repair' >/sys/block/md2/md/sync_action

but it has no effect…

I have read in docs, that

echo 'recover' >/sys/block/md2/md/sync_action

do replace failed item of array with the hot spare disk. But what does it do, if i have not hotspare partition for this array?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Unfortunately you will need to 'remove' and add the failed drive back to the array. this can be done without actually removing the drive from the system and will rebuild the array from the same partition.

It looks like /dev/sda6 is the failed partition. the following command should remove it, add it back as spare and allow the system to rebuild.

mdadm --manage /dev/md0 -f /dev/sda6 -r /dev/sda6 -a /dev/sda6

in sequence -f(ail) -r(emove) -a(dd)

share|improve this answer
    
Is this operation safe? Should i stop my services, which use this md partition? –  hraphrap Dec 22 '11 at 10:47
    
"Playing around" with raid is never 100% safe, however this should be a non-interruptive action and can be done while services are running. –  Flash Dec 22 '11 at 10:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.