]> git.ipfire.org Git - thirdparty/mdadm.git/blob - tests/05r1-re-add-nosuper
--wait or -W will wait for resync activity to finish on the given devices.
[thirdparty/mdadm.git] / tests / 05r1-re-add-nosuper
1
2 #
3 # create a raid1, remove a drive, and readd it.
4 # resync should be instant.
5 # Then do some IO first. Resync should still be very fast
6 #
7 bmf=$targetdir/bitmap2
8 rm -f $bmf
9 mdadm -B $md0 -l1 -n2 -b$bmf -d1 $dev1 $dev2
10 check resync
11 check wait
12 testdev $md0 1 $size 1
13 sleep 4
14
15 mdadm $md0 -f $dev2
16 sleep 1
17 mdadm $md0 -r $dev2
18 mdadm $md0 --re-add $dev2
19 check nosync
20
21 mdadm $md0 -f $dev2
22 sleep 1
23 mdadm $md0 -r $dev2
24 testdev $md0 1 $size 1
25 mdadm $md0 --re-add $dev2
26 check wait
27 cmp --bytes=$[$mdsize0*1024] $dev1 $dev2
28
29 mdadm $md0 -f $dev2; sleep 1
30 mdadm $md0 -r $dev2
31 if dd if=/dev/zero of=$md0 ; then : ; fi
32 mdadm $md0 --re-add $dev2
33 check recovery
34 check wait
35 # should BLKFLSBUF and then read $dev1/$dev2...
36 cmp --bytes=$[$mdsize0*1024] $file1 $file2
37 mdadm -S $md0