Wed May 26 08:23:18 2021 UTC ()
update the list of platforms supporting loading kernels from raid.
expand the HISTORY section to include notable RF moments in netbsd.
bump date.


(mrg)
diff -r1.74 -r1.75 src/sbin/raidctl/raidctl.8

cvs diff -r1.74 -r1.75 src/sbin/raidctl/raidctl.8 (switch to unified diff)

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