| @@ -1,1633 +1,1660 @@ | | | @@ -1,1633 +1,1660 @@ |
1 | .\" $NetBSD: raidctl.8,v 1.74 2018/01/18 00:32:49 mrg Exp $ | | 1 | .\" $NetBSD: raidctl.8,v 1.75 2021/05/26 08:23:18 mrg Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | | 6 | .\" This code is derived from software contributed to The NetBSD Foundation |
7 | .\" by Greg Oster | | 7 | .\" by Greg Oster |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
15 | .\" notice, this list of conditions and the following disclaimer in the | | 15 | .\" notice, this list of conditions and the following disclaimer in the |
16 | .\" documentation and/or other materials provided with the distribution. | | 16 | .\" documentation and/or other materials provided with the distribution. |
17 | .\" | | 17 | .\" |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | | 28 | .\" POSSIBILITY OF SUCH DAMAGE. |
29 | .\" | | 29 | .\" |
30 | .\" | | 30 | .\" |
31 | .\" Copyright (c) 1995 Carnegie-Mellon University. | | 31 | .\" Copyright (c) 1995 Carnegie-Mellon University. |
32 | .\" All rights reserved. | | 32 | .\" All rights reserved. |
33 | .\" | | 33 | .\" |
34 | .\" Author: Mark Holland | | 34 | .\" Author: Mark Holland |
35 | .\" | | 35 | .\" |
36 | .\" Permission to use, copy, modify and distribute this software and | | 36 | .\" Permission to use, copy, modify and distribute this software and |
37 | .\" its documentation is hereby granted, provided that both the copyright | | 37 | .\" its documentation is hereby granted, provided that both the copyright |
38 | .\" notice and this permission notice appear in all copies of the | | 38 | .\" notice and this permission notice appear in all copies of the |
39 | .\" software, derivative works or modified versions, and any portions | | 39 | .\" software, derivative works or modified versions, and any portions |
40 | .\" thereof, and that both notices appear in supporting documentation. | | 40 | .\" thereof, and that both notices appear in supporting documentation. |
41 | .\" | | 41 | .\" |
42 | .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | | 42 | .\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" |
43 | .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND | | 43 | .\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND |
44 | .\" FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | | 44 | .\" FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. |
45 | .\" | | 45 | .\" |
46 | .\" Carnegie Mellon requests users of this software to return to | | 46 | .\" Carnegie Mellon requests users of this software to return to |
47 | .\" | | 47 | .\" |
48 | .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | | 48 | .\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU |
49 | .\" School of Computer Science | | 49 | .\" School of Computer Science |
50 | .\" Carnegie Mellon University | | 50 | .\" Carnegie Mellon University |
51 | .\" Pittsburgh PA 15213-3890 | | 51 | .\" Pittsburgh PA 15213-3890 |
52 | .\" | | 52 | .\" |
53 | .\" any improvements or extensions that they make and grant Carnegie the | | 53 | .\" any improvements or extensions that they make and grant Carnegie the |
54 | .\" rights to redistribute these changes. | | 54 | .\" rights to redistribute these changes. |
55 | .\" | | 55 | .\" |
56 | .Dd January 6, 2016 | | 56 | .Dd May 26, 2021 |
57 | .Dt RAIDCTL 8 | | 57 | .Dt RAIDCTL 8 |
58 | .Os | | 58 | .Os |
59 | .Sh NAME | | 59 | .Sh NAME |
60 | .Nm raidctl | | 60 | .Nm raidctl |
61 | .Nd configuration utility for the RAIDframe disk driver | | 61 | .Nd configuration utility for the RAIDframe disk driver |
62 | .Sh SYNOPSIS | | 62 | .Sh SYNOPSIS |
63 | .Nm | | 63 | .Nm |
64 | .Op Fl v | | 64 | .Op Fl v |
65 | .Fl A Op yes | no | forceroot | softroot | | 65 | .Fl A Op yes | no | forceroot | softroot |
66 | .Ar dev | | 66 | .Ar dev |
67 | .Nm | | 67 | .Nm |
68 | .Op Fl v | | 68 | .Op Fl v |
69 | .Fl a Ar component Ar dev | | 69 | .Fl a Ar component Ar dev |
70 | .Nm | | 70 | .Nm |
71 | .Op Fl v | | 71 | .Op Fl v |
72 | .Fl B Ar dev | | 72 | .Fl B Ar dev |
73 | .Nm | | 73 | .Nm |
74 | .Op Fl v | | 74 | .Op Fl v |
75 | .Fl C Ar config_file Ar dev | | 75 | .Fl C Ar config_file Ar dev |
76 | .Nm | | 76 | .Nm |
77 | .Op Fl v | | 77 | .Op Fl v |
78 | .Fl c Ar config_file Ar dev | | 78 | .Fl c Ar config_file Ar dev |
79 | .Nm | | 79 | .Nm |
80 | .Op Fl v | | 80 | .Op Fl v |
81 | .Fl F Ar component Ar dev | | 81 | .Fl F Ar component Ar dev |
82 | .Nm | | 82 | .Nm |
83 | .Op Fl v | | 83 | .Op Fl v |
84 | .Fl f Ar component Ar dev | | 84 | .Fl f Ar component Ar dev |
85 | .Nm | | 85 | .Nm |
86 | .Op Fl v | | 86 | .Op Fl v |
87 | .Fl G Ar dev | | 87 | .Fl G Ar dev |
88 | .Nm | | 88 | .Nm |
89 | .Op Fl v | | 89 | .Op Fl v |
90 | .Fl g Ar component Ar dev | | 90 | .Fl g Ar component Ar dev |
91 | .Nm | | 91 | .Nm |
92 | .Op Fl v | | 92 | .Op Fl v |
93 | .Fl I Ar serial_number Ar dev | | 93 | .Fl I Ar serial_number Ar dev |
94 | .Nm | | 94 | .Nm |
95 | .Op Fl v | | 95 | .Op Fl v |
96 | .Fl i Ar dev | | 96 | .Fl i Ar dev |
97 | .Nm | | 97 | .Nm |
98 | .Op Fl v | | 98 | .Op Fl v |
99 | .Fl M | | 99 | .Fl M |
100 | .Oo yes | no | set | | 100 | .Oo yes | no | set |
101 | .Ar params | | 101 | .Ar params |
102 | .Oc | | 102 | .Oc |
103 | .Ar dev | | 103 | .Ar dev |
104 | .Nm | | 104 | .Nm |
105 | .Op Fl v | | 105 | .Op Fl v |
106 | .Fl m Ar dev | | 106 | .Fl m Ar dev |
107 | .Nm | | 107 | .Nm |
108 | .Op Fl v | | 108 | .Op Fl v |
109 | .Fl P Ar dev | | 109 | .Fl P Ar dev |
110 | .Nm | | 110 | .Nm |
111 | .Op Fl v | | 111 | .Op Fl v |
112 | .Fl p Ar dev | | 112 | .Fl p Ar dev |
113 | .Nm | | 113 | .Nm |
114 | .Op Fl v | | 114 | .Op Fl v |
115 | .Fl R Ar component Ar dev | | 115 | .Fl R Ar component Ar dev |
116 | .Nm | | 116 | .Nm |
117 | .Op Fl v | | 117 | .Op Fl v |
118 | .Fl r Ar component Ar dev | | 118 | .Fl r Ar component Ar dev |
119 | .Nm | | 119 | .Nm |
120 | .Op Fl v | | 120 | .Op Fl v |
121 | .Fl S Ar dev | | 121 | .Fl S Ar dev |
122 | .Nm | | 122 | .Nm |
123 | .Op Fl v | | 123 | .Op Fl v |
124 | .Fl s Ar dev | | 124 | .Fl s Ar dev |
125 | .Nm | | 125 | .Nm |
126 | .Op Fl v | | 126 | .Op Fl v |
127 | .Fl U Ar unit Ar dev | | 127 | .Fl U Ar unit Ar dev |
128 | .Nm | | 128 | .Nm |
129 | .Op Fl v | | 129 | .Op Fl v |
130 | .Fl u Ar dev | | 130 | .Fl u Ar dev |
131 | .Sh DESCRIPTION | | 131 | .Sh DESCRIPTION |
132 | .Nm | | 132 | .Nm |
133 | is the user-land control program for | | 133 | is the user-land control program for |
134 | .Xr raid 4 , | | 134 | .Xr raid 4 , |
135 | the RAIDframe disk device. | | 135 | the RAIDframe disk device. |
136 | .Nm | | 136 | .Nm |
137 | is primarily used to dynamically configure and unconfigure RAIDframe disk | | 137 | is primarily used to dynamically configure and unconfigure RAIDframe disk |
138 | devices. | | 138 | devices. |
139 | For more information about the RAIDframe disk device, see | | 139 | For more information about the RAIDframe disk device, see |
140 | .Xr raid 4 . | | 140 | .Xr raid 4 . |
141 | .Pp | | 141 | .Pp |
142 | This document assumes the reader has at least rudimentary knowledge of | | 142 | This document assumes the reader has at least rudimentary knowledge of |
143 | RAID and RAID concepts. | | 143 | RAID and RAID concepts. |
144 | .Pp | | 144 | .Pp |
145 | The command-line options for | | 145 | The command-line options for |
146 | .Nm | | 146 | .Nm |
147 | are as follows: | | 147 | are as follows: |
148 | .Bl -tag -width indent | | 148 | .Bl -tag -width indent |
149 | .It Fl A Ic yes Ar dev | | 149 | .It Fl A Ic yes Ar dev |
150 | Make the RAID set auto-configurable. | | 150 | Make the RAID set auto-configurable. |
151 | The RAID set will be automatically configured at boot | | 151 | The RAID set will be automatically configured at boot |
152 | .Ar before | | 152 | .Ar before |
153 | the root file system is mounted. | | 153 | the root file system is mounted. |
154 | Note that all components of the set must be of type | | 154 | Note that all components of the set must be of type |
155 | .Dv RAID | | 155 | .Dv RAID |
156 | in the disklabel. | | 156 | in the disklabel. |
157 | .It Fl A Ic no Ar dev | | 157 | .It Fl A Ic no Ar dev |
158 | Turn off auto-configuration for the RAID set. | | 158 | Turn off auto-configuration for the RAID set. |
159 | .It Fl A Ic forceroot Ar dev | | 159 | .It Fl A Ic forceroot Ar dev |
160 | Make the RAID set auto-configurable, and also mark the set as being | | 160 | Make the RAID set auto-configurable, and also mark the set as being |
161 | eligible to be the root partition. | | 161 | eligible to be the root partition. |
162 | A RAID set configured this way will | | 162 | A RAID set configured this way will |
163 | .Ar override | | 163 | .Ar override |
164 | the use of the boot disk as the root device. | | 164 | the use of the boot disk as the root device. |
165 | All components of the set must be of type | | 165 | All components of the set must be of type |
166 | .Dv RAID | | 166 | .Dv RAID |
167 | in the disklabel. | | 167 | in the disklabel. |
168 | Note that only certain architectures | | 168 | Note that only certain architectures |
169 | .Pq currently alpha, amd64, i386, pmax, sandpoint, sparc, sparc64, and vax | | 169 | .Pq currently arc, alpha, amd64, bebox, cobalt, emips, i386, landisk, |
| | | 170 | ofppc, pmax, sandpoint, sgimips, sparc, sparc64, and vax |
170 | support booting a kernel directly from a RAID set. | | 171 | support booting a kernel directly from a RAID set. |
171 | Please note that | | 172 | Please note that |
172 | .Ic forceroot | | 173 | .Ic forceroot |
173 | mode was referred to as | | 174 | mode was referred to as |
174 | .Ic root | | 175 | .Ic root |
175 | mode on earlier versions of | | 176 | mode on earlier versions of |
176 | .Nx . | | 177 | .Nx . |
177 | For compatibility reasons, | | 178 | For compatibility reasons, |
178 | .Ic root | | 179 | .Ic root |
179 | can be used as an alias for | | 180 | can be used as an alias for |
180 | .Ic forceroot . | | 181 | .Ic forceroot . |
181 | .It Fl A Ic softroot Ar dev | | 182 | .It Fl A Ic softroot Ar dev |
182 | Like | | 183 | Like |
183 | .Ic forceroot , | | 184 | .Ic forceroot , |
184 | but only change the root device if the boot device is part of the RAID set. | | 185 | but only change the root device if the boot device is part of the RAID set. |
185 | .It Fl a Ar component Ar dev | | 186 | .It Fl a Ar component Ar dev |
186 | Add | | 187 | Add |
187 | .Ar component | | 188 | .Ar component |
188 | as a hot spare for the device | | 189 | as a hot spare for the device |
189 | .Ar dev . | | 190 | .Ar dev . |
190 | Component labels (which identify the location of a given | | 191 | Component labels (which identify the location of a given |
191 | component within a particular RAID set) are automatically added to the | | 192 | component within a particular RAID set) are automatically added to the |
192 | hot spare after it has been used and are not required for | | 193 | hot spare after it has been used and are not required for |
193 | .Ar component | | 194 | .Ar component |
194 | before it is used. | | 195 | before it is used. |
195 | .It Fl B Ar dev | | 196 | .It Fl B Ar dev |
196 | Initiate a copyback of reconstructed data from a spare disk to | | 197 | Initiate a copyback of reconstructed data from a spare disk to |
197 | its original disk. | | 198 | its original disk. |
198 | This is performed after a component has failed, | | 199 | This is performed after a component has failed, |
199 | and the failed drive has been reconstructed onto a spare drive. | | 200 | and the failed drive has been reconstructed onto a spare drive. |
200 | .It Fl C Ar config_file Ar dev | | 201 | .It Fl C Ar config_file Ar dev |
201 | As for | | 202 | As for |
202 | .Fl c , | | 203 | .Fl c , |
203 | but forces the configuration to take place. | | 204 | but forces the configuration to take place. |
204 | Fatal errors due to uninitialized components are ignored. | | 205 | Fatal errors due to uninitialized components are ignored. |
205 | This is required the first time a RAID set is configured. | | 206 | This is required the first time a RAID set is configured. |
206 | .It Fl c Ar config_file Ar dev | | 207 | .It Fl c Ar config_file Ar dev |
207 | Configure the RAIDframe device | | 208 | Configure the RAIDframe device |
208 | .Ar dev | | 209 | .Ar dev |
209 | according to the configuration given in | | 210 | according to the configuration given in |
210 | .Ar config_file . | | 211 | .Ar config_file . |
211 | A description of the contents of | | 212 | A description of the contents of |
212 | .Ar config_file | | 213 | .Ar config_file |
213 | is given later. | | 214 | is given later. |
214 | .It Fl F Ar component Ar dev | | 215 | .It Fl F Ar component Ar dev |
215 | Fails the specified | | 216 | Fails the specified |
216 | .Ar component | | 217 | .Ar component |
217 | of the device, and immediately begin a reconstruction of the failed | | 218 | of the device, and immediately begin a reconstruction of the failed |
218 | disk onto an available hot spare. | | 219 | disk onto an available hot spare. |
219 | This is one of the mechanisms used to start | | 220 | This is one of the mechanisms used to start |
220 | the reconstruction process if a component does have a hardware failure. | | 221 | the reconstruction process if a component does have a hardware failure. |
221 | .It Fl f Ar component Ar dev | | 222 | .It Fl f Ar component Ar dev |
222 | This marks the specified | | 223 | This marks the specified |
223 | .Ar component | | 224 | .Ar component |
224 | as having failed, but does not initiate a reconstruction of that component. | | 225 | as having failed, but does not initiate a reconstruction of that component. |
225 | .It Fl G Ar dev | | 226 | .It Fl G Ar dev |
226 | Generate the configuration of the RAIDframe device in a format suitable for | | 227 | Generate the configuration of the RAIDframe device in a format suitable for |
227 | use with the | | 228 | use with the |
228 | .Fl c | | 229 | .Fl c |
229 | or | | 230 | or |
230 | .Fl C | | 231 | .Fl C |
231 | options. | | 232 | options. |
232 | .It Fl g Ar component Ar dev | | 233 | .It Fl g Ar component Ar dev |
233 | Get the component label for the specified component. | | 234 | Get the component label for the specified component. |
234 | .It Fl I Ar serial_number Ar dev | | 235 | .It Fl I Ar serial_number Ar dev |
235 | Initialize the component labels on each component of the device. | | 236 | Initialize the component labels on each component of the device. |
236 | .Ar serial_number | | 237 | .Ar serial_number |
237 | is used as one of the keys in determining whether a | | 238 | is used as one of the keys in determining whether a |
238 | particular set of components belong to the same RAID set. | | 239 | particular set of components belong to the same RAID set. |
239 | While not strictly enforced, different serial numbers should be used for | | 240 | While not strictly enforced, different serial numbers should be used for |
240 | different RAID sets. | | 241 | different RAID sets. |
241 | This step | | 242 | This step |
242 | .Em MUST | | 243 | .Em MUST |
243 | be performed when a new RAID set is created. | | 244 | be performed when a new RAID set is created. |
244 | .It Fl i Ar dev | | 245 | .It Fl i Ar dev |
245 | Initialize the RAID device. | | 246 | Initialize the RAID device. |
246 | In particular, (re-)write the parity on the selected device. | | 247 | In particular, (re-)write the parity on the selected device. |
247 | This | | 248 | This |
248 | .Em MUST | | 249 | .Em MUST |
249 | be done for | | 250 | be done for |
250 | .Em all | | 251 | .Em all |
251 | RAID sets before the RAID device is labeled and before | | 252 | RAID sets before the RAID device is labeled and before |
252 | file systems are created on the RAID device. | | 253 | file systems are created on the RAID device. |
253 | .It Fl M Ic yes Ar dev | | 254 | .It Fl M Ic yes Ar dev |
254 | .\"XXX should there be a section with more info on the parity map feature? | | 255 | .\"XXX should there be a section with more info on the parity map feature? |
255 | Enable the use of a parity map on the RAID set; this is the default, | | 256 | Enable the use of a parity map on the RAID set; this is the default, |
256 | and greatly reduces the time taken to check parity after unclean | | 257 | and greatly reduces the time taken to check parity after unclean |
257 | shutdowns at the cost of some very slight overhead during normal | | 258 | shutdowns at the cost of some very slight overhead during normal |
258 | operation. | | 259 | operation. |
259 | Changes to this setting will take effect the next time the set is | | 260 | Changes to this setting will take effect the next time the set is |
260 | configured. | | 261 | configured. |
261 | Note that RAID-0 sets, having no parity, will not use a parity map in | | 262 | Note that RAID-0 sets, having no parity, will not use a parity map in |
262 | any case. | | 263 | any case. |
263 | .It Fl M Ic no Ar dev | | 264 | .It Fl M Ic no Ar dev |
264 | Disable the use of a parity map on the RAID set; doing this is not | | 265 | Disable the use of a parity map on the RAID set; doing this is not |
265 | recommended. | | 266 | recommended. |
266 | This will take effect the next time the set is configured. | | 267 | This will take effect the next time the set is configured. |
267 | .It Fl M Ic set Ar cooldown Ar tickms Ar regions Ar dev | | 268 | .It Fl M Ic set Ar cooldown Ar tickms Ar regions Ar dev |
268 | Alter the parameters of the parity map; parameters to leave unchanged | | 269 | Alter the parameters of the parity map; parameters to leave unchanged |
269 | can be given as 0, and trailing zeroes may be omitted. | | 270 | can be given as 0, and trailing zeroes may be omitted. |
270 | .\"XXX should this explanation be deferred to another section as well? | | 271 | .\"XXX should this explanation be deferred to another section as well? |
271 | The RAID set is divided into | | 272 | The RAID set is divided into |
272 | .Ar regions | | 273 | .Ar regions |
273 | regions; each region is marked dirty for at most | | 274 | regions; each region is marked dirty for at most |
274 | .Ar cooldown | | 275 | .Ar cooldown |
275 | intervals of | | 276 | intervals of |
276 | .Ar tickms | | 277 | .Ar tickms |
277 | milliseconds each after a write to it, and at least | | 278 | milliseconds each after a write to it, and at least |
278 | .Ar cooldown | | 279 | .Ar cooldown |
279 | \- 1 such intervals. | | 280 | \- 1 such intervals. |
280 | Changes to | | 281 | Changes to |
281 | .Ar regions | | 282 | .Ar regions |
282 | take effect the next time is configured, while changes to the other | | 283 | take effect the next time is configured, while changes to the other |
283 | parameters are applied immediately. | | 284 | parameters are applied immediately. |
284 | The default parameters are expected to be reasonable for most workloads. | | 285 | The default parameters are expected to be reasonable for most workloads. |
285 | .It Fl m Ar dev | | 286 | .It Fl m Ar dev |
286 | Display status information about the parity map on the RAID set, if any. | | 287 | Display status information about the parity map on the RAID set, if any. |
287 | If used with | | 288 | If used with |
288 | .Fl v | | 289 | .Fl v |
289 | then the current contents of the parity map will be output (in | | 290 | then the current contents of the parity map will be output (in |
290 | hexadecimal format) as well. | | 291 | hexadecimal format) as well. |
291 | .It Fl P Ar dev | | 292 | .It Fl P Ar dev |
292 | Check the status of the parity on the RAID set, and initialize | | 293 | Check the status of the parity on the RAID set, and initialize |
293 | (re-write) the parity if the parity is not known to be up-to-date. | | 294 | (re-write) the parity if the parity is not known to be up-to-date. |
294 | This is normally used after a system crash (and before a | | 295 | This is normally used after a system crash (and before a |
295 | .Xr fsck 8 ) | | 296 | .Xr fsck 8 ) |
296 | to ensure the integrity of the parity. | | 297 | to ensure the integrity of the parity. |
297 | .It Fl p Ar dev | | 298 | .It Fl p Ar dev |
298 | Check the status of the parity on the RAID set. | | 299 | Check the status of the parity on the RAID set. |
299 | Displays a status message, | | 300 | Displays a status message, |
300 | and returns successfully if the parity is up-to-date. | | 301 | and returns successfully if the parity is up-to-date. |
301 | .It Fl R Ar component Ar dev | | 302 | .It Fl R Ar component Ar dev |
302 | Fails the specified | | 303 | Fails the specified |
303 | .Ar component , | | 304 | .Ar component , |
304 | if necessary, and immediately begins a reconstruction back to | | 305 | if necessary, and immediately begins a reconstruction back to |
305 | .Ar component . | | 306 | .Ar component . |
306 | This is useful for reconstructing back onto a component after | | 307 | This is useful for reconstructing back onto a component after |
307 | it has been replaced following a failure. | | 308 | it has been replaced following a failure. |
308 | .It Fl r Ar component Ar dev | | 309 | .It Fl r Ar component Ar dev |
309 | Remove the spare disk specified by | | 310 | Remove the spare disk specified by |
310 | .Ar component | | 311 | .Ar component |
311 | from the set of available spare components. | | 312 | from the set of available spare components. |
312 | .It Fl S Ar dev | | 313 | .It Fl S Ar dev |
313 | Check the status of parity re-writing, component reconstruction, and | | 314 | Check the status of parity re-writing, component reconstruction, and |
314 | component copyback. | | 315 | component copyback. |
315 | The output indicates the amount of progress | | 316 | The output indicates the amount of progress |
316 | achieved in each of these areas. | | 317 | achieved in each of these areas. |
317 | .It Fl s Ar dev | | 318 | .It Fl s Ar dev |
318 | Display the status of the RAIDframe device for each of the components | | 319 | Display the status of the RAIDframe device for each of the components |
319 | and spares. | | 320 | and spares. |
320 | .It Fl U Ar unit Ar dev | | 321 | .It Fl U Ar unit Ar dev |
321 | Set the | | 322 | Set the |
322 | .Dv last_unit | | 323 | .Dv last_unit |
323 | field in all the raid components, so that the next time the raid | | 324 | field in all the raid components, so that the next time the raid |
324 | will be autoconfigured it uses that | | 325 | will be autoconfigured it uses that |
325 | .Ar unit . | | 326 | .Ar unit . |
326 | .It Fl u Ar dev | | 327 | .It Fl u Ar dev |
327 | Unconfigure the RAIDframe device. | | 328 | Unconfigure the RAIDframe device. |
328 | This does not remove any component labels or change any configuration | | 329 | This does not remove any component labels or change any configuration |
329 | settings (e.g. auto-configuration settings) for the RAID set. | | 330 | settings (e.g. auto-configuration settings) for the RAID set. |
330 | .It Fl v | | 331 | .It Fl v |
331 | Be more verbose. | | 332 | Be more verbose. |
332 | For operations such as reconstructions, parity | | 333 | For operations such as reconstructions, parity |
333 | re-writing, and copybacks, provide a progress indicator. | | 334 | re-writing, and copybacks, provide a progress indicator. |
334 | .El | | 335 | .El |
335 | .Pp | | 336 | .Pp |
336 | The device used by | | 337 | The device used by |
337 | .Nm | | 338 | .Nm |
338 | is specified by | | 339 | is specified by |
339 | .Ar dev . | | 340 | .Ar dev . |
340 | .Ar dev | | 341 | .Ar dev |
341 | may be either the full name of the device, e.g., | | 342 | may be either the full name of the device, e.g., |
342 | .Pa /dev/rraid0d , | | 343 | .Pa /dev/rraid0d , |
343 | for the i386 architecture, or | | 344 | for the i386 architecture, or |
344 | .Pa /dev/rraid0c | | 345 | .Pa /dev/rraid0c |
345 | for many others, or just simply | | 346 | for many others, or just simply |
346 | .Pa raid0 | | 347 | .Pa raid0 |
347 | (for | | 348 | (for |
348 | .Pa /dev/rraid0[cd] ) . | | 349 | .Pa /dev/rraid0[cd] ) . |
349 | It is recommended that the partitions used to represent the | | 350 | It is recommended that the partitions used to represent the |
350 | RAID device are not used for file systems. | | 351 | RAID device are not used for file systems. |
351 | .Ss Configuration file | | 352 | .Ss Configuration file |
352 | The format of the configuration file is complex, and | | 353 | The format of the configuration file is complex, and |
353 | only an abbreviated treatment is given here. | | 354 | only an abbreviated treatment is given here. |
354 | In the configuration files, a | | 355 | In the configuration files, a |
355 | .Sq # | | 356 | .Sq # |
356 | indicates the beginning of a comment. | | 357 | indicates the beginning of a comment. |
357 | .Pp | | 358 | .Pp |
358 | There are 4 required sections of a configuration file, and 2 | | 359 | There are 4 required sections of a configuration file, and 2 |
359 | optional sections. | | 360 | optional sections. |
360 | Each section begins with a | | 361 | Each section begins with a |
361 | .Sq START , | | 362 | .Sq START , |
362 | followed by the section name, | | 363 | followed by the section name, |
363 | and the configuration parameters associated with that section. | | 364 | and the configuration parameters associated with that section. |
364 | The first section is the | | 365 | The first section is the |
365 | .Sq array | | 366 | .Sq array |
366 | section, and it specifies | | 367 | section, and it specifies |
367 | the number of columns, and spare disks in the RAID set. | | 368 | the number of columns, and spare disks in the RAID set. |
368 | For example: | | 369 | For example: |
369 | .Bd -literal -offset indent | | 370 | .Bd -literal -offset indent |
370 | START array | | 371 | START array |
371 | 3 0 | | 372 | 3 0 |
372 | .Ed | | 373 | .Ed |
373 | .Pp | | 374 | .Pp |
374 | indicates an array with 3 columns, and 0 spare disks. | | 375 | indicates an array with 3 columns, and 0 spare disks. |
375 | Old configurations specified a 3rd value in front of the | | 376 | Old configurations specified a 3rd value in front of the |
376 | number of columns and spare disks. | | 377 | number of columns and spare disks. |
377 | This old value, if provided, must be specified as 1: | | 378 | This old value, if provided, must be specified as 1: |
378 | .Bd -literal -offset indent | | 379 | .Bd -literal -offset indent |
379 | START array | | 380 | START array |
380 | 1 3 0 | | 381 | 1 3 0 |
381 | .Ed | | 382 | .Ed |
382 | .Pp | | 383 | .Pp |
383 | The second section, the | | 384 | The second section, the |
384 | .Sq disks | | 385 | .Sq disks |
385 | section, specifies the actual components of the device. | | 386 | section, specifies the actual components of the device. |
386 | For example: | | 387 | For example: |
387 | .Bd -literal -offset indent | | 388 | .Bd -literal -offset indent |
388 | START disks | | 389 | START disks |
389 | /dev/sd0e | | 390 | /dev/sd0e |
390 | /dev/sd1e | | 391 | /dev/sd1e |
391 | /dev/sd2e | | 392 | /dev/sd2e |
392 | .Ed | | 393 | .Ed |
393 | .Pp | | 394 | .Pp |
394 | specifies the three component disks to be used in the RAID device. | | 395 | specifies the three component disks to be used in the RAID device. |
395 | Disk wedges may also be specified with the NAME=<wedge name> syntax. | | 396 | Disk wedges may also be specified with the NAME=<wedge name> syntax. |
396 | If any of the specified drives cannot be found when the RAID device is | | 397 | If any of the specified drives cannot be found when the RAID device is |
397 | configured, then they will be marked as | | 398 | configured, then they will be marked as |
398 | .Sq failed , | | 399 | .Sq failed , |
399 | and the system will operate in degraded mode. | | 400 | and the system will operate in degraded mode. |
400 | Note that it is | | 401 | Note that it is |
401 | .Em imperative | | 402 | .Em imperative |
402 | that the order of the components in the configuration file does not | | 403 | that the order of the components in the configuration file does not |
403 | change between configurations of a RAID device. | | 404 | change between configurations of a RAID device. |
404 | Changing the order of the components will result in data loss | | 405 | Changing the order of the components will result in data loss |
405 | if the set is configured with the | | 406 | if the set is configured with the |
406 | .Fl C | | 407 | .Fl C |
407 | option. | | 408 | option. |
408 | In normal circumstances, the RAID set will not configure if only | | 409 | In normal circumstances, the RAID set will not configure if only |
409 | .Fl c | | 410 | .Fl c |
410 | is specified, and the components are out-of-order. | | 411 | is specified, and the components are out-of-order. |
411 | .Pp | | 412 | .Pp |
412 | The next section, which is the | | 413 | The next section, which is the |
413 | .Sq spare | | 414 | .Sq spare |
414 | section, is optional, and, if present, specifies the devices to be used as | | 415 | section, is optional, and, if present, specifies the devices to be used as |
415 | .Sq hot spares | | 416 | .Sq hot spares |
416 | \(em devices which are on-line, | | 417 | \(em devices which are on-line, |
417 | but are not actively used by the RAID driver unless | | 418 | but are not actively used by the RAID driver unless |
418 | one of the main components fail. | | 419 | one of the main components fail. |
419 | A simple | | 420 | A simple |
420 | .Sq spare | | 421 | .Sq spare |
421 | section might be: | | 422 | section might be: |
422 | .Bd -literal -offset indent | | 423 | .Bd -literal -offset indent |
423 | START spare | | 424 | START spare |
424 | /dev/sd3e | | 425 | /dev/sd3e |
425 | .Ed | | 426 | .Ed |
426 | .Pp | | 427 | .Pp |
427 | for a configuration with a single spare component. | | 428 | for a configuration with a single spare component. |
428 | If no spare drives are to be used in the configuration, then the | | 429 | If no spare drives are to be used in the configuration, then the |
429 | .Sq spare | | 430 | .Sq spare |
430 | section may be omitted. | | 431 | section may be omitted. |
431 | .Pp | | 432 | .Pp |
432 | The next section is the | | 433 | The next section is the |
433 | .Sq layout | | 434 | .Sq layout |
434 | section. | | 435 | section. |
435 | This section describes the general layout parameters for the RAID device, | | 436 | This section describes the general layout parameters for the RAID device, |
436 | and provides such information as | | 437 | and provides such information as |
437 | sectors per stripe unit, | | 438 | sectors per stripe unit, |
438 | stripe units per parity unit, | | 439 | stripe units per parity unit, |
439 | stripe units per reconstruction unit, | | 440 | stripe units per reconstruction unit, |
440 | and the parity configuration to use. | | 441 | and the parity configuration to use. |
441 | This section might look like: | | 442 | This section might look like: |
442 | .Bd -literal -offset indent | | 443 | .Bd -literal -offset indent |
443 | START layout | | 444 | START layout |
444 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level | | 445 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level |
445 | 32 1 1 5 | | 446 | 32 1 1 5 |
446 | .Ed | | 447 | .Ed |
447 | .Pp | | 448 | .Pp |
448 | The sectors per stripe unit specifies, in blocks, the interleave | | 449 | The sectors per stripe unit specifies, in blocks, the interleave |
449 | factor; i.e., the number of contiguous sectors to be written to each | | 450 | factor; i.e., the number of contiguous sectors to be written to each |
450 | component for a single stripe. | | 451 | component for a single stripe. |
451 | Appropriate selection of this value (32 in this example) | | 452 | Appropriate selection of this value (32 in this example) |
452 | is the subject of much research in RAID architectures. | | 453 | is the subject of much research in RAID architectures. |
453 | The stripe units per parity unit and | | 454 | The stripe units per parity unit and |
454 | stripe units per reconstruction unit are normally each set to 1. | | 455 | stripe units per reconstruction unit are normally each set to 1. |
455 | While certain values above 1 are permitted, a discussion of valid | | 456 | While certain values above 1 are permitted, a discussion of valid |
456 | values and the consequences of using anything other than 1 are outside | | 457 | values and the consequences of using anything other than 1 are outside |
457 | the scope of this document. | | 458 | the scope of this document. |
458 | The last value in this section (5 in this example) | | 459 | The last value in this section (5 in this example) |
459 | indicates the parity configuration desired. | | 460 | indicates the parity configuration desired. |
460 | Valid entries include: | | 461 | Valid entries include: |
461 | .Bl -tag -width inde | | 462 | .Bl -tag -width inde |
462 | .It 0 | | 463 | .It 0 |
463 | RAID level 0. | | 464 | RAID level 0. |
464 | No parity, only simple striping. | | 465 | No parity, only simple striping. |
465 | .It 1 | | 466 | .It 1 |
466 | RAID level 1. | | 467 | RAID level 1. |
467 | Mirroring. | | 468 | Mirroring. |
468 | The parity is the mirror. | | 469 | The parity is the mirror. |
469 | .It 4 | | 470 | .It 4 |
470 | RAID level 4. | | 471 | RAID level 4. |
471 | Striping across components, with parity stored on the last component. | | 472 | Striping across components, with parity stored on the last component. |
472 | .It 5 | | 473 | .It 5 |
473 | RAID level 5. | | 474 | RAID level 5. |
474 | Striping across components, parity distributed across all components. | | 475 | Striping across components, parity distributed across all components. |
475 | .El | | 476 | .El |
476 | .Pp | | 477 | .Pp |
477 | There are other valid entries here, including those for Even-Odd | | 478 | There are other valid entries here, including those for Even-Odd |
478 | parity, RAID level 5 with rotated sparing, Chained declustering, | | 479 | parity, RAID level 5 with rotated sparing, Chained declustering, |
479 | and Interleaved declustering, but as of this writing the code for | | 480 | and Interleaved declustering, but as of this writing the code for |
480 | those parity operations has not been tested with | | 481 | those parity operations has not been tested with |
481 | .Nx . | | 482 | .Nx . |
482 | .Pp | | 483 | .Pp |
483 | The next required section is the | | 484 | The next required section is the |
484 | .Sq queue | | 485 | .Sq queue |
485 | section. | | 486 | section. |
486 | This is most often specified as: | | 487 | This is most often specified as: |
487 | .Bd -literal -offset indent | | 488 | .Bd -literal -offset indent |
488 | START queue | | 489 | START queue |
489 | fifo 100 | | 490 | fifo 100 |
490 | .Ed | | 491 | .Ed |
491 | .Pp | | 492 | .Pp |
492 | where the queuing method is specified as fifo (first-in, first-out), | | 493 | where the queuing method is specified as fifo (first-in, first-out), |
493 | and the size of the per-component queue is limited to 100 requests. | | 494 | and the size of the per-component queue is limited to 100 requests. |
494 | Other queuing methods may also be specified, but a discussion of them | | 495 | Other queuing methods may also be specified, but a discussion of them |
495 | is beyond the scope of this document. | | 496 | is beyond the scope of this document. |
496 | .Pp | | 497 | .Pp |
497 | The final section, the | | 498 | The final section, the |
498 | .Sq debug | | 499 | .Sq debug |
499 | section, is optional. | | 500 | section, is optional. |
500 | For more details on this the reader is referred to | | 501 | For more details on this the reader is referred to |
501 | the RAIDframe documentation discussed in the | | 502 | the RAIDframe documentation discussed in the |
502 | .Sx HISTORY | | 503 | .Sx HISTORY |
503 | section. | | 504 | section. |
504 | .Pp | | 505 | .Pp |
| | | 506 | Since |
| | | 507 | .Nx 10 |
| | | 508 | RAIDframe has been been capable of autoconfiguration of components |
| | | 509 | originally configured on opposite endian systems. The current label |
| | | 510 | endianness will be retained. |
| | | 511 | .Pp |
505 | See | | 512 | See |
506 | .Sx EXAMPLES | | 513 | .Sx EXAMPLES |
507 | for a more complete configuration file example. | | 514 | for a more complete configuration file example. |
508 | .Sh FILES | | 515 | .Sh FILES |
509 | .Bl -tag -width /dev/XXrXraidX -compact | | 516 | .Bl -tag -width /dev/XXrXraidX -compact |
510 | .It Pa /dev/{,r}raid* | | 517 | .It Pa /dev/{,r}raid* |
511 | .Cm raid | | 518 | .Cm raid |
512 | device special files. | | 519 | device special files. |
513 | .El | | 520 | .El |
514 | .Sh EXAMPLES | | 521 | .Sh EXAMPLES |
515 | It is highly recommended that before using the RAID driver for real | | 522 | It is highly recommended that before using the RAID driver for real |
516 | file systems that the system administrator(s) become quite familiar | | 523 | file systems that the system administrator(s) become quite familiar |
517 | with the use of | | 524 | with the use of |
518 | .Nm , | | 525 | .Nm , |
519 | and that they understand how the component reconstruction process works. | | 526 | and that they understand how the component reconstruction process works. |
520 | The examples in this section will focus on configuring a | | 527 | The examples in this section will focus on configuring a |
521 | number of different RAID sets of varying degrees of redundancy. | | 528 | number of different RAID sets of varying degrees of redundancy. |
522 | By working through these examples, administrators should be able to | | 529 | By working through these examples, administrators should be able to |
523 | develop a good feel for how to configure a RAID set, and how to | | 530 | develop a good feel for how to configure a RAID set, and how to |
524 | initiate reconstruction of failed components. | | 531 | initiate reconstruction of failed components. |
525 | .Pp | | 532 | .Pp |
526 | In the following examples | | 533 | In the following examples |
527 | .Sq raid0 | | 534 | .Sq raid0 |
528 | will be used to denote the RAID device. | | 535 | will be used to denote the RAID device. |
529 | Depending on the architecture, | | 536 | Depending on the architecture, |
530 | .Pa /dev/rraid0c | | 537 | .Pa /dev/rraid0c |
531 | or | | 538 | or |
532 | .Pa /dev/rraid0d | | 539 | .Pa /dev/rraid0d |
533 | may be used in place of | | 540 | may be used in place of |
534 | .Pa raid0 . | | 541 | .Pa raid0 . |
535 | .Ss Initialization and Configuration | | 542 | .Ss Initialization and Configuration |
536 | The initial step in configuring a RAID set is to identify the components | | 543 | The initial step in configuring a RAID set is to identify the components |
537 | that will be used in the RAID set. | | 544 | that will be used in the RAID set. |
538 | All components should be the same size. | | 545 | All components should be the same size. |
539 | Each component should have a disklabel type of | | 546 | Each component should have a disklabel type of |
540 | .Dv FS_RAID , | | 547 | .Dv FS_RAID , |
541 | and a typical disklabel entry for a RAID component might look like: | | 548 | and a typical disklabel entry for a RAID component might look like: |
542 | .Bd -literal -offset indent | | 549 | .Bd -literal -offset indent |
543 | f: 1800000 200495 RAID # (Cyl. 405*- 4041*) | | 550 | f: 1800000 200495 RAID # (Cyl. 405*- 4041*) |
544 | .Ed | | 551 | .Ed |
545 | .Pp | | 552 | .Pp |
546 | While | | 553 | While |
547 | .Dv FS_BSDFFS | | 554 | .Dv FS_BSDFFS |
548 | will also work as the component type, the type | | 555 | will also work as the component type, the type |
549 | .Dv FS_RAID | | 556 | .Dv FS_RAID |
550 | is preferred for RAIDframe use, as it is required for features such as | | 557 | is preferred for RAIDframe use, as it is required for features such as |
551 | auto-configuration. | | 558 | auto-configuration. |
552 | As part of the initial configuration of each RAID set, | | 559 | As part of the initial configuration of each RAID set, |
553 | each component will be given a | | 560 | each component will be given a |
554 | .Sq component label . | | 561 | .Sq component label . |
555 | A | | 562 | A |
556 | .Sq component label | | 563 | .Sq component label |
557 | contains important information about the component, including a | | 564 | contains important information about the component, including a |
558 | user-specified serial number, the column of that component in | | 565 | user-specified serial number, the column of that component in |
559 | the RAID set, the redundancy level of the RAID set, a | | 566 | the RAID set, the redundancy level of the RAID set, a |
560 | .Sq modification counter , | | 567 | .Sq modification counter , |
561 | and whether the parity information (if any) on that | | 568 | and whether the parity information (if any) on that |
562 | component is known to be correct. | | 569 | component is known to be correct. |
563 | Component labels are an integral part of the RAID set, | | 570 | Component labels are an integral part of the RAID set, |
564 | since they are used to ensure that components | | 571 | since they are used to ensure that components |
565 | are configured in the correct order, and used to keep track of other | | 572 | are configured in the correct order, and used to keep track of other |
566 | vital information about the RAID set. | | 573 | vital information about the RAID set. |
567 | Component labels are also required for the auto-detection | | 574 | Component labels are also required for the auto-detection |
568 | and auto-configuration of RAID sets at boot time. | | 575 | and auto-configuration of RAID sets at boot time. |
569 | For a component label to be considered valid, that | | 576 | For a component label to be considered valid, that |
570 | particular component label must be in agreement with the other | | 577 | particular component label must be in agreement with the other |
571 | component labels in the set. | | 578 | component labels in the set. |
572 | For example, the serial number, | | 579 | For example, the serial number, |
573 | .Sq modification counter , | | 580 | .Sq modification counter , |
574 | and number of columns must all be in agreement. | | 581 | and number of columns must all be in agreement. |
575 | If any of these are different, then the component is | | 582 | If any of these are different, then the component is |
576 | not considered to be part of the set. | | 583 | not considered to be part of the set. |
577 | See | | 584 | See |
578 | .Xr raid 4 | | 585 | .Xr raid 4 |
579 | for more information about component labels. | | 586 | for more information about component labels. |
580 | .Pp | | 587 | .Pp |
581 | Once the components have been identified, and the disks have | | 588 | Once the components have been identified, and the disks have |
582 | appropriate labels, | | 589 | appropriate labels, |
583 | .Nm | | 590 | .Nm |
584 | is then used to configure the | | 591 | is then used to configure the |
585 | .Xr raid 4 | | 592 | .Xr raid 4 |
586 | device. | | 593 | device. |
587 | To configure the device, a configuration file which looks something like: | | 594 | To configure the device, a configuration file which looks something like: |
588 | .Bd -literal -offset indent | | 595 | .Bd -literal -offset indent |
589 | START array | | 596 | START array |
590 | # numCol numSpare | | 597 | # numCol numSpare |
591 | 3 1 | | 598 | 3 1 |
592 | | | 599 | |
593 | START disks | | 600 | START disks |
594 | /dev/sd1e | | 601 | /dev/sd1e |
595 | /dev/sd2e | | 602 | /dev/sd2e |
596 | /dev/sd3e | | 603 | /dev/sd3e |
597 | | | 604 | |
598 | START spare | | 605 | START spare |
599 | /dev/sd4e | | 606 | /dev/sd4e |
600 | | | 607 | |
601 | START layout | | 608 | START layout |
602 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5 | | 609 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5 |
603 | 32 1 1 5 | | 610 | 32 1 1 5 |
604 | | | 611 | |
605 | START queue | | 612 | START queue |
606 | fifo 100 | | 613 | fifo 100 |
607 | .Ed | | 614 | .Ed |
608 | .Pp | | 615 | .Pp |
609 | is created in a file. | | 616 | is created in a file. |
610 | The above configuration file specifies a RAID 5 | | 617 | The above configuration file specifies a RAID 5 |
611 | set consisting of the components | | 618 | set consisting of the components |
612 | .Pa /dev/sd1e , | | 619 | .Pa /dev/sd1e , |
613 | .Pa /dev/sd2e , | | 620 | .Pa /dev/sd2e , |
614 | and | | 621 | and |
615 | .Pa /dev/sd3e , | | 622 | .Pa /dev/sd3e , |
616 | with | | 623 | with |
617 | .Pa /dev/sd4e | | 624 | .Pa /dev/sd4e |
618 | available as a | | 625 | available as a |
619 | .Sq hot spare | | 626 | .Sq hot spare |
620 | in case one of the three main drives should fail. | | 627 | in case one of the three main drives should fail. |
621 | A RAID 0 set would be specified in a similar way: | | 628 | A RAID 0 set would be specified in a similar way: |
622 | .Bd -literal -offset indent | | 629 | .Bd -literal -offset indent |
623 | START array | | 630 | START array |
624 | # numCol numSpare | | 631 | # numCol numSpare |
625 | 4 0 | | 632 | 4 0 |
626 | | | 633 | |
627 | START disks | | 634 | START disks |
628 | /dev/sd10e | | 635 | /dev/sd10e |
629 | /dev/sd11e | | 636 | /dev/sd11e |
630 | /dev/sd12e | | 637 | /dev/sd12e |
631 | /dev/sd13e | | 638 | /dev/sd13e |
632 | | | 639 | |
633 | START layout | | 640 | START layout |
634 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_0 | | 641 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_0 |
635 | 64 1 1 0 | | 642 | 64 1 1 0 |
636 | | | 643 | |
637 | START queue | | 644 | START queue |
638 | fifo 100 | | 645 | fifo 100 |
639 | .Ed | | 646 | .Ed |
640 | .Pp | | 647 | .Pp |
641 | In this case, devices | | 648 | In this case, devices |
642 | .Pa /dev/sd10e , | | 649 | .Pa /dev/sd10e , |
643 | .Pa /dev/sd11e , | | 650 | .Pa /dev/sd11e , |
644 | .Pa /dev/sd12e , | | 651 | .Pa /dev/sd12e , |
645 | and | | 652 | and |
646 | .Pa /dev/sd13e | | 653 | .Pa /dev/sd13e |
647 | are the components that make up this RAID set. | | 654 | are the components that make up this RAID set. |
648 | Note that there are no hot spares for a RAID 0 set, | | 655 | Note that there are no hot spares for a RAID 0 set, |
649 | since there is no way to recover data if any of the components fail. | | 656 | since there is no way to recover data if any of the components fail. |
650 | .Pp | | 657 | .Pp |
651 | For a RAID 1 (mirror) set, the following configuration might be used: | | 658 | For a RAID 1 (mirror) set, the following configuration might be used: |
652 | .Bd -literal -offset indent | | 659 | .Bd -literal -offset indent |
653 | START array | | 660 | START array |
654 | # numCol numSpare | | 661 | # numCol numSpare |
655 | 2 0 | | 662 | 2 0 |
656 | | | 663 | |
657 | START disks | | 664 | START disks |
658 | /dev/sd20e | | 665 | /dev/sd20e |
659 | /dev/sd21e | | 666 | /dev/sd21e |
660 | | | 667 | |
661 | START layout | | 668 | START layout |
662 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1 | | 669 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1 |
663 | 128 1 1 1 | | 670 | 128 1 1 1 |
664 | | | 671 | |
665 | START queue | | 672 | START queue |
666 | fifo 100 | | 673 | fifo 100 |
667 | .Ed | | 674 | .Ed |
668 | .Pp | | 675 | .Pp |
669 | In this case, | | 676 | In this case, |
670 | .Pa /dev/sd20e | | 677 | .Pa /dev/sd20e |
671 | and | | 678 | and |
672 | .Pa /dev/sd21e | | 679 | .Pa /dev/sd21e |
673 | are the two components of the mirror set. | | 680 | are the two components of the mirror set. |
674 | While no hot spares have been specified in this | | 681 | While no hot spares have been specified in this |
675 | configuration, they easily could be, just as they were specified in | | 682 | configuration, they easily could be, just as they were specified in |
676 | the RAID 5 case above. | | 683 | the RAID 5 case above. |
677 | Note as well that RAID 1 sets are currently limited to only 2 components. | | 684 | Note as well that RAID 1 sets are currently limited to only 2 components. |
678 | At present, n-way mirroring is not possible. | | 685 | At present, n-way mirroring is not possible. |
679 | .Pp | | 686 | .Pp |
680 | The first time a RAID set is configured, the | | 687 | The first time a RAID set is configured, the |
681 | .Fl C | | 688 | .Fl C |
682 | option must be used: | | 689 | option must be used: |
683 | .Bd -literal -offset indent | | 690 | .Bd -literal -offset indent |
684 | raidctl -C raid0.conf raid0 | | 691 | raidctl -C raid0.conf raid0 |
685 | .Ed | | 692 | .Ed |
686 | .Pp | | 693 | .Pp |
687 | where | | 694 | where |
688 | .Pa raid0.conf | | 695 | .Pa raid0.conf |
689 | is the name of the RAID configuration file. | | 696 | is the name of the RAID configuration file. |
690 | The | | 697 | The |
691 | .Fl C | | 698 | .Fl C |
692 | forces the configuration to succeed, even if any of the component | | 699 | forces the configuration to succeed, even if any of the component |
693 | labels are incorrect. | | 700 | labels are incorrect. |
694 | The | | 701 | The |
695 | .Fl C | | 702 | .Fl C |
696 | option should not be used lightly in | | 703 | option should not be used lightly in |
697 | situations other than initial configurations, as if | | 704 | situations other than initial configurations, as if |
698 | the system is refusing to configure a RAID set, there is probably a | | 705 | the system is refusing to configure a RAID set, there is probably a |
699 | very good reason for it. | | 706 | very good reason for it. |
700 | After the initial configuration is done (and | | 707 | After the initial configuration is done (and |
701 | appropriate component labels are added with the | | 708 | appropriate component labels are added with the |
702 | .Fl I | | 709 | .Fl I |
703 | option) then raid0 can be configured normally with: | | 710 | option) then raid0 can be configured normally with: |
704 | .Bd -literal -offset indent | | 711 | .Bd -literal -offset indent |
705 | raidctl -c raid0.conf raid0 | | 712 | raidctl -c raid0.conf raid0 |
706 | .Ed | | 713 | .Ed |
707 | .Pp | | 714 | .Pp |
708 | When the RAID set is configured for the first time, it is | | 715 | When the RAID set is configured for the first time, it is |
709 | necessary to initialize the component labels, and to initialize the | | 716 | necessary to initialize the component labels, and to initialize the |
710 | parity on the RAID set. | | 717 | parity on the RAID set. |
711 | Initializing the component labels is done with: | | 718 | Initializing the component labels is done with: |
712 | .Bd -literal -offset indent | | 719 | .Bd -literal -offset indent |
713 | raidctl -I 112341 raid0 | | 720 | raidctl -I 112341 raid0 |
714 | .Ed | | 721 | .Ed |
715 | .Pp | | 722 | .Pp |
716 | where | | 723 | where |
717 | .Sq 112341 | | 724 | .Sq 112341 |
718 | is a user-specified serial number for the RAID set. | | 725 | is a user-specified serial number for the RAID set. |
719 | This initialization step is | | 726 | This initialization step is |
720 | .Em required | | 727 | .Em required |
721 | for all RAID sets. | | 728 | for all RAID sets. |
722 | As well, using different serial numbers between RAID sets is | | 729 | As well, using different serial numbers between RAID sets is |
723 | .Em strongly encouraged , | | 730 | .Em strongly encouraged , |
724 | as using the same serial number for all RAID sets will only serve to | | 731 | as using the same serial number for all RAID sets will only serve to |
725 | decrease the usefulness of the component label checking. | | 732 | decrease the usefulness of the component label checking. |
726 | .Pp | | 733 | .Pp |
727 | Initializing the RAID set is done via the | | 734 | Initializing the RAID set is done via the |
728 | .Fl i | | 735 | .Fl i |
729 | option. | | 736 | option. |
730 | This initialization | | 737 | This initialization |
731 | .Em MUST | | 738 | .Em MUST |
732 | be done for | | 739 | be done for |
733 | .Em all | | 740 | .Em all |
734 | RAID sets, since among other things it verifies that the parity (if | | 741 | RAID sets, since among other things it verifies that the parity (if |
735 | any) on the RAID set is correct. | | 742 | any) on the RAID set is correct. |
736 | Since this initialization may be quite time-consuming, the | | 743 | Since this initialization may be quite time-consuming, the |
737 | .Fl v | | 744 | .Fl v |
738 | option may be also used in conjunction with | | 745 | option may be also used in conjunction with |
739 | .Fl i : | | 746 | .Fl i : |
740 | .Bd -literal -offset indent | | 747 | .Bd -literal -offset indent |
741 | raidctl -iv raid0 | | 748 | raidctl -iv raid0 |
742 | .Ed | | 749 | .Ed |
743 | .Pp | | 750 | .Pp |
744 | This will give more verbose output on the | | 751 | This will give more verbose output on the |
745 | status of the initialization: | | 752 | status of the initialization: |
746 | .Bd -literal -offset indent | | 753 | .Bd -literal -offset indent |
747 | Initiating re-write of parity | | 754 | Initiating re-write of parity |
748 | Parity Re-write status: | | 755 | Parity Re-write status: |
749 | 10% |**** | ETA: 06:03 / | | 756 | 10% |**** | ETA: 06:03 / |
750 | .Ed | | 757 | .Ed |
751 | .Pp | | 758 | .Pp |
752 | The output provides a | | 759 | The output provides a |
753 | .Sq Percent Complete | | 760 | .Sq Percent Complete |
754 | in both a numeric and graphical format, as well as an estimated time | | 761 | in both a numeric and graphical format, as well as an estimated time |
755 | to completion of the operation. | | 762 | to completion of the operation. |
756 | .Pp | | 763 | .Pp |
757 | Since it is the parity that provides the | | 764 | Since it is the parity that provides the |
758 | .Sq redundancy | | 765 | .Sq redundancy |
759 | part of RAID, it is critical that the parity is correct as much as possible. | | 766 | part of RAID, it is critical that the parity is correct as much as possible. |
760 | If the parity is not correct, then there is no | | 767 | If the parity is not correct, then there is no |
761 | guarantee that data will not be lost if a component fails. | | 768 | guarantee that data will not be lost if a component fails. |
762 | .Pp | | 769 | .Pp |
763 | Once the parity is known to be correct, it is then safe to perform | | 770 | Once the parity is known to be correct, it is then safe to perform |
764 | .Xr disklabel 8 , | | 771 | .Xr disklabel 8 , |
765 | .Xr newfs 8 , | | 772 | .Xr newfs 8 , |
766 | or | | 773 | or |
767 | .Xr fsck 8 | | 774 | .Xr fsck 8 |
768 | on the device or its file systems, and then to mount the file systems | | 775 | on the device or its file systems, and then to mount the file systems |
769 | for use. | | 776 | for use. |
770 | .Pp | | 777 | .Pp |
771 | Under certain circumstances (e.g., the additional component has not | | 778 | Under certain circumstances (e.g., the additional component has not |
772 | arrived, or data is being migrated off of a disk destined to become a | | 779 | arrived, or data is being migrated off of a disk destined to become a |
773 | component) it may be desirable to configure a RAID 1 set with only | | 780 | component) it may be desirable to configure a RAID 1 set with only |
774 | a single component. | | 781 | a single component. |
775 | This can be achieved by using the word | | 782 | This can be achieved by using the word |
776 | .Dq absent | | 783 | .Dq absent |
777 | to indicate that a particular component is not present. | | 784 | to indicate that a particular component is not present. |
778 | In the following: | | 785 | In the following: |
779 | .Bd -literal -offset indent | | 786 | .Bd -literal -offset indent |
780 | START array | | 787 | START array |
781 | # numCol numSpare | | 788 | # numCol numSpare |
782 | 2 0 | | 789 | 2 0 |
783 | | | 790 | |
784 | START disks | | 791 | START disks |
785 | absent | | 792 | absent |
786 | /dev/sd0e | | 793 | /dev/sd0e |
787 | | | 794 | |
788 | START layout | | 795 | START layout |
789 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1 | | 796 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_1 |
790 | 128 1 1 1 | | 797 | 128 1 1 1 |
791 | | | 798 | |
792 | START queue | | 799 | START queue |
793 | fifo 100 | | 800 | fifo 100 |
794 | .Ed | | 801 | .Ed |
795 | .Pp | | 802 | .Pp |
796 | .Pa /dev/sd0e | | 803 | .Pa /dev/sd0e |
797 | is the real component, and will be the second disk of a RAID 1 set. | | 804 | is the real component, and will be the second disk of a RAID 1 set. |
798 | The first component is simply marked as being absent. | | 805 | The first component is simply marked as being absent. |
799 | Configuration (using | | 806 | Configuration (using |
800 | .Fl C | | 807 | .Fl C |
801 | and | | 808 | and |
802 | .Fl I Ar 12345 | | 809 | .Fl I Ar 12345 |
803 | as above) proceeds normally, but initialization of the RAID set will | | 810 | as above) proceeds normally, but initialization of the RAID set will |
804 | have to wait until all physical components are present. | | 811 | have to wait until all physical components are present. |
805 | After configuration, this set can be used normally, but will be operating | | 812 | After configuration, this set can be used normally, but will be operating |
806 | in degraded mode. | | 813 | in degraded mode. |
807 | Once a second physical component is obtained, it can be hot-added, | | 814 | Once a second physical component is obtained, it can be hot-added, |
808 | the existing data mirrored, and normal operation resumed. | | 815 | the existing data mirrored, and normal operation resumed. |
809 | .Pp | | 816 | .Pp |
810 | The size of the resulting RAID set will depend on the number of data | | 817 | The size of the resulting RAID set will depend on the number of data |
811 | components in the set. | | 818 | components in the set. |
812 | Space is automatically reserved for the component labels, and | | 819 | Space is automatically reserved for the component labels, and |
813 | the actual amount of space used | | 820 | the actual amount of space used |
814 | for data on a component will be rounded down to the largest possible | | 821 | for data on a component will be rounded down to the largest possible |
815 | multiple of the sectors per stripe unit (sectPerSU) value. | | 822 | multiple of the sectors per stripe unit (sectPerSU) value. |
816 | Thus, the amount of space provided by the RAID set will be less | | 823 | Thus, the amount of space provided by the RAID set will be less |
817 | than the sum of the size of the components. | | 824 | than the sum of the size of the components. |
818 | .Ss Maintenance of the RAID set | | 825 | .Ss Maintenance of the RAID set |
819 | After the parity has been initialized for the first time, the command: | | 826 | After the parity has been initialized for the first time, the command: |
820 | .Bd -literal -offset indent | | 827 | .Bd -literal -offset indent |
821 | raidctl -p raid0 | | 828 | raidctl -p raid0 |
822 | .Ed | | 829 | .Ed |
823 | .Pp | | 830 | .Pp |
824 | can be used to check the current status of the parity. | | 831 | can be used to check the current status of the parity. |
825 | To check the parity and rebuild it necessary (for example, | | 832 | To check the parity and rebuild it necessary (for example, |
826 | after an unclean shutdown) the command: | | 833 | after an unclean shutdown) the command: |
827 | .Bd -literal -offset indent | | 834 | .Bd -literal -offset indent |
828 | raidctl -P raid0 | | 835 | raidctl -P raid0 |
829 | .Ed | | 836 | .Ed |
830 | .Pp | | 837 | .Pp |
831 | is used. | | 838 | is used. |
832 | Note that re-writing the parity can be done while | | 839 | Note that re-writing the parity can be done while |
833 | other operations on the RAID set are taking place (e.g., while doing a | | 840 | other operations on the RAID set are taking place (e.g., while doing a |
834 | .Xr fsck 8 | | 841 | .Xr fsck 8 |
835 | on a file system on the RAID set). | | 842 | on a file system on the RAID set). |
836 | However: for maximum effectiveness of the RAID set, the parity should be | | 843 | However: for maximum effectiveness of the RAID set, the parity should be |
837 | known to be correct before any data on the set is modified. | | 844 | known to be correct before any data on the set is modified. |
838 | .Pp | | 845 | .Pp |
839 | To see how the RAID set is doing, the following command can be used to | | 846 | To see how the RAID set is doing, the following command can be used to |
840 | show the RAID set's status: | | 847 | show the RAID set's status: |
841 | .Bd -literal -offset indent | | 848 | .Bd -literal -offset indent |
842 | raidctl -s raid0 | | 849 | raidctl -s raid0 |
843 | .Ed | | 850 | .Ed |
844 | .Pp | | 851 | .Pp |
845 | The output will look something like: | | 852 | The output will look something like: |
846 | .Bd -literal -offset indent | | 853 | .Bd -literal -offset indent |
847 | Components: | | 854 | Components: |
848 | /dev/sd1e: optimal | | 855 | /dev/sd1e: optimal |
849 | /dev/sd2e: optimal | | 856 | /dev/sd2e: optimal |
850 | /dev/sd3e: optimal | | 857 | /dev/sd3e: optimal |
851 | Spares: | | 858 | Spares: |
852 | /dev/sd4e: spare | | 859 | /dev/sd4e: spare |
853 | Component label for /dev/sd1e: | | 860 | Component label for /dev/sd1e: |
854 | Row: 0 Column: 0 Num Rows: 1 Num Columns: 3 | | 861 | Row: 0 Column: 0 Num Rows: 1 Num Columns: 3 |
855 | Version: 2 Serial Number: 13432 Mod Counter: 65 | | 862 | Version: 2 Serial Number: 13432 Mod Counter: 65 |
856 | Clean: No Status: 0 | | 863 | Clean: No Status: 0 |
857 | sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1 | | 864 | sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1 |
858 | RAID Level: 5 blocksize: 512 numBlocks: 1799936 | | 865 | RAID Level: 5 blocksize: 512 numBlocks: 1799936 |
859 | Autoconfig: No | | 866 | Autoconfig: No |
860 | Last configured as: raid0 | | 867 | Last configured as: raid0 |
861 | Component label for /dev/sd2e: | | 868 | Component label for /dev/sd2e: |
862 | Row: 0 Column: 1 Num Rows: 1 Num Columns: 3 | | 869 | Row: 0 Column: 1 Num Rows: 1 Num Columns: 3 |
863 | Version: 2 Serial Number: 13432 Mod Counter: 65 | | 870 | Version: 2 Serial Number: 13432 Mod Counter: 65 |
864 | Clean: No Status: 0 | | 871 | Clean: No Status: 0 |
865 | sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1 | | 872 | sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1 |
866 | RAID Level: 5 blocksize: 512 numBlocks: 1799936 | | 873 | RAID Level: 5 blocksize: 512 numBlocks: 1799936 |
867 | Autoconfig: No | | 874 | Autoconfig: No |
868 | Last configured as: raid0 | | 875 | Last configured as: raid0 |
869 | Component label for /dev/sd3e: | | 876 | Component label for /dev/sd3e: |
870 | Row: 0 Column: 2 Num Rows: 1 Num Columns: 3 | | 877 | Row: 0 Column: 2 Num Rows: 1 Num Columns: 3 |
871 | Version: 2 Serial Number: 13432 Mod Counter: 65 | | 878 | Version: 2 Serial Number: 13432 Mod Counter: 65 |
872 | Clean: No Status: 0 | | 879 | Clean: No Status: 0 |
873 | sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1 | | 880 | sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1 |
874 | RAID Level: 5 blocksize: 512 numBlocks: 1799936 | | 881 | RAID Level: 5 blocksize: 512 numBlocks: 1799936 |
875 | Autoconfig: No | | 882 | Autoconfig: No |
876 | Last configured as: raid0 | | 883 | Last configured as: raid0 |
877 | Parity status: clean | | 884 | Parity status: clean |
878 | Reconstruction is 100% complete. | | 885 | Reconstruction is 100% complete. |
879 | Parity Re-write is 100% complete. | | 886 | Parity Re-write is 100% complete. |
880 | Copyback is 100% complete. | | 887 | Copyback is 100% complete. |
881 | .Ed | | 888 | .Ed |
882 | .Pp | | 889 | .Pp |
883 | This indicates that all is well with the RAID set. | | 890 | This indicates that all is well with the RAID set. |
884 | Of importance here are the component lines which read | | 891 | Of importance here are the component lines which read |
885 | .Sq optimal , | | 892 | .Sq optimal , |
886 | and the | | 893 | and the |
887 | .Sq Parity status | | 894 | .Sq Parity status |
888 | line. | | 895 | line. |
889 | .Sq Parity status: clean | | 896 | .Sq Parity status: clean |
890 | indicates that the parity is up-to-date for this RAID set, | | 897 | indicates that the parity is up-to-date for this RAID set, |
891 | whether or not the RAID set is in redundant or degraded mode. | | 898 | whether or not the RAID set is in redundant or degraded mode. |
892 | .Sq Parity status: DIRTY | | 899 | .Sq Parity status: DIRTY |
893 | indicates that it is not known if the parity information is | | 900 | indicates that it is not known if the parity information is |
894 | consistent with the data, and that the parity information needs | | 901 | consistent with the data, and that the parity information needs |
895 | to be checked. | | 902 | to be checked. |
896 | Note that if there are file systems open on the RAID set, | | 903 | Note that if there are file systems open on the RAID set, |
897 | the individual components will not be | | 904 | the individual components will not be |
898 | .Sq clean | | 905 | .Sq clean |
899 | but the set as a whole can still be clean. | | 906 | but the set as a whole can still be clean. |
900 | .Pp | | 907 | .Pp |
901 | To check the component label of | | 908 | To check the component label of |
902 | .Pa /dev/sd1e , | | 909 | .Pa /dev/sd1e , |
903 | the following is used: | | 910 | the following is used: |
904 | .Bd -literal -offset indent | | 911 | .Bd -literal -offset indent |
905 | raidctl -g /dev/sd1e raid0 | | 912 | raidctl -g /dev/sd1e raid0 |
906 | .Ed | | 913 | .Ed |
907 | .Pp | | 914 | .Pp |
908 | The output of this command will look something like: | | 915 | The output of this command will look something like: |
909 | .Bd -literal -offset indent | | 916 | .Bd -literal -offset indent |
910 | Component label for /dev/sd1e: | | 917 | Component label for /dev/sd1e: |
911 | Row: 0 Column: 0 Num Rows: 1 Num Columns: 3 | | 918 | Row: 0 Column: 0 Num Rows: 1 Num Columns: 3 |
912 | Version: 2 Serial Number: 13432 Mod Counter: 65 | | 919 | Version: 2 Serial Number: 13432 Mod Counter: 65 |
913 | Clean: No Status: 0 | | 920 | Clean: No Status: 0 |
914 | sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1 | | 921 | sectPerSU: 32 SUsPerPU: 1 SUsPerRU: 1 |
915 | RAID Level: 5 blocksize: 512 numBlocks: 1799936 | | 922 | RAID Level: 5 blocksize: 512 numBlocks: 1799936 |
916 | Autoconfig: No | | 923 | Autoconfig: No |
917 | Last configured as: raid0 | | 924 | Last configured as: raid0 |
918 | .Ed | | 925 | .Ed |
919 | .Ss Dealing with Component Failures | | 926 | .Ss Dealing with Component Failures |
920 | If for some reason | | 927 | If for some reason |
921 | (perhaps to test reconstruction) it is necessary to pretend a drive | | 928 | (perhaps to test reconstruction) it is necessary to pretend a drive |
922 | has failed, the following will perform that function: | | 929 | has failed, the following will perform that function: |
923 | .Bd -literal -offset indent | | 930 | .Bd -literal -offset indent |
924 | raidctl -f /dev/sd2e raid0 | | 931 | raidctl -f /dev/sd2e raid0 |
925 | .Ed | | 932 | .Ed |
926 | .Pp | | 933 | .Pp |
927 | The system will then be performing all operations in degraded mode, | | 934 | The system will then be performing all operations in degraded mode, |
928 | where missing data is re-computed from existing data and the parity. | | 935 | where missing data is re-computed from existing data and the parity. |
929 | In this case, obtaining the status of raid0 will return (in part): | | 936 | In this case, obtaining the status of raid0 will return (in part): |
930 | .Bd -literal -offset indent | | 937 | .Bd -literal -offset indent |
931 | Components: | | 938 | Components: |
932 | /dev/sd1e: optimal | | 939 | /dev/sd1e: optimal |
933 | /dev/sd2e: failed | | 940 | /dev/sd2e: failed |
934 | /dev/sd3e: optimal | | 941 | /dev/sd3e: optimal |
935 | Spares: | | 942 | Spares: |
936 | /dev/sd4e: spare | | 943 | /dev/sd4e: spare |
937 | .Ed | | 944 | .Ed |
938 | .Pp | | 945 | .Pp |
939 | Note that with the use of | | 946 | Note that with the use of |
940 | .Fl f | | 947 | .Fl f |
941 | a reconstruction has not been started. | | 948 | a reconstruction has not been started. |
942 | To both fail the disk and start a reconstruction, the | | 949 | To both fail the disk and start a reconstruction, the |
943 | .Fl F | | 950 | .Fl F |
944 | option must be used: | | 951 | option must be used: |
945 | .Bd -literal -offset indent | | 952 | .Bd -literal -offset indent |
946 | raidctl -F /dev/sd2e raid0 | | 953 | raidctl -F /dev/sd2e raid0 |
947 | .Ed | | 954 | .Ed |
948 | .Pp | | 955 | .Pp |
949 | The | | 956 | The |
950 | .Fl f | | 957 | .Fl f |
951 | option may be used first, and then the | | 958 | option may be used first, and then the |
952 | .Fl F | | 959 | .Fl F |
953 | option used later, on the same disk, if desired. | | 960 | option used later, on the same disk, if desired. |
954 | Immediately after the reconstruction is started, the status will report: | | 961 | Immediately after the reconstruction is started, the status will report: |
955 | .Bd -literal -offset indent | | 962 | .Bd -literal -offset indent |
956 | Components: | | 963 | Components: |
957 | /dev/sd1e: optimal | | 964 | /dev/sd1e: optimal |
958 | /dev/sd2e: reconstructing | | 965 | /dev/sd2e: reconstructing |
959 | /dev/sd3e: optimal | | 966 | /dev/sd3e: optimal |
960 | Spares: | | 967 | Spares: |
961 | /dev/sd4e: used_spare | | 968 | /dev/sd4e: used_spare |
962 | [...] | | 969 | [...] |
963 | Parity status: clean | | 970 | Parity status: clean |
964 | Reconstruction is 10% complete. | | 971 | Reconstruction is 10% complete. |
965 | Parity Re-write is 100% complete. | | 972 | Parity Re-write is 100% complete. |
966 | Copyback is 100% complete. | | 973 | Copyback is 100% complete. |
967 | .Ed | | 974 | .Ed |
968 | .Pp | | 975 | .Pp |
969 | This indicates that a reconstruction is in progress. | | 976 | This indicates that a reconstruction is in progress. |
970 | To find out how the reconstruction is progressing the | | 977 | To find out how the reconstruction is progressing the |
971 | .Fl S | | 978 | .Fl S |
972 | option may be used. | | 979 | option may be used. |
973 | This will indicate the progress in terms of the | | 980 | This will indicate the progress in terms of the |
974 | percentage of the reconstruction that is completed. | | 981 | percentage of the reconstruction that is completed. |
975 | When the reconstruction is finished the | | 982 | When the reconstruction is finished the |
976 | .Fl s | | 983 | .Fl s |
977 | option will show: | | 984 | option will show: |
978 | .Bd -literal -offset indent | | 985 | .Bd -literal -offset indent |
979 | Components: | | 986 | Components: |
980 | /dev/sd1e: optimal | | 987 | /dev/sd1e: optimal |
981 | /dev/sd2e: spared | | 988 | /dev/sd2e: spared |
982 | /dev/sd3e: optimal | | 989 | /dev/sd3e: optimal |
983 | Spares: | | 990 | Spares: |
984 | /dev/sd4e: used_spare | | 991 | /dev/sd4e: used_spare |
985 | [...] | | 992 | [...] |
986 | Parity status: clean | | 993 | Parity status: clean |
987 | Reconstruction is 100% complete. | | 994 | Reconstruction is 100% complete. |
988 | Parity Re-write is 100% complete. | | 995 | Parity Re-write is 100% complete. |
989 | Copyback is 100% complete. | | 996 | Copyback is 100% complete. |
990 | .Ed | | 997 | .Ed |
991 | .Pp | | 998 | .Pp |
992 | At this point there are at least two options. | | 999 | At this point there are at least two options. |
993 | First, if | | 1000 | First, if |
994 | .Pa /dev/sd2e | | 1001 | .Pa /dev/sd2e |
995 | is known to be good (i.e., the failure was either caused by | | 1002 | is known to be good (i.e., the failure was either caused by |
996 | .Fl f | | 1003 | .Fl f |
997 | or | | 1004 | or |
998 | .Fl F , | | 1005 | .Fl F , |
999 | or the failed disk was replaced), then a copyback of the data can | | 1006 | or the failed disk was replaced), then a copyback of the data can |
1000 | be initiated with the | | 1007 | be initiated with the |
1001 | .Fl B | | 1008 | .Fl B |
1002 | option. | | 1009 | option. |
1003 | In this example, this would copy the entire contents of | | 1010 | In this example, this would copy the entire contents of |
1004 | .Pa /dev/sd4e | | 1011 | .Pa /dev/sd4e |
1005 | to | | 1012 | to |
1006 | .Pa /dev/sd2e . | | 1013 | .Pa /dev/sd2e . |
1007 | Once the copyback procedure is complete, the | | 1014 | Once the copyback procedure is complete, the |
1008 | status of the device would be (in part): | | 1015 | status of the device would be (in part): |
1009 | .Bd -literal -offset indent | | 1016 | .Bd -literal -offset indent |
1010 | Components: | | 1017 | Components: |
1011 | /dev/sd1e: optimal | | 1018 | /dev/sd1e: optimal |
1012 | /dev/sd2e: optimal | | 1019 | /dev/sd2e: optimal |
1013 | /dev/sd3e: optimal | | 1020 | /dev/sd3e: optimal |
1014 | Spares: | | 1021 | Spares: |
1015 | /dev/sd4e: spare | | 1022 | /dev/sd4e: spare |
1016 | .Ed | | 1023 | .Ed |
1017 | .Pp | | 1024 | .Pp |
1018 | and the system is back to normal operation. | | 1025 | and the system is back to normal operation. |
1019 | .Pp | | 1026 | .Pp |
1020 | The second option after the reconstruction is to simply use | | 1027 | The second option after the reconstruction is to simply use |
1021 | .Pa /dev/sd4e | | 1028 | .Pa /dev/sd4e |
1022 | in place of | | 1029 | in place of |
1023 | .Pa /dev/sd2e | | 1030 | .Pa /dev/sd2e |
1024 | in the configuration file. | | 1031 | in the configuration file. |
1025 | For example, the configuration file (in part) might now look like: | | 1032 | For example, the configuration file (in part) might now look like: |
1026 | .Bd -literal -offset indent | | 1033 | .Bd -literal -offset indent |
1027 | START array | | 1034 | START array |
1028 | 3 0 | | 1035 | 3 0 |
1029 | | | 1036 | |
1030 | START disks | | 1037 | START disks |
1031 | /dev/sd1e | | 1038 | /dev/sd1e |
1032 | /dev/sd4e | | 1039 | /dev/sd4e |
1033 | /dev/sd3e | | 1040 | /dev/sd3e |
1034 | .Ed | | 1041 | .Ed |
1035 | .Pp | | 1042 | .Pp |
1036 | This can be done as | | 1043 | This can be done as |
1037 | .Pa /dev/sd4e | | 1044 | .Pa /dev/sd4e |
1038 | is completely interchangeable with | | 1045 | is completely interchangeable with |
1039 | .Pa /dev/sd2e | | 1046 | .Pa /dev/sd2e |
1040 | at this point. | | 1047 | at this point. |
1041 | Note that extreme care must be taken when | | 1048 | Note that extreme care must be taken when |
1042 | changing the order of the drives in a configuration. | | 1049 | changing the order of the drives in a configuration. |
1043 | This is one of the few instances where the devices and/or | | 1050 | This is one of the few instances where the devices and/or |
1044 | their orderings can be changed without loss of data! | | 1051 | their orderings can be changed without loss of data! |
1045 | In general, the ordering of components in a configuration file should | | 1052 | In general, the ordering of components in a configuration file should |
1046 | .Em never | | 1053 | .Em never |
1047 | be changed. | | 1054 | be changed. |
1048 | .Pp | | 1055 | .Pp |
1049 | If a component fails and there are no hot spares | | 1056 | If a component fails and there are no hot spares |
1050 | available on-line, the status of the RAID set might (in part) look like: | | 1057 | available on-line, the status of the RAID set might (in part) look like: |
1051 | .Bd -literal -offset indent | | 1058 | .Bd -literal -offset indent |
1052 | Components: | | 1059 | Components: |
1053 | /dev/sd1e: optimal | | 1060 | /dev/sd1e: optimal |
1054 | /dev/sd2e: failed | | 1061 | /dev/sd2e: failed |
1055 | /dev/sd3e: optimal | | 1062 | /dev/sd3e: optimal |
1056 | No spares. | | 1063 | No spares. |
1057 | .Ed | | 1064 | .Ed |
1058 | .Pp | | 1065 | .Pp |
1059 | In this case there are a number of options. | | 1066 | In this case there are a number of options. |
1060 | The first option is to add a hot spare using: | | 1067 | The first option is to add a hot spare using: |
1061 | .Bd -literal -offset indent | | 1068 | .Bd -literal -offset indent |
1062 | raidctl -a /dev/sd4e raid0 | | 1069 | raidctl -a /dev/sd4e raid0 |
1063 | .Ed | | 1070 | .Ed |
1064 | .Pp | | 1071 | .Pp |
1065 | After the hot add, the status would then be: | | 1072 | After the hot add, the status would then be: |
1066 | .Bd -literal -offset indent | | 1073 | .Bd -literal -offset indent |
1067 | Components: | | 1074 | Components: |
1068 | /dev/sd1e: optimal | | 1075 | /dev/sd1e: optimal |
1069 | /dev/sd2e: failed | | 1076 | /dev/sd2e: failed |
1070 | /dev/sd3e: optimal | | 1077 | /dev/sd3e: optimal |
1071 | Spares: | | 1078 | Spares: |
1072 | /dev/sd4e: spare | | 1079 | /dev/sd4e: spare |
1073 | .Ed | | 1080 | .Ed |
1074 | .Pp | | 1081 | .Pp |
1075 | Reconstruction could then take place using | | 1082 | Reconstruction could then take place using |
1076 | .Fl F | | 1083 | .Fl F |
1077 | as describe above. | | 1084 | as describe above. |
1078 | .Pp | | 1085 | .Pp |
1079 | A second option is to rebuild directly onto | | 1086 | A second option is to rebuild directly onto |
1080 | .Pa /dev/sd2e . | | 1087 | .Pa /dev/sd2e . |
1081 | Once the disk containing | | 1088 | Once the disk containing |
1082 | .Pa /dev/sd2e | | 1089 | .Pa /dev/sd2e |
1083 | has been replaced, one can simply use: | | 1090 | has been replaced, one can simply use: |
1084 | .Bd -literal -offset indent | | 1091 | .Bd -literal -offset indent |
1085 | raidctl -R /dev/sd2e raid0 | | 1092 | raidctl -R /dev/sd2e raid0 |
1086 | .Ed | | 1093 | .Ed |
1087 | .Pp | | 1094 | .Pp |
1088 | to rebuild the | | 1095 | to rebuild the |
1089 | .Pa /dev/sd2e | | 1096 | .Pa /dev/sd2e |
1090 | component. | | 1097 | component. |
1091 | As the rebuilding is in progress, the status will be: | | 1098 | As the rebuilding is in progress, the status will be: |
1092 | .Bd -literal -offset indent | | 1099 | .Bd -literal -offset indent |
1093 | Components: | | 1100 | Components: |
1094 | /dev/sd1e: optimal | | 1101 | /dev/sd1e: optimal |
1095 | /dev/sd2e: reconstructing | | 1102 | /dev/sd2e: reconstructing |
1096 | /dev/sd3e: optimal | | 1103 | /dev/sd3e: optimal |
1097 | No spares. | | 1104 | No spares. |
1098 | .Ed | | 1105 | .Ed |
1099 | .Pp | | 1106 | .Pp |
1100 | and when completed, will be: | | 1107 | and when completed, will be: |
1101 | .Bd -literal -offset indent | | 1108 | .Bd -literal -offset indent |
1102 | Components: | | 1109 | Components: |
1103 | /dev/sd1e: optimal | | 1110 | /dev/sd1e: optimal |
1104 | /dev/sd2e: optimal | | 1111 | /dev/sd2e: optimal |
1105 | /dev/sd3e: optimal | | 1112 | /dev/sd3e: optimal |
1106 | No spares. | | 1113 | No spares. |
1107 | .Ed | | 1114 | .Ed |
1108 | .Pp | | 1115 | .Pp |
1109 | In circumstances where a particular component is completely | | 1116 | In circumstances where a particular component is completely |
1110 | unavailable after a reboot, a special component name will be used to | | 1117 | unavailable after a reboot, a special component name will be used to |
1111 | indicate the missing component. | | 1118 | indicate the missing component. |
1112 | For example: | | 1119 | For example: |
1113 | .Bd -literal -offset indent | | 1120 | .Bd -literal -offset indent |
1114 | Components: | | 1121 | Components: |
1115 | /dev/sd2e: optimal | | 1122 | /dev/sd2e: optimal |
1116 | component1: failed | | 1123 | component1: failed |
1117 | No spares. | | 1124 | No spares. |
1118 | .Ed | | 1125 | .Ed |
1119 | .Pp | | 1126 | .Pp |
1120 | indicates that the second component of this RAID set was not detected | | 1127 | indicates that the second component of this RAID set was not detected |
1121 | at all by the auto-configuration code. | | 1128 | at all by the auto-configuration code. |
1122 | The name | | 1129 | The name |
1123 | .Sq component1 | | 1130 | .Sq component1 |
1124 | can be used anywhere a normal component name would be used. | | 1131 | can be used anywhere a normal component name would be used. |
1125 | For example, to add a hot spare to the above set, and rebuild to that hot | | 1132 | For example, to add a hot spare to the above set, and rebuild to that hot |
1126 | spare, the following could be done: | | 1133 | spare, the following could be done: |
1127 | .Bd -literal -offset indent | | 1134 | .Bd -literal -offset indent |
1128 | raidctl -a /dev/sd3e raid0 | | 1135 | raidctl -a /dev/sd3e raid0 |
1129 | raidctl -F component1 raid0 | | 1136 | raidctl -F component1 raid0 |
1130 | .Ed | | 1137 | .Ed |
1131 | .Pp | | 1138 | .Pp |
1132 | at which point the data missing from | | 1139 | at which point the data missing from |
1133 | .Sq component1 | | 1140 | .Sq component1 |
1134 | would be reconstructed onto | | 1141 | would be reconstructed onto |
1135 | .Pa /dev/sd3e . | | 1142 | .Pa /dev/sd3e . |
1136 | .Pp | | 1143 | .Pp |
1137 | When more than one component is marked as | | 1144 | When more than one component is marked as |
1138 | .Sq failed | | 1145 | .Sq failed |
1139 | due to a non-component hardware failure (e.g., loss of power to two | | 1146 | due to a non-component hardware failure (e.g., loss of power to two |
1140 | components, adapter problems, termination problems, or cabling issues) it | | 1147 | components, adapter problems, termination problems, or cabling issues) it |
1141 | is quite possible to recover the data on the RAID set. | | 1148 | is quite possible to recover the data on the RAID set. |
1142 | The first thing to be aware of is that the first disk to fail will | | 1149 | The first thing to be aware of is that the first disk to fail will |
1143 | almost certainly be out-of-sync with the remainder of the array. | | 1150 | almost certainly be out-of-sync with the remainder of the array. |
1144 | If any IO was performed between the time the first component is considered | | 1151 | If any IO was performed between the time the first component is considered |
1145 | .Sq failed | | 1152 | .Sq failed |
1146 | and when the second component is considered | | 1153 | and when the second component is considered |
1147 | .Sq failed , | | 1154 | .Sq failed , |
1148 | then the first component to fail will | | 1155 | then the first component to fail will |
1149 | .Em not | | 1156 | .Em not |
1150 | contain correct data, and should be ignored. | | 1157 | contain correct data, and should be ignored. |
1151 | When the second component is marked as failed, however, the RAID device will | | 1158 | When the second component is marked as failed, however, the RAID device will |
1152 | (currently) panic the system. | | 1159 | (currently) panic the system. |
1153 | At this point the data on the RAID set | | 1160 | At this point the data on the RAID set |
1154 | (not including the first failed component) is still self consistent, | | 1161 | (not including the first failed component) is still self consistent, |
1155 | and will be in no worse state of repair than had the power gone out in | | 1162 | and will be in no worse state of repair than had the power gone out in |
1156 | the middle of a write to a file system on a non-RAID device. | | 1163 | the middle of a write to a file system on a non-RAID device. |
1157 | The problem, however, is that the component labels may now have 3 different | | 1164 | The problem, however, is that the component labels may now have 3 different |
1158 | .Sq modification counters | | 1165 | .Sq modification counters |
1159 | (one value on the first component that failed, one value on the second | | 1166 | (one value on the first component that failed, one value on the second |
1160 | component that failed, and a third value on the remaining components). | | 1167 | component that failed, and a third value on the remaining components). |
1161 | In such a situation, the RAID set will not autoconfigure, | | 1168 | In such a situation, the RAID set will not autoconfigure, |
1162 | and can only be forcibly re-configured | | 1169 | and can only be forcibly re-configured |
1163 | with the | | 1170 | with the |
1164 | .Fl C | | 1171 | .Fl C |
1165 | option. | | 1172 | option. |
1166 | To recover the RAID set, one must first remedy whatever physical | | 1173 | To recover the RAID set, one must first remedy whatever physical |
1167 | problem caused the multiple-component failure. | | 1174 | problem caused the multiple-component failure. |
1168 | After that is done, the RAID set can be restored by forcibly | | 1175 | After that is done, the RAID set can be restored by forcibly |
1169 | configuring the raid set | | 1176 | configuring the raid set |
1170 | .Em without | | 1177 | .Em without |
1171 | the component that failed first. | | 1178 | the component that failed first. |
1172 | For example, if | | 1179 | For example, if |
1173 | .Pa /dev/sd1e | | 1180 | .Pa /dev/sd1e |
1174 | and | | 1181 | and |
1175 | .Pa /dev/sd2e | | 1182 | .Pa /dev/sd2e |
1176 | fail (in that order) in a RAID set of the following configuration: | | 1183 | fail (in that order) in a RAID set of the following configuration: |
1177 | .Bd -literal -offset indent | | 1184 | .Bd -literal -offset indent |
1178 | START array | | 1185 | START array |
1179 | 4 0 | | 1186 | 4 0 |
1180 | | | 1187 | |
1181 | START disks | | 1188 | START disks |
1182 | /dev/sd1e | | 1189 | /dev/sd1e |
1183 | /dev/sd2e | | 1190 | /dev/sd2e |
1184 | /dev/sd3e | | 1191 | /dev/sd3e |
1185 | /dev/sd4e | | 1192 | /dev/sd4e |
1186 | | | 1193 | |
1187 | START layout | | 1194 | START layout |
1188 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5 | | 1195 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5 |
1189 | 64 1 1 5 | | 1196 | 64 1 1 5 |
1190 | | | 1197 | |
1191 | START queue | | 1198 | START queue |
1192 | fifo 100 | | 1199 | fifo 100 |
1193 | | | 1200 | |
1194 | .Ed | | 1201 | .Ed |
1195 | .Pp | | 1202 | .Pp |
1196 | then the following configuration (say "recover_raid0.conf") | | 1203 | then the following configuration (say "recover_raid0.conf") |
1197 | .Bd -literal -offset indent | | 1204 | .Bd -literal -offset indent |
1198 | START array | | 1205 | START array |
1199 | 4 0 | | 1206 | 4 0 |
1200 | | | 1207 | |
1201 | START disks | | 1208 | START disks |
1202 | absent | | 1209 | absent |
1203 | /dev/sd2e | | 1210 | /dev/sd2e |
1204 | /dev/sd3e | | 1211 | /dev/sd3e |
1205 | /dev/sd4e | | 1212 | /dev/sd4e |
1206 | | | 1213 | |
1207 | START layout | | 1214 | START layout |
1208 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5 | | 1215 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_5 |
1209 | 64 1 1 5 | | 1216 | 64 1 1 5 |
1210 | | | 1217 | |
1211 | START queue | | 1218 | START queue |
1212 | fifo 100 | | 1219 | fifo 100 |
1213 | .Ed | | 1220 | .Ed |
1214 | .Pp | | 1221 | .Pp |
1215 | can be used with | | 1222 | can be used with |
1216 | .Bd -literal -offset indent | | 1223 | .Bd -literal -offset indent |
1217 | raidctl -C recover_raid0.conf raid0 | | 1224 | raidctl -C recover_raid0.conf raid0 |
1218 | .Ed | | 1225 | .Ed |
1219 | .Pp | | 1226 | .Pp |
1220 | to force the configuration of raid0. | | 1227 | to force the configuration of raid0. |
1221 | A | | 1228 | A |
1222 | .Bd -literal -offset indent | | 1229 | .Bd -literal -offset indent |
1223 | raidctl -I 12345 raid0 | | 1230 | raidctl -I 12345 raid0 |
1224 | .Ed | | 1231 | .Ed |
1225 | .Pp | | 1232 | .Pp |
1226 | will be required in order to synchronize the component labels. | | 1233 | will be required in order to synchronize the component labels. |
1227 | At this point the file systems on the RAID set can then be checked and | | 1234 | At this point the file systems on the RAID set can then be checked and |
1228 | corrected. | | 1235 | corrected. |
1229 | To complete the re-construction of the RAID set, | | 1236 | To complete the re-construction of the RAID set, |
1230 | .Pa /dev/sd1e | | 1237 | .Pa /dev/sd1e |
1231 | is simply hot-added back into the array, and reconstructed | | 1238 | is simply hot-added back into the array, and reconstructed |
1232 | as described earlier. | | 1239 | as described earlier. |
1233 | .Ss RAID on RAID | | 1240 | .Ss RAID on RAID |
1234 | RAID sets can be layered to create more complex and much larger RAID sets. | | 1241 | RAID sets can be layered to create more complex and much larger RAID sets. |
1235 | A RAID 0 set, for example, could be constructed from four RAID 5 sets. | | 1242 | A RAID 0 set, for example, could be constructed from four RAID 5 sets. |
1236 | The following configuration file shows such a setup: | | 1243 | The following configuration file shows such a setup: |
1237 | .Bd -literal -offset indent | | 1244 | .Bd -literal -offset indent |
1238 | START array | | 1245 | START array |
1239 | # numCol numSpare | | 1246 | # numCol numSpare |
1240 | 4 0 | | 1247 | 4 0 |
1241 | | | 1248 | |
1242 | START disks | | 1249 | START disks |
1243 | /dev/raid1e | | 1250 | /dev/raid1e |
1244 | /dev/raid2e | | 1251 | /dev/raid2e |
1245 | /dev/raid3e | | 1252 | /dev/raid3e |
1246 | /dev/raid4e | | 1253 | /dev/raid4e |
1247 | | | 1254 | |
1248 | START layout | | 1255 | START layout |
1249 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_0 | | 1256 | # sectPerSU SUsPerParityUnit SUsPerReconUnit RAID_level_0 |
1250 | 128 1 1 0 | | 1257 | 128 1 1 0 |
1251 | | | 1258 | |
1252 | START queue | | 1259 | START queue |
1253 | fifo 100 | | 1260 | fifo 100 |
1254 | .Ed | | 1261 | .Ed |
1255 | .Pp | | 1262 | .Pp |
1256 | A similar configuration file might be used for a RAID 0 set | | 1263 | A similar configuration file might be used for a RAID 0 set |
1257 | constructed from components on RAID 1 sets. | | 1264 | constructed from components on RAID 1 sets. |
1258 | In such a configuration, the mirroring provides a high degree | | 1265 | In such a configuration, the mirroring provides a high degree |
1259 | of redundancy, while the striping provides additional speed benefits. | | 1266 | of redundancy, while the striping provides additional speed benefits. |
1260 | .Ss Auto-configuration and Root on RAID | | 1267 | .Ss Auto-configuration and Root on RAID |
1261 | RAID sets can also be auto-configured at boot. | | 1268 | RAID sets can also be auto-configured at boot. |
1262 | To make a set auto-configurable, | | 1269 | To make a set auto-configurable, |
1263 | simply prepare the RAID set as above, and then do a: | | 1270 | simply prepare the RAID set as above, and then do a: |
1264 | .Bd -literal -offset indent | | 1271 | .Bd -literal -offset indent |
1265 | raidctl -A yes raid0 | | 1272 | raidctl -A yes raid0 |
1266 | .Ed | | 1273 | .Ed |
1267 | .Pp | | 1274 | .Pp |
1268 | to turn on auto-configuration for that set. | | 1275 | to turn on auto-configuration for that set. |
1269 | To turn off auto-configuration, use: | | 1276 | To turn off auto-configuration, use: |
1270 | .Bd -literal -offset indent | | 1277 | .Bd -literal -offset indent |
1271 | raidctl -A no raid0 | | 1278 | raidctl -A no raid0 |
1272 | .Ed | | 1279 | .Ed |
1273 | .Pp | | 1280 | .Pp |
1274 | RAID sets which are auto-configurable will be configured before the | | 1281 | RAID sets which are auto-configurable will be configured before the |
1275 | root file system is mounted. | | 1282 | root file system is mounted. |
1276 | These RAID sets are thus available for | | 1283 | These RAID sets are thus available for |
1277 | use as a root file system, or for any other file system. | | 1284 | use as a root file system, or for any other file system. |
1278 | A primary advantage of using the auto-configuration is that RAID components | | 1285 | A primary advantage of using the auto-configuration is that RAID components |
1279 | become more independent of the disks they reside on. | | 1286 | become more independent of the disks they reside on. |
1280 | For example, SCSI ID's can change, but auto-configured sets will always be | | 1287 | For example, SCSI ID's can change, but auto-configured sets will always be |
1281 | configured correctly, even if the SCSI ID's of the component disks | | 1288 | configured correctly, even if the SCSI ID's of the component disks |
1282 | have become scrambled. | | 1289 | have become scrambled. |
1283 | .Pp | | 1290 | .Pp |
1284 | Having a system's root file system | | 1291 | Having a system's root file system |
1285 | .Pq Pa / | | 1292 | .Pq Pa / |
1286 | on a RAID set is also allowed, with the | | 1293 | on a RAID set is also allowed, with the |
1287 | .Sq a | | 1294 | .Sq a |
1288 | partition of such a RAID set being used for | | 1295 | partition of such a RAID set being used for |
1289 | .Pa / . | | 1296 | .Pa / . |
1290 | To use raid0a as the root file system, simply use: | | 1297 | To use raid0a as the root file system, simply use: |
1291 | .Bd -literal -offset indent | | 1298 | .Bd -literal -offset indent |
1292 | raidctl -A forceroot raid0 | | 1299 | raidctl -A forceroot raid0 |
1293 | .Ed | | 1300 | .Ed |
1294 | .Pp | | 1301 | .Pp |
1295 | To return raid0a to be just an auto-configuring set simply use the | | 1302 | To return raid0a to be just an auto-configuring set simply use the |
1296 | .Fl A Ar yes | | 1303 | .Fl A Ar yes |
1297 | arguments. | | 1304 | arguments. |
1298 | .Pp | | 1305 | .Pp |
1299 | Note that kernels can only be directly read from RAID 1 components on | | 1306 | Note that kernels can only be directly read from RAID 1 components on |
1300 | architectures that support that | | 1307 | architectures that support that |
1301 | .Pq currently alpha, i386, pmax, sandpoint, sparc, sparc64, and vax . | | 1308 | .Pq currently alpha, i386, pmax, sandpoint, sparc, sparc64, and vax . |
1302 | On those architectures, the | | 1309 | On those architectures, the |
1303 | .Dv FS_RAID | | 1310 | .Dv FS_RAID |
1304 | file system is recognized by the bootblocks, and will properly load the | | 1311 | file system is recognized by the bootblocks, and will properly load the |
1305 | kernel directly from a RAID 1 component. | | 1312 | kernel directly from a RAID 1 component. |
1306 | For other architectures, or to support the root file system | | 1313 | For other architectures, or to support the root file system |
1307 | on other RAID sets, some other mechanism must be used to get a kernel booting. | | 1314 | on other RAID sets, some other mechanism must be used to get a kernel booting. |
1308 | For example, a small partition containing only the secondary boot-blocks | | 1315 | For example, a small partition containing only the secondary boot-blocks |
1309 | and an alternate kernel (or two) could be used. | | 1316 | and an alternate kernel (or two) could be used. |
1310 | Once a kernel is booting however, and an auto-configuring RAID set is | | 1317 | Once a kernel is booting however, and an auto-configuring RAID set is |
1311 | found that is eligible to be root, then that RAID set will be | | 1318 | found that is eligible to be root, then that RAID set will be |
1312 | auto-configured and used as the root device. | | 1319 | auto-configured and used as the root device. |
1313 | If two or more RAID sets claim to be root devices, then the | | 1320 | If two or more RAID sets claim to be root devices, then the |
1314 | user will be prompted to select the root device. | | 1321 | user will be prompted to select the root device. |
1315 | At this time, RAID 0, 1, 4, and 5 sets are all supported as root devices. | | 1322 | At this time, RAID 0, 1, 4, and 5 sets are all supported as root devices. |
1316 | .Pp | | 1323 | .Pp |
1317 | A typical RAID 1 setup with root on RAID might be as follows: | | 1324 | A typical RAID 1 setup with root on RAID might be as follows: |
1318 | .Bl -enum | | 1325 | .Bl -enum |
1319 | .It | | 1326 | .It |
1320 | wd0a - a small partition, which contains a complete, bootable, basic | | 1327 | wd0a - a small partition, which contains a complete, bootable, basic |
1321 | .Nx | | 1328 | .Nx |
1322 | installation. | | 1329 | installation. |
1323 | .It | | 1330 | .It |
1324 | wd1a - also contains a complete, bootable, basic | | 1331 | wd1a - also contains a complete, bootable, basic |
1325 | .Nx | | 1332 | .Nx |
1326 | installation. | | 1333 | installation. |
1327 | .It | | 1334 | .It |
1328 | wd0e and wd1e - a RAID 1 set, raid0, used for the root file system. | | 1335 | wd0e and wd1e - a RAID 1 set, raid0, used for the root file system. |
1329 | .It | | 1336 | .It |
1330 | wd0f and wd1f - a RAID 1 set, raid1, which will be used only for | | 1337 | wd0f and wd1f - a RAID 1 set, raid1, which will be used only for |
1331 | swap space. | | 1338 | swap space. |
1332 | .It | | 1339 | .It |
1333 | wd0g and wd1g - a RAID 1 set, raid2, used for | | 1340 | wd0g and wd1g - a RAID 1 set, raid2, used for |
1334 | .Pa /usr , | | 1341 | .Pa /usr , |
1335 | .Pa /home , | | 1342 | .Pa /home , |
1336 | or other data, if desired. | | 1343 | or other data, if desired. |
1337 | .It | | 1344 | .It |
1338 | wd0h and wd1h - a RAID 1 set, raid3, if desired. | | 1345 | wd0h and wd1h - a RAID 1 set, raid3, if desired. |
1339 | .El | | 1346 | .El |
1340 | .Pp | | 1347 | .Pp |
1341 | RAID sets raid0, raid1, and raid2 are all marked as auto-configurable. | | 1348 | RAID sets raid0, raid1, and raid2 are all marked as auto-configurable. |
1342 | raid0 is marked as being a root file system. | | 1349 | raid0 is marked as being a root file system. |
1343 | When new kernels are installed, the kernel is not only copied to | | 1350 | When new kernels are installed, the kernel is not only copied to |
1344 | .Pa / , | | 1351 | .Pa / , |
1345 | but also to wd0a and wd1a. | | 1352 | but also to wd0a and wd1a. |
1346 | The kernel on wd0a is required, since that | | 1353 | The kernel on wd0a is required, since that |
1347 | is the kernel the system boots from. | | 1354 | is the kernel the system boots from. |
1348 | The kernel on wd1a is also | | 1355 | The kernel on wd1a is also |
1349 | required, since that will be the kernel used should wd0 fail. | | 1356 | required, since that will be the kernel used should wd0 fail. |
1350 | The important point here is to have redundant copies of the kernel | | 1357 | The important point here is to have redundant copies of the kernel |
1351 | available, in the event that one of the drives fail. | | 1358 | available, in the event that one of the drives fail. |
1352 | .Pp | | 1359 | .Pp |
1353 | There is no requirement that the root file system be on the same disk | | 1360 | There is no requirement that the root file system be on the same disk |
1354 | as the kernel. | | 1361 | as the kernel. |
1355 | For example, obtaining the kernel from wd0a, and using | | 1362 | For example, obtaining the kernel from wd0a, and using |
1356 | sd0e and sd1e for raid0, and the root file system, is fine. | | 1363 | sd0e and sd1e for raid0, and the root file system, is fine. |
1357 | It | | 1364 | It |
1358 | .Em is | | 1365 | .Em is |
1359 | critical, however, that there be multiple kernels available, in the | | 1366 | critical, however, that there be multiple kernels available, in the |
1360 | event of media failure. | | 1367 | event of media failure. |
1361 | .Pp | | 1368 | .Pp |
1362 | Multi-layered RAID devices (such as a RAID 0 set made | | 1369 | Multi-layered RAID devices (such as a RAID 0 set made |
1363 | up of RAID 1 sets) are | | 1370 | up of RAID 1 sets) are |
1364 | .Em not | | 1371 | .Em not |
1365 | supported as root devices or auto-configurable devices at this point. | | 1372 | supported as root devices or auto-configurable devices at this point. |
1366 | (Multi-layered RAID devices | | 1373 | (Multi-layered RAID devices |
1367 | .Em are | | 1374 | .Em are |
1368 | supported in general, however, as mentioned earlier.) | | 1375 | supported in general, however, as mentioned earlier.) |
1369 | Note that in order to enable component auto-detection and | | 1376 | Note that in order to enable component auto-detection and |
1370 | auto-configuration of RAID devices, the line: | | 1377 | auto-configuration of RAID devices, the line: |
1371 | .Bd -literal -offset indent | | 1378 | .Bd -literal -offset indent |
1372 | options RAID_AUTOCONFIG | | 1379 | options RAID_AUTOCONFIG |
1373 | .Ed | | 1380 | .Ed |
1374 | .Pp | | 1381 | .Pp |
1375 | must be in the kernel configuration file. | | 1382 | must be in the kernel configuration file. |
1376 | See | | 1383 | See |
1377 | .Xr raid 4 | | 1384 | .Xr raid 4 |
1378 | for more details. | | 1385 | for more details. |
1379 | .Ss Swapping on RAID | | 1386 | .Ss Swapping on RAID |
1380 | A RAID device can be used as a swap device. | | 1387 | A RAID device can be used as a swap device. |
1381 | In order to ensure that a RAID device used as a swap device | | 1388 | In order to ensure that a RAID device used as a swap device |
1382 | is correctly unconfigured when the system is shutdown or rebooted, | | 1389 | is correctly unconfigured when the system is shutdown or rebooted, |
1383 | it is recommended that the line | | 1390 | it is recommended that the line |
1384 | .Bd -literal -offset indent | | 1391 | .Bd -literal -offset indent |
1385 | swapoff=YES | | 1392 | swapoff=YES |
1386 | .Ed | | 1393 | .Ed |
1387 | .Pp | | 1394 | .Pp |
1388 | be added to | | 1395 | be added to |
1389 | .Pa /etc/rc.conf . | | 1396 | .Pa /etc/rc.conf . |
1390 | .Ss Unconfiguration | | 1397 | .Ss Unconfiguration |
1391 | The final operation performed by | | 1398 | The final operation performed by |
1392 | .Nm | | 1399 | .Nm |
1393 | is to unconfigure a | | 1400 | is to unconfigure a |
1394 | .Xr raid 4 | | 1401 | .Xr raid 4 |
1395 | device. | | 1402 | device. |
1396 | This is accomplished via a simple: | | 1403 | This is accomplished via a simple: |
1397 | .Bd -literal -offset indent | | 1404 | .Bd -literal -offset indent |
1398 | raidctl -u raid0 | | 1405 | raidctl -u raid0 |
1399 | .Ed | | 1406 | .Ed |
1400 | .Pp | | 1407 | .Pp |
1401 | at which point the device is ready to be reconfigured. | | 1408 | at which point the device is ready to be reconfigured. |
1402 | .Ss Performance Tuning | | 1409 | .Ss Performance Tuning |
1403 | Selection of the various parameter values which result in the best | | 1410 | Selection of the various parameter values which result in the best |
1404 | performance can be quite tricky, and often requires a bit of | | 1411 | performance can be quite tricky, and often requires a bit of |
1405 | trial-and-error to get those values most appropriate for a given system. | | 1412 | trial-and-error to get those values most appropriate for a given system. |
1406 | A whole range of factors come into play, including: | | 1413 | A whole range of factors come into play, including: |
1407 | .Bl -enum | | 1414 | .Bl -enum |
1408 | .It | | 1415 | .It |
1409 | Types of components (e.g., SCSI vs. IDE) and their bandwidth | | 1416 | Types of components (e.g., SCSI vs. IDE) and their bandwidth |
1410 | .It | | 1417 | .It |
1411 | Types of controller cards and their bandwidth | | 1418 | Types of controller cards and their bandwidth |
1412 | .It | | 1419 | .It |
1413 | Distribution of components among controllers | | 1420 | Distribution of components among controllers |
1414 | .It | | 1421 | .It |
1415 | IO bandwidth | | 1422 | IO bandwidth |
1416 | .It | | 1423 | .It |
1417 | file system access patterns | | 1424 | file system access patterns |
1418 | .It | | 1425 | .It |
1419 | CPU speed | | 1426 | CPU speed |
1420 | .El | | 1427 | .El |
1421 | .Pp | | 1428 | .Pp |
1422 | As with most performance tuning, benchmarking under real-life loads | | 1429 | As with most performance tuning, benchmarking under real-life loads |
1423 | may be the only way to measure expected performance. | | 1430 | may be the only way to measure expected performance. |
1424 | Understanding some of the underlying technology is also useful in tuning. | | 1431 | Understanding some of the underlying technology is also useful in tuning. |
1425 | The goal of this section is to provide pointers to those parameters which may | | 1432 | The goal of this section is to provide pointers to those parameters which may |
1426 | make significant differences in performance. | | 1433 | make significant differences in performance. |
1427 | .Pp | | 1434 | .Pp |
1428 | For a RAID 1 set, a SectPerSU value of 64 or 128 is typically sufficient. | | 1435 | For a RAID 1 set, a SectPerSU value of 64 or 128 is typically sufficient. |
1429 | Since data in a RAID 1 set is arranged in a linear | | 1436 | Since data in a RAID 1 set is arranged in a linear |
1430 | fashion on each component, selecting an appropriate stripe size is | | 1437 | fashion on each component, selecting an appropriate stripe size is |
1431 | somewhat less critical than it is for a RAID 5 set. | | 1438 | somewhat less critical than it is for a RAID 5 set. |
1432 | However: a stripe size that is too small will cause large IO's to be | | 1439 | However: a stripe size that is too small will cause large IO's to be |
1433 | broken up into a number of smaller ones, hurting performance. | | 1440 | broken up into a number of smaller ones, hurting performance. |
1434 | At the same time, a large stripe size may cause problems with | | 1441 | At the same time, a large stripe size may cause problems with |
1435 | concurrent accesses to stripes, which may also affect performance. | | 1442 | concurrent accesses to stripes, which may also affect performance. |
1436 | Thus values in the range of 32 to 128 are often the most effective. | | 1443 | Thus values in the range of 32 to 128 are often the most effective. |
1437 | .Pp | | 1444 | .Pp |
1438 | Tuning RAID 5 sets is trickier. | | 1445 | Tuning RAID 5 sets is trickier. |
1439 | In the best case, IO is presented to the RAID set one stripe at a time. | | 1446 | In the best case, IO is presented to the RAID set one stripe at a time. |
1440 | Since the entire stripe is available at the beginning of the IO, | | 1447 | Since the entire stripe is available at the beginning of the IO, |
1441 | the parity of that stripe can be calculated before the stripe is written, | | 1448 | the parity of that stripe can be calculated before the stripe is written, |
1442 | and then the stripe data and parity can be written in parallel. | | 1449 | and then the stripe data and parity can be written in parallel. |
1443 | When the amount of data being written is less than a full stripe worth, the | | 1450 | When the amount of data being written is less than a full stripe worth, the |
1444 | .Sq small write | | 1451 | .Sq small write |
1445 | problem occurs. | | 1452 | problem occurs. |
1446 | Since a | | 1453 | Since a |
1447 | .Sq small write | | 1454 | .Sq small write |
1448 | means only a portion of the stripe on the components is going to | | 1455 | means only a portion of the stripe on the components is going to |
1449 | change, the data (and parity) on the components must be updated | | 1456 | change, the data (and parity) on the components must be updated |
1450 | slightly differently. | | 1457 | slightly differently. |
1451 | First, the | | 1458 | First, the |
1452 | .Sq old parity | | 1459 | .Sq old parity |
1453 | and | | 1460 | and |
1454 | .Sq old data | | 1461 | .Sq old data |
1455 | must be read from the components. | | 1462 | must be read from the components. |
1456 | Then the new parity is constructed, | | 1463 | Then the new parity is constructed, |
1457 | using the new data to be written, and the old data and old parity. | | 1464 | using the new data to be written, and the old data and old parity. |
1458 | Finally, the new data and new parity are written. | | 1465 | Finally, the new data and new parity are written. |
1459 | All this extra data shuffling results in a serious loss of performance, | | 1466 | All this extra data shuffling results in a serious loss of performance, |
1460 | and is typically 2 to 4 times slower than a full stripe write (or read). | | 1467 | and is typically 2 to 4 times slower than a full stripe write (or read). |
1461 | To combat this problem in the real world, it may be useful | | 1468 | To combat this problem in the real world, it may be useful |
1462 | to ensure that stripe sizes are small enough that a | | 1469 | to ensure that stripe sizes are small enough that a |
1463 | .Sq large IO | | 1470 | .Sq large IO |
1464 | from the system will use exactly one large stripe write. | | 1471 | from the system will use exactly one large stripe write. |
1465 | As is seen later, there are some file system dependencies | | 1472 | As is seen later, there are some file system dependencies |
1466 | which may come into play here as well. | | 1473 | which may come into play here as well. |
1467 | .Pp | | 1474 | .Pp |
1468 | Since the size of a | | 1475 | Since the size of a |
1469 | .Sq large IO | | 1476 | .Sq large IO |
1470 | is often (currently) only 32K or 64K, on a 5-drive RAID 5 set it may | | 1477 | is often (currently) only 32K or 64K, on a 5-drive RAID 5 set it may |
1471 | be desirable to select a SectPerSU value of 16 blocks (8K) or 32 | | 1478 | be desirable to select a SectPerSU value of 16 blocks (8K) or 32 |
1472 | blocks (16K). | | 1479 | blocks (16K). |
1473 | Since there are 4 data sectors per stripe, the maximum | | 1480 | Since there are 4 data sectors per stripe, the maximum |
1474 | data per stripe is 64 blocks (32K) or 128 blocks (64K). | | 1481 | data per stripe is 64 blocks (32K) or 128 blocks (64K). |
1475 | Again, empirical measurement will provide the best indicators of which | | 1482 | Again, empirical measurement will provide the best indicators of which |
1476 | values will yield better performance. | | 1483 | values will yield better performance. |
1477 | .Pp | | 1484 | .Pp |
1478 | The parameters used for the file system are also critical to good performance. | | 1485 | The parameters used for the file system are also critical to good performance. |
1479 | For | | 1486 | For |
1480 | .Xr newfs 8 , | | 1487 | .Xr newfs 8 , |
1481 | for example, increasing the block size to 32K or 64K may improve | | 1488 | for example, increasing the block size to 32K or 64K may improve |
1482 | performance dramatically. | | 1489 | performance dramatically. |
1483 | As well, changing the cylinders-per-group | | 1490 | As well, changing the cylinders-per-group |
1484 | parameter from 16 to 32 or higher is often not only necessary for | | 1491 | parameter from 16 to 32 or higher is often not only necessary for |
1485 | larger file systems, but may also have positive performance implications. | | 1492 | larger file systems, but may also have positive performance implications. |
1486 | .Ss Summary | | 1493 | .Ss Summary |
1487 | Despite the length of this man-page, configuring a RAID set is a | | 1494 | Despite the length of this man-page, configuring a RAID set is a |
1488 | relatively straight-forward process. | | 1495 | relatively straight-forward process. |
1489 | All that needs to be done is the following steps: | | 1496 | All that needs to be done is the following steps: |
1490 | .Bl -enum | | 1497 | .Bl -enum |
1491 | .It | | 1498 | .It |
1492 | Use | | 1499 | Use |
1493 | .Xr disklabel 8 | | 1500 | .Xr disklabel 8 |
1494 | to create the components (of type RAID). | | 1501 | to create the components (of type RAID). |
1495 | .It | | 1502 | .It |
1496 | Construct a RAID configuration file: e.g., | | 1503 | Construct a RAID configuration file: e.g., |
1497 | .Pa raid0.conf | | 1504 | .Pa raid0.conf |
1498 | .It | | 1505 | .It |
1499 | Configure the RAID set with: | | 1506 | Configure the RAID set with: |
1500 | .Bd -literal -offset indent | | 1507 | .Bd -literal -offset indent |
1501 | raidctl -C raid0.conf raid0 | | 1508 | raidctl -C raid0.conf raid0 |
1502 | .Ed | | 1509 | .Ed |
1503 | .It | | 1510 | .It |
1504 | Initialize the component labels with: | | 1511 | Initialize the component labels with: |
1505 | .Bd -literal -offset indent | | 1512 | .Bd -literal -offset indent |
1506 | raidctl -I 123456 raid0 | | 1513 | raidctl -I 123456 raid0 |
1507 | .Ed | | 1514 | .Ed |
1508 | .It | | 1515 | .It |
1509 | Initialize other important parts of the set with: | | 1516 | Initialize other important parts of the set with: |
1510 | .Bd -literal -offset indent | | 1517 | .Bd -literal -offset indent |
1511 | raidctl -i raid0 | | 1518 | raidctl -i raid0 |
1512 | .Ed | | 1519 | .Ed |
1513 | .It | | 1520 | .It |
1514 | Get the default label for the RAID set: | | 1521 | Get the default label for the RAID set: |
1515 | .Bd -literal -offset indent | | 1522 | .Bd -literal -offset indent |
1516 | disklabel raid0 > /tmp/label | | 1523 | disklabel raid0 > /tmp/label |
1517 | .Ed | | 1524 | .Ed |
1518 | .It | | 1525 | .It |
1519 | Edit the label: | | 1526 | Edit the label: |
1520 | .Bd -literal -offset indent | | 1527 | .Bd -literal -offset indent |
1521 | vi /tmp/label | | 1528 | vi /tmp/label |
1522 | .Ed | | 1529 | .Ed |
1523 | .It | | 1530 | .It |
1524 | Put the new label on the RAID set: | | 1531 | Put the new label on the RAID set: |
1525 | .Bd -literal -offset indent | | 1532 | .Bd -literal -offset indent |
1526 | disklabel -R -r raid0 /tmp/label | | 1533 | disklabel -R -r raid0 /tmp/label |
1527 | .Ed | | 1534 | .Ed |
1528 | .It | | 1535 | .It |
1529 | Create the file system: | | 1536 | Create the file system: |
1530 | .Bd -literal -offset indent | | 1537 | .Bd -literal -offset indent |
1531 | newfs /dev/rraid0e | | 1538 | newfs /dev/rraid0e |
1532 | .Ed | | 1539 | .Ed |
1533 | .It | | 1540 | .It |
1534 | Mount the file system: | | 1541 | Mount the file system: |
1535 | .Bd -literal -offset indent | | 1542 | .Bd -literal -offset indent |
1536 | mount /dev/raid0e /mnt | | 1543 | mount /dev/raid0e /mnt |
1537 | .Ed | | 1544 | .Ed |
1538 | .It | | 1545 | .It |
1539 | Use: | | 1546 | Use: |
1540 | .Bd -literal -offset indent | | 1547 | .Bd -literal -offset indent |
1541 | raidctl -c raid0.conf raid0 | | 1548 | raidctl -c raid0.conf raid0 |
1542 | .Ed | | 1549 | .Ed |
1543 | .Pp | | 1550 | .Pp |
1544 | To re-configure the RAID set the next time it is needed, or put | | 1551 | To re-configure the RAID set the next time it is needed, or put |
1545 | .Pa raid0.conf | | 1552 | .Pa raid0.conf |
1546 | into | | 1553 | into |
1547 | .Pa /etc | | 1554 | .Pa /etc |
1548 | where it will automatically be started by the | | 1555 | where it will automatically be started by the |
1549 | .Pa /etc/rc.d | | 1556 | .Pa /etc/rc.d |
1550 | scripts. | | 1557 | scripts. |
1551 | .El | | 1558 | .El |
1552 | .Sh SEE ALSO | | 1559 | .Sh SEE ALSO |
1553 | .Xr ccd 4 , | | 1560 | .Xr ccd 4 , |
1554 | .Xr raid 4 , | | 1561 | .Xr raid 4 , |
1555 | .Xr rc 8 | | 1562 | .Xr rc 8 |
1556 | .Sh HISTORY | | 1563 | .Sh HISTORY |
1557 | RAIDframe is a framework for rapid prototyping of RAID structures | | 1564 | RAIDframe is a framework for rapid prototyping of RAID structures |
1558 | developed by the folks at the Parallel Data Laboratory at Carnegie | | 1565 | developed by the folks at the Parallel Data Laboratory at Carnegie |
1559 | Mellon University (CMU). | | 1566 | Mellon University (CMU). |
1560 | A more complete description of the internals and functionality of | | 1567 | A more complete description of the internals and functionality of |
1561 | RAIDframe is found in the paper "RAIDframe: A Rapid Prototyping Tool | | 1568 | RAIDframe is found in the paper "RAIDframe: A Rapid Prototyping Tool |
1562 | for RAID Systems", by William V. Courtright II, Garth Gibson, Mark | | 1569 | for RAID Systems", by William V. Courtright II, Garth Gibson, Mark |
1563 | Holland, LeAnn Neal Reilly, and Jim Zelenka, and published by the | | 1570 | Holland, LeAnn Neal Reilly, and Jim Zelenka, and published by the |
1564 | Parallel Data Laboratory of Carnegie Mellon University. | | 1571 | Parallel Data Laboratory of Carnegie Mellon University. |
1565 | .Pp | | 1572 | .Pp |
| | | 1573 | RAIDframe was ported to |
| | | 1574 | .Nx |
| | | 1575 | by Greg Oster in 1998, who has maintained it since. |
| | | 1576 | In 1999, component labels, spares, automatic rebuilding of parity, and |
| | | 1577 | autoconfiguration of volumes were added. |
| | | 1578 | In 2000, root on RAID support was added (initially, with no support for |
| | | 1579 | loading kernels from RAID volumes, which has been added to many ports since.) |
| | | 1580 | In 2009, support for parity bimap was added, reducing parity resync time |
| | | 1581 | after a crash. |
| | | 1582 | In 2010, support for larger the 2TiB and non-512 sector devices was added. |
| | | 1583 | In 2018, support for 32-bit userland compatibility was added. |
| | | 1584 | In 2021, support for autoconfiguration from other-endian raid sets was added. |
| | | 1585 | .Pp |
| | | 1586 | Support for loading kernels from RAID 1 partitions was added for the |
| | | 1587 | alpha, pmax and vax ports in 2000, the the sgimips port in 2001, |
| | | 1588 | the x86 ports in 2003, the arc port in 2005, the landisk, sparc, and |
| | | 1589 | sparc64 ports in 2006, the cobalt port in 2007, the ofppc port in 2008, |
| | | 1590 | the bebox port in 2010, the emips port in 2011, and the sandpoint port |
| | | 1591 | in 2012. |
| | | 1592 | .Pp |
1566 | The | | 1593 | The |
1567 | .Nm | | 1594 | .Nm |
1568 | command first appeared as a program in CMU's RAIDframe v1.1 distribution. | | 1595 | command first appeared as a program in CMU's RAIDframe v1.1 distribution. |
1569 | This version of | | 1596 | This version of |
1570 | .Nm | | 1597 | .Nm |
1571 | is a complete re-write, and first appeared in | | 1598 | is a complete re-write, and first appeared in |
1572 | .Nx 1.4 . | | 1599 | .Nx 1.4 . |
1573 | .Sh COPYRIGHT | | 1600 | .Sh COPYRIGHT |
1574 | .Bd -literal | | 1601 | .Bd -literal |
1575 | The RAIDframe Copyright is as follows: | | 1602 | The RAIDframe Copyright is as follows: |
1576 | | | 1603 | |
1577 | Copyright (c) 1994-1996 Carnegie-Mellon University. | | 1604 | Copyright (c) 1994-1996 Carnegie-Mellon University. |
1578 | All rights reserved. | | 1605 | All rights reserved. |
1579 | | | 1606 | |
1580 | Permission to use, copy, modify and distribute this software and | | 1607 | Permission to use, copy, modify and distribute this software and |
1581 | its documentation is hereby granted, provided that both the copyright | | 1608 | its documentation is hereby granted, provided that both the copyright |
1582 | notice and this permission notice appear in all copies of the | | 1609 | notice and this permission notice appear in all copies of the |
1583 | software, derivative works or modified versions, and any portions | | 1610 | software, derivative works or modified versions, and any portions |
1584 | thereof, and that both notices appear in supporting documentation. | | 1611 | thereof, and that both notices appear in supporting documentation. |
1585 | | | 1612 | |
1586 | CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | | 1613 | CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" |
1587 | CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND | | 1614 | CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND |
1588 | FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. | | 1615 | FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. |
1589 | | | 1616 | |
1590 | Carnegie Mellon requests users of this software to return to | | 1617 | Carnegie Mellon requests users of this software to return to |
1591 | | | 1618 | |
1592 | Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | | 1619 | Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU |
1593 | School of Computer Science | | 1620 | School of Computer Science |
1594 | Carnegie Mellon University | | 1621 | Carnegie Mellon University |
1595 | Pittsburgh PA 15213-3890 | | 1622 | Pittsburgh PA 15213-3890 |
1596 | | | 1623 | |
1597 | any improvements or extensions that they make and grant Carnegie the | | 1624 | any improvements or extensions that they make and grant Carnegie the |
1598 | rights to redistribute these changes. | | 1625 | rights to redistribute these changes. |
1599 | .Ed | | 1626 | .Ed |
1600 | .Sh WARNINGS | | 1627 | .Sh WARNINGS |
1601 | Certain RAID levels (1, 4, 5, 6, and others) can protect against some | | 1628 | Certain RAID levels (1, 4, 5, 6, and others) can protect against some |
1602 | data loss due to component failure. | | 1629 | data loss due to component failure. |
1603 | However the loss of two components of a RAID 4 or 5 system, | | 1630 | However the loss of two components of a RAID 4 or 5 system, |
1604 | or the loss of a single component of a RAID 0 system will | | 1631 | or the loss of a single component of a RAID 0 system will |
1605 | result in the entire file system being lost. | | 1632 | result in the entire file system being lost. |
1606 | RAID is | | 1633 | RAID is |
1607 | .Em NOT | | 1634 | .Em NOT |
1608 | a substitute for good backup practices. | | 1635 | a substitute for good backup practices. |
1609 | .Pp | | 1636 | .Pp |
1610 | Recomputation of parity | | 1637 | Recomputation of parity |
1611 | .Em MUST | | 1638 | .Em MUST |
1612 | be performed whenever there is a chance that it may have been compromised. | | 1639 | be performed whenever there is a chance that it may have been compromised. |
1613 | This includes after system crashes, or before a RAID | | 1640 | This includes after system crashes, or before a RAID |
1614 | device has been used for the first time. | | 1641 | device has been used for the first time. |
1615 | Failure to keep parity correct will be catastrophic should a | | 1642 | Failure to keep parity correct will be catastrophic should a |
1616 | component ever fail \(em it is better to use RAID 0 and get the | | 1643 | component ever fail \(em it is better to use RAID 0 and get the |
1617 | additional space and speed, than it is to use parity, but | | 1644 | additional space and speed, than it is to use parity, but |
1618 | not keep the parity correct. | | 1645 | not keep the parity correct. |
1619 | At least with RAID 0 there is no perception of increased data security. | | 1646 | At least with RAID 0 there is no perception of increased data security. |
1620 | .Pp | | 1647 | .Pp |
1621 | When replacing a failed component of a RAID set, it is a good | | 1648 | When replacing a failed component of a RAID set, it is a good |
1622 | idea to zero out the first 64 blocks of the new component to insure the | | 1649 | idea to zero out the first 64 blocks of the new component to insure the |
1623 | RAIDframe driver doesn't erroneously detect a component label in the | | 1650 | RAIDframe driver doesn't erroneously detect a component label in the |
1624 | new component. | | 1651 | new component. |
1625 | This is particularly true on | | 1652 | This is particularly true on |
1626 | .Em RAID 1 | | 1653 | .Em RAID 1 |
1627 | sets because there is at most one correct component label in a failed RAID | | 1654 | sets because there is at most one correct component label in a failed RAID |
1628 | 1 installation, and the RAIDframe driver picks the component label with the | | 1655 | 1 installation, and the RAIDframe driver picks the component label with the |
1629 | highest serial number and modification value as the authoritative source | | 1656 | highest serial number and modification value as the authoritative source |
1630 | for the failed RAID set when choosing which component label to use to | | 1657 | for the failed RAID set when choosing which component label to use to |
1631 | configure the RAID set. | | 1658 | configure the RAID set. |
1632 | .Sh BUGS | | 1659 | .Sh BUGS |
1633 | Hot-spare removal is currently not available. | | 1660 | Hot-spare removal is currently not available. |