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