blob: f384f0ea4185b73b7b65430fed543d990539bcde (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#
# create a raid1 with a bitmap file
#
bmf=$targetdir/bitmap
rm -f $bmf
mdadm --create --run $md0 --level=1 -n2 --delay=1 --bitmap $bmf $dev1 $dev2
check wait
testdev $md0 1 $mdsize1a 64
mdadm -S $md0
mdadm --assemble $md0 --bitmap=$bmf $dev1 $dev2
testdev $md0 1 $mdsize1a 64
dirty1=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
sleep 4
dirty2=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
if [ $dirty1 -lt 400 -o $dirty2 -ne 0 ]
then echo >&2 "ERROR bad 'dirty' counts: $dirty1 and $dirty2"
exit 1
fi
mdadm $md0 -f $dev1
testdev $md0 1 $mdsize1a 64
sleep 4
dirty3=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
if [ $dirty3 -lt 400 ]
then
echo >&2 "ERROR dirty count $dirty3 is too small"
exit 2
fi
mdadm -S $md0
mdadm --assemble -R $md0 --bitmap=$bmf $dev2
dirty4=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
mdadm --zero $dev1 # force --add, not --re-add
mdadm $md0 --add $dev1
#it is too fast# check recovery
check wait
sleep 4
dirty5=`mdadm -X $bmf | sed -n -e 's/.*Bitmap.* \([0-9]*\) dirty.*/\1/p'`
if [ $dirty4 -lt 400 -o $dirty5 -ne 0 ]
then echo echo >&2 "ERROR bad 'dirty' counts at end: $dirty4 $dirty5"
exit 1
fi
mdadm -S $md0
|