mdadm/tests/01r1fail
NeilBrown 8453e70430 Manage: be more careful about --add attempts.
If an --add is requested and a re-add looks promising but fails or
cannot possibly succeed, then don't try the add.  This avoids
inadvertently turning devices into spares when an array is failed but
the devices seem to actually work.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-22 19:35:25 +11:00

30 lines
612 B
Plaintext

# create a raid1, fail and remove a drive during initial sync
# Add two more, fail and remove one
# wait for sync to complete, fail, remove, re-add
mdadm -CR $md0 -l1 -n4 $dev0 $dev1 $dev2 missing
check resync
mdadm $md0 --fail $dev2
check resync
mdadm $md0 --fail $dev1
sleep 1
check nosync
check state U___
mdadm $md0 --add $dev4 $dev3
check recovery
# there could be two separate recoveries, one for each dev
check wait
check wait
mdadm $md0 --remove $dev2 $dev1
check nosync
check state UUU_
mdadm --zero-superblock $dev2
mdadm $md0 -a $dev2
check recovery
check wait
check state UUUU
mdadm -S $md0