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