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