diff options
author | Neil Brown <neilb@suse.de> | 2005-09-12 05:23:11 +0000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2005-09-12 05:23:11 +0000 |
commit | 308e1801baa05edbcfda6e8054fdf90727581c62 (patch) | |
tree | 5793bfc567206cc898a1fb9cf5812275038fffcc /tests | |
parent | 265e0f17317e6d23864263c04ae581b35f946b5e (diff) | |
download | mdadm-308e1801baa05edbcfda6e8054fdf90727581c62.tar.gz mdadm-308e1801baa05edbcfda6e8054fdf90727581c62.tar.xz mdadm-308e1801baa05edbcfda6e8054fdf90727581c62.zip |
Fix assembling of array with spares when verion-1 superblock is used.
As spared don't have a position in the raid array with verion-1 superblocks,
we need to handle them a bit differently.
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/03r5assemV1 | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/tests/03r5assemV1 b/tests/03r5assemV1 index 7c72ad6..7df277e 100644 --- a/tests/03r5assemV1 +++ b/tests/03r5assemV1 @@ -1,109 +1,116 @@ # create a v-1 raid5 array and assemble in various ways -mdadm -CR -e1 --name one $md1 -l5 -n3 $dev0 $dev1 $dev2 +mdadm -CR -e1 --name one $md1 -l5 -n3 -x2 $dev0 $dev1 $dev2 $dev3 $dev4 tst="check raid5 ;testdev $md1 2 $mdsize1 64 ; mdadm -S $md1" uuid=`mdadm -Db $md1 | sed 's/.*UUID=//'` check wait eval $tst -mdadm -A $md1 $dev0 $dev1 $dev2 +mdadm -A $md1 $dev0 $dev1 $dev2 +mdadm $md1 --add $dev3 $dev4 +check spares 2 eval $tst -mdadm -A $md1 -u $uuid $devlist +mdadm -A $md1 -u $uuid $devlist +check spares 2 eval $tst -mdadm -A $md1 --name one $devlist +mdadm -A $md1 --name one $devlist +check spares 2 eval $tst conf=$targetdir/mdadm.conf -{ +{ echo DEVICE $devlist echo array $md1 UUID=$uuid } > $conf -mdadm -As -c $conf $md1 +mdadm -As -c $conf $md1 eval $tst -{ +{ echo DEVICE $devlist echo array $md1 name=one } > $conf -mdadm -As -c $conf +mdadm -As -c $conf eval $tst -{ +{ echo DEVICE $devlist - echo array $md1 devices=$dev0,$dev1,$dev2 + echo array $md1 devices=$dev0,$dev1,$dev2,$dev3,$dev4 } > $conf -mdadm -As -c $conf +mdadm -As -c $conf echo "DEVICE $devlist" > $conf mdadm -Db $md1 >> $conf eval $tst -mdadm --assemble --scan --config=$conf $md1 +mdadm --assemble --scan --config=$conf $md1 eval $tst +echo PING >&2 -echo " metadata=1.0 devices=$dev0,$dev1,$dev2" >> $conf -mdadm --assemble --scan --config=$conf $md1 +echo " metadata=1.0 devices=$dev0,$dev1,$dev2,$dev3,$dev4" >> $conf +mdadm --assemble --scan --config=$conf $md1 eval $tst ### Now with a missing device -mdadm -AR $md1 $dev0 $dev2 # +mdadm -AR $md1 $dev0 $dev2 $dev3 $dev4 # check state U_U +check spares 1 eval $tst -mdadm -A $md1 -u $uuid $devlist +mdadm -A $md1 -u $uuid $devlist check state U_U eval $tst -mdadm -A $md1 --name=one $devlist +mdadm -A $md1 --name=one $devlist check state U_U +check spares 1 eval $tst conf=$targetdir/mdadm.conf -{ +{ echo DEVICE $devlist echo array $md1 UUID=$uuid } > $conf -mdadm -As -c $conf $md1 +mdadm -As -c $conf $md1 check state U_U eval $tst -{ +{ echo DEVICE $devlist echo array $md1 name=one } > $conf -mdadm -As -c $conf +mdadm -As -c $conf check state U_U eval $tst -{ +{ echo DEVICE $devlist echo array $md1 devices=$dev0,$dev1,$dev2 } > $conf -mdadm -As -c $conf +mdadm -As -c $conf echo "DEVICE $devlist" > $conf mdadm -Db $md1 >> $conf check state U_U eval $tst -mdadm --assemble --scan --config=$conf $md1 +mdadm --assemble --scan --config=$conf $md1 check state U_U eval $tst echo " metadata=1.0 devices=$dev0,$dev1,$dev2" >> $conf -mdadm --assemble --scan --config=$conf $md1 +mdadm --assemble --scan --config=$conf $md1 check state U_U eval $tst |