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