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