]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | # | |
3 | # test interrupting and restarting raid5 reshape. | |
4 | set -x | |
5 | devs="$dev1" | |
6 | st=UU | |
7 | for disks in 2 3 4 5 | |
8 | do | |
9 | eval devs=\"$devs \$dev$disks\" | |
10 | st=U$st | |
11 | for d in $devs | |
12 | do dd if=/dev/urandom of=$d bs=1024 || true | |
13 | done | |
14 | ||
15 | case $disks in | |
16 | 2 | 3) chunk=1024;; | |
17 | 4 ) chunk=512;; | |
18 | 5 ) chunk=256;; | |
19 | esac | |
20 | ||
21 | mdadm -CR $md0 -amd -l5 -c $chunk -n$disks --assume-clean $devs | |
22 | mdadm $md0 --add $dev6 | |
23 | echo 20 > /proc/sys/dev/raid/speed_limit_max | |
24 | mdadm --grow $md0 -n $[disks+1] | |
25 | check reshape | |
26 | check state $st | |
27 | mdadm --stop $md0 | |
28 | mdadm --assemble $md0 $devs $dev6 | |
29 | check reshape | |
30 | echo 2000 > /proc/sys/dev/raid/speed_limit_max | |
31 | check wait | |
32 | echo check > /sys/block/md0/md/sync_action | |
33 | check wait | |
34 | mm=`cat /sys/block/md0/md/mismatch_cnt` | |
35 | if [ $mm -gt 0 ] | |
36 | then echo >&2 "ERROR mismatch_cnt non-zero : $mm" ; exit 1 | |
37 | fi | |
38 | mdadm -S $md0 | |
39 | done |