summaryrefslogtreecommitdiffstats
path: root/tests/01r5integ
blob: 714a57fbcb7462f1245f2b99e0f8ea2fbb52b6c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Check integrity of raid5 in degraded mode
# Create a 4 disk raid5, create a filesystem and
# sh1sum it with each device failed

for layout in ls rs la ra
do
  mdadm -CR $md0 -l5 --layout $layout -n4 $dev0 $dev1 $dev2 $dev3
  check wait
  tar cf - /etc > $md0
  sum=`sha1sum $md0`

  for i in $dev0 $dev1 $dev2 $dev3
  do
    mdadm $md0 -f $i
    mdadm $md0 -r $i
    blockdev --flushbufs $md0
    sum1=`sha1sum $md0`
    if [ $sum != $sum1 ]
    then
     echo $sum does not matc $sum1 with $i missing
     exit 1
    fi
    mdadm $md0 -a $i
   check wait
  done
  mdadm -S $md0
done