1*e4b0a90eSBrooks Davis.\" Copyright (c) 2004-2005 Pawel Jakub Dawidek <pjd@FreeBSD.org> 2*e4b0a90eSBrooks Davis.\" All rights reserved. 3*e4b0a90eSBrooks Davis.\" 4*e4b0a90eSBrooks Davis.\" Redistribution and use in source and binary forms, with or without 5*e4b0a90eSBrooks Davis.\" modification, are permitted provided that the following conditions 6*e4b0a90eSBrooks Davis.\" are met: 7*e4b0a90eSBrooks Davis.\" 1. Redistributions of source code must retain the above copyright 8*e4b0a90eSBrooks Davis.\" notice, this list of conditions and the following disclaimer. 9*e4b0a90eSBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright 10*e4b0a90eSBrooks Davis.\" notice, this list of conditions and the following disclaimer in the 11*e4b0a90eSBrooks Davis.\" documentation and/or other materials provided with the distribution. 12*e4b0a90eSBrooks Davis.\" 13*e4b0a90eSBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 14*e4b0a90eSBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15*e4b0a90eSBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16*e4b0a90eSBrooks Davis.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 17*e4b0a90eSBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18*e4b0a90eSBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19*e4b0a90eSBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20*e4b0a90eSBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21*e4b0a90eSBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22*e4b0a90eSBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23*e4b0a90eSBrooks Davis.\" SUCH DAMAGE. 24*e4b0a90eSBrooks Davis.\" 25*e4b0a90eSBrooks Davis.\" $FreeBSD$ 26*e4b0a90eSBrooks Davis.\" 27*e4b0a90eSBrooks Davis.Dd January 15, 2012 28*e4b0a90eSBrooks Davis.Dt GRAID3 8 29*e4b0a90eSBrooks Davis.Os 30*e4b0a90eSBrooks Davis.Sh NAME 31*e4b0a90eSBrooks Davis.Nm graid3 32*e4b0a90eSBrooks Davis.Nd "control utility for RAID3 devices" 33*e4b0a90eSBrooks Davis.Sh SYNOPSIS 34*e4b0a90eSBrooks Davis.Nm 35*e4b0a90eSBrooks Davis.Cm label 36*e4b0a90eSBrooks Davis.Op Fl Fhnrvw 37*e4b0a90eSBrooks Davis.Op Fl s Ar blocksize 38*e4b0a90eSBrooks Davis.Ar name 39*e4b0a90eSBrooks Davis.Ar prov prov prov ... 40*e4b0a90eSBrooks Davis.Nm 41*e4b0a90eSBrooks Davis.Cm clear 42*e4b0a90eSBrooks Davis.Op Fl v 43*e4b0a90eSBrooks Davis.Ar prov ... 44*e4b0a90eSBrooks Davis.Nm 45*e4b0a90eSBrooks Davis.Cm configure 46*e4b0a90eSBrooks Davis.Op Fl adfFhnrRvwW 47*e4b0a90eSBrooks Davis.Ar name 48*e4b0a90eSBrooks Davis.Nm 49*e4b0a90eSBrooks Davis.Cm rebuild 50*e4b0a90eSBrooks Davis.Op Fl v 51*e4b0a90eSBrooks Davis.Ar name 52*e4b0a90eSBrooks Davis.Ar prov 53*e4b0a90eSBrooks Davis.Nm 54*e4b0a90eSBrooks Davis.Cm insert 55*e4b0a90eSBrooks Davis.Op Fl hv 56*e4b0a90eSBrooks Davis.Op Fl n Ar number 57*e4b0a90eSBrooks Davis.Ar name 58*e4b0a90eSBrooks Davis.Ar prov 59*e4b0a90eSBrooks Davis.Nm 60*e4b0a90eSBrooks Davis.Cm remove 61*e4b0a90eSBrooks Davis.Op Fl v 62*e4b0a90eSBrooks Davis.Fl n Ar number 63*e4b0a90eSBrooks Davis.Ar name 64*e4b0a90eSBrooks Davis.Nm 65*e4b0a90eSBrooks Davis.Cm stop 66*e4b0a90eSBrooks Davis.Op Fl fv 67*e4b0a90eSBrooks Davis.Ar name ... 68*e4b0a90eSBrooks Davis.Nm 69*e4b0a90eSBrooks Davis.Cm list 70*e4b0a90eSBrooks Davis.Nm 71*e4b0a90eSBrooks Davis.Cm status 72*e4b0a90eSBrooks Davis.Nm 73*e4b0a90eSBrooks Davis.Cm load 74*e4b0a90eSBrooks Davis.Nm 75*e4b0a90eSBrooks Davis.Cm unload 76*e4b0a90eSBrooks Davis.Sh DESCRIPTION 77*e4b0a90eSBrooks DavisThe 78*e4b0a90eSBrooks Davis.Nm 79*e4b0a90eSBrooks Davisutility is used for RAID3 array configuration. 80*e4b0a90eSBrooks DavisAfter a device is created, all components are detected and configured 81*e4b0a90eSBrooks Davisautomatically. 82*e4b0a90eSBrooks DavisAll operations such as failure detection, stale component detection, rebuild 83*e4b0a90eSBrooks Davisof stale components, etc.\& are also done automatically. 84*e4b0a90eSBrooks DavisThe 85*e4b0a90eSBrooks Davis.Nm 86*e4b0a90eSBrooks Davisutility uses on-disk metadata (the provider's last sector) to store all needed 87*e4b0a90eSBrooks Davisinformation. 88*e4b0a90eSBrooks Davis.Pp 89*e4b0a90eSBrooks DavisThe first argument to 90*e4b0a90eSBrooks Davis.Nm 91*e4b0a90eSBrooks Davisindicates an action to be performed: 92*e4b0a90eSBrooks Davis.Bl -tag -width ".Cm configure" 93*e4b0a90eSBrooks Davis.It Cm label 94*e4b0a90eSBrooks DavisCreate a RAID3 device. 95*e4b0a90eSBrooks DavisThe last given component will contain parity data, whilst the others 96*e4b0a90eSBrooks Daviswill all contain regular data. 97*e4b0a90eSBrooks DavisThe number of components must be equal to 3, 5, 9, 17, etc.\& (2^n + 1). 98*e4b0a90eSBrooks Davis.Pp 99*e4b0a90eSBrooks DavisAdditional options include: 100*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl h" 101*e4b0a90eSBrooks Davis.It Fl F 102*e4b0a90eSBrooks DavisDo not synchronize after a power failure or system crash. 103*e4b0a90eSBrooks DavisAssumes device is in consistent state. 104*e4b0a90eSBrooks Davis.It Fl h 105*e4b0a90eSBrooks DavisHardcode providers' names in metadata. 106*e4b0a90eSBrooks Davis.It Fl n 107*e4b0a90eSBrooks DavisTurn off autosynchronization of stale components. 108*e4b0a90eSBrooks Davis.It Fl r 109*e4b0a90eSBrooks DavisUse parity component for reading in round-robin fashion. 110*e4b0a90eSBrooks DavisWithout this option the parity component is not used at all for reading operations 111*e4b0a90eSBrooks Daviswhen the device is in a complete state. 112*e4b0a90eSBrooks DavisWith this option specified random I/O read operations are even 40% faster, 113*e4b0a90eSBrooks Davisbut sequential reads are slower. 114*e4b0a90eSBrooks DavisOne cannot use this option if the 115*e4b0a90eSBrooks Davis.Fl w 116*e4b0a90eSBrooks Davisoption is also specified. 117*e4b0a90eSBrooks Davis.It Fl s 118*e4b0a90eSBrooks DavisManually specify array block size. Block size will be set equal to least 119*e4b0a90eSBrooks Daviscommon multiple of all component's sector sizes and specified value. 120*e4b0a90eSBrooks DavisNote that array sector size calculated as multiple of block size and number 121*e4b0a90eSBrooks Davisof regular data components. Big values may decrease performance and compatibility, 122*e4b0a90eSBrooks Davisas all I/O requests have to be multiple of sector size. 123*e4b0a90eSBrooks Davis.It Fl w 124*e4b0a90eSBrooks DavisUse verify reading feature. 125*e4b0a90eSBrooks DavisWhen reading from a device in a complete state, also read data from the parity component 126*e4b0a90eSBrooks Davisand verify the data by comparing XORed regular data with parity data. 127*e4b0a90eSBrooks DavisIf verification fails, an 128*e4b0a90eSBrooks Davis.Er EIO 129*e4b0a90eSBrooks Daviserror is returned and the value of the 130*e4b0a90eSBrooks Davis.Va kern.geom.raid3.stat.parity_mismatch 131*e4b0a90eSBrooks Davissysctl is increased. 132*e4b0a90eSBrooks DavisOne cannot use this option if the 133*e4b0a90eSBrooks Davis.Fl r 134*e4b0a90eSBrooks Davisoption is also specified. 135*e4b0a90eSBrooks Davis.El 136*e4b0a90eSBrooks Davis.It Cm clear 137*e4b0a90eSBrooks DavisClear metadata on the given providers. 138*e4b0a90eSBrooks Davis.It Cm configure 139*e4b0a90eSBrooks DavisConfigure the given device. 140*e4b0a90eSBrooks Davis.Pp 141*e4b0a90eSBrooks DavisAdditional options include: 142*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl a" 143*e4b0a90eSBrooks Davis.It Fl a 144*e4b0a90eSBrooks DavisTurn on autosynchronization of stale components. 145*e4b0a90eSBrooks Davis.It Fl d 146*e4b0a90eSBrooks DavisDo not hardcode providers' names in metadata. 147*e4b0a90eSBrooks Davis.It Fl f 148*e4b0a90eSBrooks DavisSynchronize device after a power failure or system crash. 149*e4b0a90eSBrooks Davis.It Fl F 150*e4b0a90eSBrooks DavisDo not synchronize after a power failure or system crash. 151*e4b0a90eSBrooks DavisAssumes device is in consistent state. 152*e4b0a90eSBrooks Davis.It Fl h 153*e4b0a90eSBrooks DavisHardcode providers' names in metadata. 154*e4b0a90eSBrooks Davis.It Fl n 155*e4b0a90eSBrooks DavisTurn off autosynchronization of stale components. 156*e4b0a90eSBrooks Davis.It Fl r 157*e4b0a90eSBrooks DavisTurn on round-robin reading. 158*e4b0a90eSBrooks Davis.It Fl R 159*e4b0a90eSBrooks DavisTurn off round-robin reading. 160*e4b0a90eSBrooks Davis.It Fl w 161*e4b0a90eSBrooks DavisTurn on verify reading. 162*e4b0a90eSBrooks Davis.It Fl W 163*e4b0a90eSBrooks DavisTurn off verify reading. 164*e4b0a90eSBrooks Davis.El 165*e4b0a90eSBrooks Davis.It Cm rebuild 166*e4b0a90eSBrooks DavisRebuild the given component forcibly. 167*e4b0a90eSBrooks DavisIf autosynchronization was not turned off for the given device, this command 168*e4b0a90eSBrooks Davisshould be unnecessary. 169*e4b0a90eSBrooks Davis.It Cm insert 170*e4b0a90eSBrooks DavisAdd the given component to the existing array, if one of the components was 171*e4b0a90eSBrooks Davisremoved previously with the 172*e4b0a90eSBrooks Davis.Cm remove 173*e4b0a90eSBrooks Daviscommand or if one component is missing and will not be connected again. 174*e4b0a90eSBrooks DavisIf no number is given, new component will be added instead of first missed 175*e4b0a90eSBrooks Daviscomponent. 176*e4b0a90eSBrooks Davis.Pp 177*e4b0a90eSBrooks DavisAdditional options include: 178*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl h" 179*e4b0a90eSBrooks Davis.It Fl h 180*e4b0a90eSBrooks DavisHardcode providers' names in metadata. 181*e4b0a90eSBrooks Davis.El 182*e4b0a90eSBrooks Davis.It Cm remove 183*e4b0a90eSBrooks DavisRemove the given component from the given array and clear metadata on it. 184*e4b0a90eSBrooks Davis.It Cm stop 185*e4b0a90eSBrooks DavisStop the given arrays. 186*e4b0a90eSBrooks Davis.Pp 187*e4b0a90eSBrooks DavisAdditional options include: 188*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl f" 189*e4b0a90eSBrooks Davis.It Fl f 190*e4b0a90eSBrooks DavisStop the given array even if it is opened. 191*e4b0a90eSBrooks Davis.El 192*e4b0a90eSBrooks Davis.It Cm list 193*e4b0a90eSBrooks DavisSee 194*e4b0a90eSBrooks Davis.Xr geom 8 . 195*e4b0a90eSBrooks Davis.It Cm status 196*e4b0a90eSBrooks DavisSee 197*e4b0a90eSBrooks Davis.Xr geom 8 . 198*e4b0a90eSBrooks Davis.It Cm load 199*e4b0a90eSBrooks DavisSee 200*e4b0a90eSBrooks Davis.Xr geom 8 . 201*e4b0a90eSBrooks Davis.It Cm unload 202*e4b0a90eSBrooks DavisSee 203*e4b0a90eSBrooks Davis.Xr geom 8 . 204*e4b0a90eSBrooks Davis.El 205*e4b0a90eSBrooks Davis.Pp 206*e4b0a90eSBrooks DavisAdditional options include: 207*e4b0a90eSBrooks Davis.Bl -tag -width ".Fl v" 208*e4b0a90eSBrooks Davis.It Fl v 209*e4b0a90eSBrooks DavisBe more verbose. 210*e4b0a90eSBrooks Davis.El 211*e4b0a90eSBrooks Davis.Sh EXIT STATUS 212*e4b0a90eSBrooks DavisExit status is 0 on success, and 1 if the command fails. 213*e4b0a90eSBrooks Davis.Sh EXAMPLES 214*e4b0a90eSBrooks DavisUse 3 disks to setup a RAID3 array (with the round-robin reading feature). 215*e4b0a90eSBrooks DavisCreate a file system, mount it, then unmount it and stop device: 216*e4b0a90eSBrooks Davis.Bd -literal -offset indent 217*e4b0a90eSBrooks Davisgraid3 label -v -r data da0 da1 da2 218*e4b0a90eSBrooks Davisnewfs /dev/raid3/data 219*e4b0a90eSBrooks Davismount /dev/raid3/data /mnt 220*e4b0a90eSBrooks Davis\&... 221*e4b0a90eSBrooks Davisumount /mnt 222*e4b0a90eSBrooks Davisgraid3 stop data 223*e4b0a90eSBrooks Davisgraid3 unload 224*e4b0a90eSBrooks Davis.Ed 225*e4b0a90eSBrooks Davis.Pp 226*e4b0a90eSBrooks DavisCreate a RAID3 array, but do not use the automatic synchronization feature. 227*e4b0a90eSBrooks DavisRebuild parity component: 228*e4b0a90eSBrooks Davis.Bd -literal -offset indent 229*e4b0a90eSBrooks Davisgraid3 label -n data da0 da1 da2 230*e4b0a90eSBrooks Davisgraid3 rebuild data da2 231*e4b0a90eSBrooks Davis.Ed 232*e4b0a90eSBrooks Davis.Pp 233*e4b0a90eSBrooks DavisReplace one data disk with a brand new one: 234*e4b0a90eSBrooks Davis.Bd -literal -offset indent 235*e4b0a90eSBrooks Davisgraid3 remove -n 0 data 236*e4b0a90eSBrooks Davisgraid3 insert -n 0 data da5 237*e4b0a90eSBrooks Davis.Ed 238*e4b0a90eSBrooks Davis.Sh SEE ALSO 239*e4b0a90eSBrooks Davis.Xr geom 4 , 240*e4b0a90eSBrooks Davis.Xr geom 8 , 241*e4b0a90eSBrooks Davis.Xr gvinum 8 , 242*e4b0a90eSBrooks Davis.Xr mount 8 , 243*e4b0a90eSBrooks Davis.Xr newfs 8 , 244*e4b0a90eSBrooks Davis.Xr umount 8 245*e4b0a90eSBrooks Davis.Sh HISTORY 246*e4b0a90eSBrooks DavisThe 247*e4b0a90eSBrooks Davis.Nm 248*e4b0a90eSBrooks Davisutility appeared in 249*e4b0a90eSBrooks Davis.Fx 5.3 . 250*e4b0a90eSBrooks Davis.Sh AUTHORS 251*e4b0a90eSBrooks Davis.An Pawel Jakub Dawidek Aq Mt pjd@FreeBSD.org 252*e4b0a90eSBrooks Davis.Sh BUGS 253*e4b0a90eSBrooks DavisThere should be a section with an implementation description. 254*e4b0a90eSBrooks Davis.Pp 255*e4b0a90eSBrooks DavisDocumentation for sysctls 256*e4b0a90eSBrooks Davis.Va kern.geom.raid3.* 257*e4b0a90eSBrooks Davisis missing. 258