summaryrefslogtreecommitdiffstats
path: root/tests/03r5assem
blob: 0c7fb8c65e1724823d1cc3f486c6060ced24d437 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# create a raid5 array and assemble it in various ways,
# including with missing devices.

mdadm -CR -e 0.90 $md1 -l5 -n3 $dev0 $dev1 $dev2
tst="check raid5 ;testdev $md1 2 $mdsize0 512 ; mdadm -S $md1"
uuid=`mdadm -Db $md1 | sed 's/.*UUID=//'`
check wait
eval $tst

mdadm -A $md1 $dev0 $dev1 $dev2
eval $tst

mdadm -A $md1 -u $uuid $devlist
eval $tst

mdadm -A $md1 -m 1 $devlist
eval $tst


conf=$targetdir/mdadm.conf
{
  echo DEVICE $devlist
  echo array $md1 UUID=$uuid
} > $conf

mdadm -As -c $conf $md1
eval $tst

{
  echo DEVICE $devlist
  echo array $md1 super-minor=1
} > $conf

mdadm -As -c $conf
eval $tst

{
  echo DEVICE $devlist
  echo array $md1 devices=$dev0,$dev1,$dev2
} > $conf

mdadm -As -c $conf

echo "DEVICE $devlist" > $conf
mdadm -Db $md1 >> $conf
eval $tst

mdadm --assemble --scan --config=$conf $md1
eval $tst

echo "  metadata=0.90 devices=$dev0,$dev1,$dev2" >> $conf
mdadm --assemble --scan --config=$conf $md1
eval $tst

### Now with a missing device

mdadm -AR $md1 $dev0 $dev2 #
check state U_U
eval $tst

mdadm -A $md1 -u $uuid $devlist
check state U_U
eval $tst

mdadm -A $md1 -m 1 $devlist
check state U_U
eval $tst


conf=$targetdir/mdadm.conf
{
  echo DEVICE $devlist
  echo array $md1 UUID=$uuid
} > $conf

mdadm -As -c $conf $md1
check state U_U
eval $tst

{
  echo DEVICE $devlist
  echo array $md1 super-minor=1
} > $conf

mdadm -As -c $conf
check state U_U
eval $tst

{
  echo DEVICE $devlist
  echo array $md1 devices=$dev0,$dev1,$dev2
} > $conf

mdadm -As -c $conf

echo "DEVICE $devlist" > $conf
mdadm -Db $md1 >> $conf
check state U_U
eval $tst

mdadm --assemble --scan --config=$conf $md1
check state U_U
eval $tst

echo "  metadata=0.90 devices=$dev0,$dev1,$dev2" >> $conf
mdadm --assemble --scan --config=$conf $md1
check state U_U
eval $tst