]>
Commit | Line | Data |
---|---|---|
8ab2924c N |
1 | |
2 | # Check integrity of raid5 in degraded mode | |
3 | # Create a 4 disk raid5, create a filesystem and | |
ef6e87a7 | 4 | # sha1sum it with each device failed |
8ab2924c | 5 | |
bde085f4 N |
6 | if [ "$INTEGRITY" != "yes" ]; then |
7 | echo -ne 'skipping... ' | |
8 | exit 0 | |
9 | fi | |
10 | ||
8ab2924c N |
11 | for layout in ls rs la ra |
12 | do | |
13 | mdadm -CR $md0 -l5 --layout $layout -n4 $dev0 $dev1 $dev2 $dev3 | |
14 | check wait | |
15 | tar cf - /etc > $md0 | |
16 | sum=`sha1sum $md0` | |
17 | ||
18 | for i in $dev0 $dev1 $dev2 $dev3 | |
19 | do | |
20 | mdadm $md0 -f $i | |
21 | mdadm $md0 -r $i | |
22 | blockdev --flushbufs $md0 | |
23 | sum1=`sha1sum $md0` | |
ef6e87a7 | 24 | if [ "$sum" != "$sum1" ] |
8ab2924c | 25 | then |
ef6e87a7 | 26 | echo $sum does not match $sum1 with $i missing |
8ab2924c N |
27 | exit 1 |
28 | fi | |
29 | mdadm $md0 -a $i | |
e2a8e9dc | 30 | while ! (check state 'U*'); do check wait; sleep 0.2; done |
8ab2924c N |
31 | done |
32 | mdadm -S $md0 | |
33 | done |