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