]>
Commit | Line | Data |
---|---|---|
8ab2924c N |
1 | |
2 | # Check integrity of raid6 in degraded modes | |
3 | # Create a 5 disk raid6, dump some data to it, then | |
ef6e87a7 | 4 | # sha1sum it with different pairs of devices failed |
8ab2924c | 5 | |
bde085f4 N |
6 | if [ "$INTEGRITY" != "yes" ]; then |
7 | echo -ne 'skipping... ' | |
8 | exit 0 | |
9 | fi | |
10 | ||
8ab2924c N |
11 | layouts='ls rs la ra' |
12 | lv=`uname -r` | |
13 | if expr $lv '>=' 2.6.30 > /dev/null | |
14 | then | |
ba624124 | 15 | layouts="$layouts parity-first ddf-zero-restart ddf-N-restart ddf-N-continue \ |
8ab2924c N |
16 | left-asymmetric-6 right-asymmetric-6 left-symmetric-6 right-symmetric-6 parity-first-6" |
17 | fi | |
ba624124 | 18 | |
8ab2924c N |
19 | for layout in $layouts |
20 | do | |
21 | mdadm -CR $md0 -l6 --layout $layout -n5 $dev0 $dev1 $dev2 $dev3 $dev4 | |
22 | check wait | |
23 | tar cf - /etc > $md0 | |
24 | sum=`sha1sum $md0` | |
25 | ||
26 | totest= | |
27 | for second in $dev0 $dev1 $dev2 $dev3 $dev4 | |
28 | do | |
29 | mdadm $md0 -f $second | |
30 | mdadm $md0 -r $second | |
31 | blockdev --flushbufs $md0 | |
32 | sum1=`sha1sum $md0` | |
ef6e87a7 | 33 | if [ "$sum" != "$sum1" ] |
8ab2924c | 34 | then |
ef6e87a7 | 35 | echo $sum does not match $sum1 with $second missing |
8ab2924c N |
36 | exit 1 |
37 | fi | |
38 | for first in $totest | |
39 | do | |
40 | mdadm $md0 -f $first | |
41 | mdadm $md0 -r $first | |
42 | blockdev --flushbufs $md0 | |
43 | sum1=`sha1sum $md0` | |
ef6e87a7 | 44 | if [ "$sum" != "$sum1" ] |
8ab2924c | 45 | then |
ef6e87a7 | 46 | echo $sum does not match $sum1 with $first and $second missing |
8ab2924c N |
47 | exit 1 |
48 | fi | |
49 | mdadm $md0 -a $first | |
e2a8e9dc | 50 | while ! (check state 'U*_U*'); do check wait; sleep 0.2; done |
8ab2924c N |
51 | done |
52 | mdadm $md0 -a $second | |
e2a8e9dc | 53 | while ! (check state 'U*'); do check wait; sleep 0.2; done |
8ab2924c N |
54 | totest="$totest $second" |
55 | done | |
56 | mdadm -S $md0 | |
57 | done |