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