summaryrefslogtreecommitdiff
path: root/tests/03r0assem
blob: 10e2a666ad8d6820a854ef2288eea7677df67602 (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

# create a raid0 array from 3 devices, and assemble it in a multitude of ways.
# explicitly list devices
# uuid, md-minor on command line with wildcard devices
# mdadm.conf file

mdadm -CR $md2 -l0 -n3 $dev0 $dev1 $dev2 
check raid0
tst="testdev $md2 3 $mdsize0 512"
$tst
uuid=`mdadm -Db $md2 | sed 's/.*UUID=//'`
mdadm -S $md2

mdadm -A $md2 $dev0 $dev1 $dev2  
$tst
mdadm -S $md2

mdadm -A $md2 -u $uuid $devlist 
$tst
mdadm -S $md2

mdadm --assemble $md2 --super-minor=2 $devlist 
$tst
mdadm -S $md2

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

mdadm -As -c $conf $md2 
$tst
mdadm -S $md2

{ 
  echo DEVICE $devlist
  echo array $md2 super-minor=2
} > $conf

mdadm -As -c $conf $md2 
$tst
mdadm -S $md2


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

mdadm -As -c $conf $md2 
$tst

echo "DEVICE $devlist" > $conf
mdadm -Db $md2 >> $conf
mdadm -S $md2

mdadm --assemble --scan --config=$conf $md2 
$tst
mdadm -S $md2

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


### Now for version 1...

mdadm --zero-superblock $dev0 $dev1 $dev2
mdadm -CR $md2 -l0 --metadata=1.0 -n3 $dev0 $dev1 $dev2 
check raid0
tst="testdev $md2 3 $mdsize1 512"
$tst

uuid=`mdadm -Db $md2 | sed 's/.*UUID=//'`
mdadm -S $md2

mdadm -A $md2 $dev0 $dev1 $dev2  
$tst
mdadm -S $md2

mdadm -A $md2 -u $uuid $devlist 
$tst
mdadm -S $md2

# version 1 has no super-minor
# mdadm --assemble $md2 --super-minor=2 $devlist # 
# $tst
# mdadm -S $md2

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

mdadm -As -c $conf $md2 
$tst
mdadm -S $md2

#{ 
#  echo DEVICE $devlist
#  echo array $md2 super-minor=2
#} > $conf
#
#mdadm -As -c $conf $md2 
#$tst
#mdadm -S $md2


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

mdadm -As -c $conf $md2 
$tst

echo "DEVICE $devlist" > $conf
mdadm -Db $md2 >> $conf
mdadm -S $md2

mdadm --assemble --scan --config=$conf $md2 
$tst
mdadm -S $md2

echo "  metadata=1 devices=$dev0,$dev1,$dev2" >> $conf
mdadm --assemble --scan --config=$conf $md2 
$tst
mdadm -S $md2

# Now use incremental assembly.
mdadm -I --config=$conf $dev0
mdadm -I --config=$conf $dev1
mdadm -I --config=$conf $dev2
$tst
mdadm -S $md2