xref: /freebsd/lib/geom/raid/graid.8 (revision 27bd6c32bbb49a592a0dfbec5f211a7c2fed31d6)
1e4b0a90eSBrooks Davis.\" Copyright (c) 2010 Alexander Motin <mav@FreeBSD.org>
2e4b0a90eSBrooks Davis.\" All rights reserved.
3e4b0a90eSBrooks Davis.\"
4e4b0a90eSBrooks Davis.\" Redistribution and use in source and binary forms, with or without
5e4b0a90eSBrooks Davis.\" modification, are permitted provided that the following conditions
6e4b0a90eSBrooks Davis.\" are met:
7e4b0a90eSBrooks Davis.\" 1. Redistributions of source code must retain the above copyright
8e4b0a90eSBrooks Davis.\"    notice, this list of conditions and the following disclaimer.
9e4b0a90eSBrooks Davis.\" 2. Redistributions in binary form must reproduce the above copyright
10e4b0a90eSBrooks Davis.\"    notice, this list of conditions and the following disclaimer in the
11e4b0a90eSBrooks Davis.\"    documentation and/or other materials provided with the distribution.
12e4b0a90eSBrooks Davis.\"
13e4b0a90eSBrooks Davis.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
14e4b0a90eSBrooks Davis.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15e4b0a90eSBrooks Davis.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16e4b0a90eSBrooks Davis.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
17e4b0a90eSBrooks Davis.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18e4b0a90eSBrooks Davis.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19e4b0a90eSBrooks Davis.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20e4b0a90eSBrooks Davis.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21e4b0a90eSBrooks Davis.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22e4b0a90eSBrooks Davis.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23e4b0a90eSBrooks Davis.\" SUCH DAMAGE.
24e4b0a90eSBrooks Davis.\"
25*27bd6c32SJohn Baldwin.Dd January 23, 2025
26e4b0a90eSBrooks Davis.Dt GRAID 8
27e4b0a90eSBrooks Davis.Os
28e4b0a90eSBrooks Davis.Sh NAME
29e4b0a90eSBrooks Davis.Nm graid
30e4b0a90eSBrooks Davis.Nd "control utility for software RAID devices"
31e4b0a90eSBrooks Davis.Sh SYNOPSIS
32e4b0a90eSBrooks Davis.Nm
33e4b0a90eSBrooks Davis.Cm label
34e4b0a90eSBrooks Davis.Op Fl f
35e4b0a90eSBrooks Davis.Op Fl o Ar fmtopt
36e4b0a90eSBrooks Davis.Op Fl S Ar size
37e4b0a90eSBrooks Davis.Op Fl s Ar strip
38e4b0a90eSBrooks Davis.Ar format
39e4b0a90eSBrooks Davis.Ar label
40e4b0a90eSBrooks Davis.Ar level
41e4b0a90eSBrooks Davis.Ar prov ...
42e4b0a90eSBrooks Davis.Nm
43e4b0a90eSBrooks Davis.Cm add
44e4b0a90eSBrooks Davis.Op Fl f
45e4b0a90eSBrooks Davis.Op Fl S Ar size
46e4b0a90eSBrooks Davis.Op Fl s Ar strip
47e4b0a90eSBrooks Davis.Ar name
48e4b0a90eSBrooks Davis.Ar label
49e4b0a90eSBrooks Davis.Ar level
50e4b0a90eSBrooks Davis.Nm
51e4b0a90eSBrooks Davis.Cm delete
52e4b0a90eSBrooks Davis.Op Fl f
53e4b0a90eSBrooks Davis.Ar name
54e4b0a90eSBrooks Davis.Op Ar label | Ar num
55e4b0a90eSBrooks Davis.Nm
56e4b0a90eSBrooks Davis.Cm insert
57e4b0a90eSBrooks Davis.Ar name
58e4b0a90eSBrooks Davis.Ar prov ...
59e4b0a90eSBrooks Davis.Nm
60e4b0a90eSBrooks Davis.Cm remove
61e4b0a90eSBrooks Davis.Ar name
62e4b0a90eSBrooks Davis.Ar prov ...
63e4b0a90eSBrooks Davis.Nm
64e4b0a90eSBrooks Davis.Cm fail
65e4b0a90eSBrooks Davis.Ar name
66e4b0a90eSBrooks Davis.Ar prov ...
67e4b0a90eSBrooks Davis.Nm
68e4b0a90eSBrooks Davis.Cm stop
69e4b0a90eSBrooks Davis.Op Fl fv
70e4b0a90eSBrooks Davis.Ar name ...
71e4b0a90eSBrooks Davis.Nm
72e4b0a90eSBrooks Davis.Cm list
73e4b0a90eSBrooks Davis.Nm
74e4b0a90eSBrooks Davis.Cm status
75e4b0a90eSBrooks Davis.Nm
76e4b0a90eSBrooks Davis.Cm load
77e4b0a90eSBrooks Davis.Nm
78e4b0a90eSBrooks Davis.Cm unload
79e4b0a90eSBrooks Davis.Sh DESCRIPTION
80e4b0a90eSBrooks DavisThe
81e4b0a90eSBrooks Davis.Nm
82e4b0a90eSBrooks Davisutility is used to manage software RAID configurations, supported by the
83e4b0a90eSBrooks DavisGEOM RAID class.
84e4b0a90eSBrooks DavisGEOM RAID class uses on-disk metadata to provide access to software-RAID
85e4b0a90eSBrooks Davisvolumes defined by different RAID BIOSes.
86e4b0a90eSBrooks DavisDepending on RAID BIOS type and its metadata format, different subsets of
87e4b0a90eSBrooks Davisconfigurations and features are supported.
88e4b0a90eSBrooks DavisTo allow booting from RAID volume, the metadata format should match the
89e4b0a90eSBrooks DavisRAID BIOS type and its capabilities.
90e4b0a90eSBrooks DavisTo guarantee that these match, it is recommended to create volumes via the
91e4b0a90eSBrooks DavisRAID BIOS interface, while experienced users are free to do it using this
92e4b0a90eSBrooks Davisutility.
93e4b0a90eSBrooks Davis.Pp
94e4b0a90eSBrooks DavisThe first argument to
95e4b0a90eSBrooks Davis.Nm
96e4b0a90eSBrooks Davisindicates an action to be performed:
97e4b0a90eSBrooks Davis.Bl -tag -width ".Cm destroy"
98e4b0a90eSBrooks Davis.It Cm label
99e4b0a90eSBrooks DavisCreate an array with single volume.
100e4b0a90eSBrooks DavisThe
101e4b0a90eSBrooks Davis.Ar format
102e4b0a90eSBrooks Davisargument specifies the on-disk metadata format to use for this array,
103e4b0a90eSBrooks Davissuch as "Intel".
104e4b0a90eSBrooks DavisThe
105e4b0a90eSBrooks Davis.Ar label
106e4b0a90eSBrooks Davisargument specifies the label of the created volume.
107e4b0a90eSBrooks DavisThe
108e4b0a90eSBrooks Davis.Ar level
109e4b0a90eSBrooks Davisargument specifies the RAID level of the created volume, such as:
110e4b0a90eSBrooks Davis"RAID0", "RAID1", etc.
111e4b0a90eSBrooks DavisThe subsequent list enumerates providers to use as array components.
112e4b0a90eSBrooks DavisThe special name "NONE" can be used to reserve space for absent disks.
113e4b0a90eSBrooks DavisThe order of components can be important, depending on specific RAID level
114e4b0a90eSBrooks Davisand metadata format.
115e4b0a90eSBrooks Davis.Pp
116e4b0a90eSBrooks DavisAdditional options include:
117e4b0a90eSBrooks Davis.Bl -tag -width ".Fl s Ar strip"
118e4b0a90eSBrooks Davis.It Fl f
119e4b0a90eSBrooks DavisEnforce specified configuration creation if it is officially unsupported,
120e4b0a90eSBrooks Davisbut technically can be created.
121e4b0a90eSBrooks Davis.It Fl o Ar fmtopt
122e4b0a90eSBrooks DavisSpecifies metadata format options.
123e4b0a90eSBrooks Davis.It Fl S Ar size
124e4b0a90eSBrooks DavisUse
125e4b0a90eSBrooks Davis.Ar size
126e4b0a90eSBrooks Davisbytes on each component for this volume.
127e4b0a90eSBrooks DavisShould be used if several volumes per array are planned, or if smaller
128e4b0a90eSBrooks Daviscomponents going to be inserted later.
129e4b0a90eSBrooks DavisDefaults to size of the smallest component.
130e4b0a90eSBrooks Davis.It Fl s Ar strip
131e4b0a90eSBrooks DavisSpecifies strip size in bytes.
132e4b0a90eSBrooks DavisDefaults to 131072.
133e4b0a90eSBrooks Davis.El
134e4b0a90eSBrooks Davis.It Cm add
135e4b0a90eSBrooks DavisCreate another volume on the existing array.
136e4b0a90eSBrooks DavisThe
137e4b0a90eSBrooks Davis.Ar name
138e4b0a90eSBrooks Davisargument is the name of the existing array, reported by label command.
139e4b0a90eSBrooks DavisThe rest of arguments are the same as for the label command.
140e4b0a90eSBrooks Davis.It Cm delete
141e4b0a90eSBrooks DavisDelete volume(s) from the existing array.
142e4b0a90eSBrooks DavisWhen the last volume is deleted, the array is also deleted and its metadata
143e4b0a90eSBrooks Daviserased.
144e4b0a90eSBrooks DavisThe
145e4b0a90eSBrooks Davis.Ar name
146e4b0a90eSBrooks Davisargument is the name of existing array.
147e4b0a90eSBrooks DavisOptional
148e4b0a90eSBrooks Davis.Ar label
149e4b0a90eSBrooks Davisor
150e4b0a90eSBrooks Davis.Ar num
151e4b0a90eSBrooks Davisarguments allow specifying volume for deletion.
152e4b0a90eSBrooks Davis.Pp
153e4b0a90eSBrooks DavisAdditional options include:
154e4b0a90eSBrooks Davis.Bl -tag -width ".Fl f"
155e4b0a90eSBrooks Davis.It Fl f
156e4b0a90eSBrooks DavisDelete volume(s) even if it is still open.
157e4b0a90eSBrooks Davis.El
158e4b0a90eSBrooks Davis.It Cm insert
159e4b0a90eSBrooks DavisInsert specified provider(s) into specified array instead of the first missing
160e4b0a90eSBrooks Davisor failed components.
161e4b0a90eSBrooks DavisIf there are no such components, mark disk(s) as spare.
162e4b0a90eSBrooks Davis.It Cm remove
163e4b0a90eSBrooks DavisRemove the specified provider(s) from the specified array and erase metadata.
164e4b0a90eSBrooks DavisIf there are spare disks present, the removed disk(s) will be replaced by
165e4b0a90eSBrooks Davisspares.
166e4b0a90eSBrooks Davis.It Cm fail
167e4b0a90eSBrooks DavisMark the given disks(s) as failed, removing from active use unless absolutely
168e4b0a90eSBrooks Davisnecessary due to exhausted redundancy.
169e4b0a90eSBrooks DavisIf there are spare disks present - failed disk(s) will be replaced with one
170e4b0a90eSBrooks Davisof them.
171e4b0a90eSBrooks Davis.It Cm stop
172e4b0a90eSBrooks DavisStop the given array.
173e4b0a90eSBrooks DavisThe metadata will not be erased.
174e4b0a90eSBrooks Davis.Pp
175e4b0a90eSBrooks DavisAdditional options include:
176e4b0a90eSBrooks Davis.Bl -tag -width ".Fl f"
177e4b0a90eSBrooks Davis.It Fl f
178e4b0a90eSBrooks DavisStop the given array even if some of its volumes are opened.
179e4b0a90eSBrooks Davis.El
180e4b0a90eSBrooks Davis.It Cm list
181e4b0a90eSBrooks DavisSee
182e4b0a90eSBrooks Davis.Xr geom 8 .
183e4b0a90eSBrooks Davis.It Cm status
184e4b0a90eSBrooks DavisSee
185e4b0a90eSBrooks Davis.Xr geom 8 .
186e4b0a90eSBrooks Davis.It Cm load
187e4b0a90eSBrooks DavisSee
188e4b0a90eSBrooks Davis.Xr geom 8 .
189e4b0a90eSBrooks Davis.It Cm unload
190e4b0a90eSBrooks DavisSee
191e4b0a90eSBrooks Davis.Xr geom 8 .
192e4b0a90eSBrooks Davis.El
193e4b0a90eSBrooks Davis.Pp
194e4b0a90eSBrooks DavisAdditional options include:
195e4b0a90eSBrooks Davis.Bl -tag -width ".Fl v"
196e4b0a90eSBrooks Davis.It Fl v
197e4b0a90eSBrooks DavisBe more verbose.
198e4b0a90eSBrooks Davis.El
199e4b0a90eSBrooks Davis.Sh SUPPORTED METADATA FORMATS
200e4b0a90eSBrooks DavisThe GEOM RAID class follows a modular design, allowing different metadata
201e4b0a90eSBrooks Davisformats to be used.
202e4b0a90eSBrooks DavisSupport is currently implemented for the following formats:
203e4b0a90eSBrooks Davis.Bl -tag -width "Intel"
204e4b0a90eSBrooks Davis.It DDF
205e4b0a90eSBrooks DavisThe format defined by the SNIA Common RAID Disk Data Format v2.0 specification.
206e4b0a90eSBrooks DavisUsed by some Adaptec RAID BIOSes and some hardware RAID controllers.
207e4b0a90eSBrooks DavisBecause of high format flexibility different implementations support
208e4b0a90eSBrooks Davisdifferent set of features and have different on-disk metadata layouts.
209e4b0a90eSBrooks DavisTo provide compatibility, the GEOM RAID class mimics capabilities
210e4b0a90eSBrooks Davisof the first detected DDF array.
211e4b0a90eSBrooks DavisRespecting that, it may support different number of disks per volume,
212e4b0a90eSBrooks Davisvolumes per array, partitions per disk, etc.
213e4b0a90eSBrooks DavisThe following configurations are supported: RAID0 (2+ disks), RAID1 (2+ disks),
214e4b0a90eSBrooks DavisRAID1E (3+ disks), RAID3 (3+ disks), RAID4 (3+ disks), RAID5 (3+ disks),
215e4b0a90eSBrooks DavisRAID5E (4+ disks), RAID5EE (4+ disks), RAID5R (3+ disks), RAID6 (4+ disks),
216e4b0a90eSBrooks DavisRAIDMDF (4+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks).
217e4b0a90eSBrooks Davis.Pp
218e4b0a90eSBrooks DavisFormat supports two options "BE" and "LE", that mean big-endian byte order
219e4b0a90eSBrooks Davisdefined by specification (default) and little-endian used by some Adaptec
220e4b0a90eSBrooks Daviscontrollers.
221e4b0a90eSBrooks Davis.It Intel
222e4b0a90eSBrooks DavisThe format used by Intel RAID BIOS.
223e4b0a90eSBrooks DavisSupports up to two volumes per array.
224e4b0a90eSBrooks DavisSupports configurations: RAID0 (2+ disks), RAID1 (2 disks),
225e4b0a90eSBrooks DavisRAID5 (3+ disks), RAID10 (4 disks).
226e4b0a90eSBrooks DavisConfigurations not supported by Intel RAID BIOS, but enforceable on your own
227e4b0a90eSBrooks Davisrisk: RAID1 (3+ disks), RAID1E (3+ disks), RAID10 (6+ disks).
228e4b0a90eSBrooks Davis.It JMicron
229e4b0a90eSBrooks DavisThe format used by JMicron RAID BIOS.
230e4b0a90eSBrooks DavisSupports one volume per array.
231e4b0a90eSBrooks DavisSupports configurations: RAID0 (2+ disks), RAID1 (2 disks),
232e4b0a90eSBrooks DavisRAID10 (4 disks), CONCAT (2+ disks).
233e4b0a90eSBrooks DavisConfigurations not supported by JMicron RAID BIOS, but enforceable on your own
234e4b0a90eSBrooks Davisrisk: RAID1 (3+ disks), RAID1E (3+ disks), RAID10 (6+ disks), RAID5 (3+ disks).
235e4b0a90eSBrooks Davis.It NVIDIA
236e4b0a90eSBrooks DavisThe format used by NVIDIA MediaShield RAID BIOS.
237e4b0a90eSBrooks DavisSupports one volume per array.
238e4b0a90eSBrooks DavisSupports configurations: RAID0 (2+ disks), RAID1 (2 disks),
239e4b0a90eSBrooks DavisRAID5 (3+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks).
240e4b0a90eSBrooks DavisConfigurations not supported by NVIDIA MediaShield RAID BIOS, but enforceable
241e4b0a90eSBrooks Davison your own risk: RAID1 (3+ disks).
242e4b0a90eSBrooks Davis.It Promise
243e4b0a90eSBrooks DavisThe format used by Promise and AMD/ATI RAID BIOSes.
244e4b0a90eSBrooks DavisSupports multiple volumes per array.
245e4b0a90eSBrooks DavisEach disk can be split to be used by up to two arbitrary volumes.
246e4b0a90eSBrooks DavisSupports configurations: RAID0 (2+ disks), RAID1 (2 disks),
247e4b0a90eSBrooks DavisRAID5 (3+ disks), RAID10 (4 disks), SINGLE (1 disk), CONCAT (2+ disks).
248e4b0a90eSBrooks DavisConfigurations not supported by RAID BIOSes, but enforceable on your
249e4b0a90eSBrooks Davisown risk: RAID1 (3+ disks), RAID10 (6+ disks).
250e4b0a90eSBrooks Davis.It SiI
251e4b0a90eSBrooks DavisThe format used by SiliconImage RAID BIOS.
252e4b0a90eSBrooks DavisSupports one volume per array.
253e4b0a90eSBrooks DavisSupports configurations: RAID0 (2+ disks), RAID1 (2 disks),
254e4b0a90eSBrooks DavisRAID5 (3+ disks), RAID10 (4 disks), SINGLE (1 disk), CONCAT (2+ disks).
255e4b0a90eSBrooks DavisConfigurations not supported by SiliconImage RAID BIOS, but enforceable on your
256e4b0a90eSBrooks Davisown risk: RAID1 (3+ disks), RAID10 (6+ disks).
257e4b0a90eSBrooks Davis.El
258e4b0a90eSBrooks Davis.Sh SUPPORTED RAID LEVELS
259e4b0a90eSBrooks DavisThe GEOM RAID class follows a modular design, allowing different RAID levels
260e4b0a90eSBrooks Davisto be used.
261e4b0a90eSBrooks DavisFull support for the following RAID levels is currently implemented:
262e4b0a90eSBrooks DavisRAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT.
263e4b0a90eSBrooks DavisThe following RAID levels supported as read-only for volumes in optimal
264e4b0a90eSBrooks Davisstate (without using redundancy): RAID4, RAID5, RAID5E, RAID5EE, RAID5R,
265e4b0a90eSBrooks DavisRAID6, RAIDMDF.
266e4b0a90eSBrooks Davis.Sh RAID LEVEL MIGRATION
267e4b0a90eSBrooks DavisThe GEOM RAID class has no support for RAID level migration, allowed by some
268e4b0a90eSBrooks Davismetadata formats.
269e4b0a90eSBrooks DavisIf you started migration using BIOS or in some other way, make sure to
270e4b0a90eSBrooks Daviscomplete it there.
271e4b0a90eSBrooks DavisDo not run GEOM RAID class on migrating volumes under pain of possible data
272e4b0a90eSBrooks Daviscorruption!
273e4b0a90eSBrooks Davis.Sh 2TiB BARRIERS
274e4b0a90eSBrooks DavisNVIDIA metadata format does not support volumes above 2TiB.
275e4b0a90eSBrooks Davis.Sh SYSCTL VARIABLES
276e4b0a90eSBrooks DavisThe following
277e4b0a90eSBrooks Davis.Xr sysctl 8
278e4b0a90eSBrooks Davisvariable can be used to control the behavior of the
279e4b0a90eSBrooks Davis.Nm RAID
280e4b0a90eSBrooks DavisGEOM class.
281e4b0a90eSBrooks Davis.Bl -tag -width indent
282e4b0a90eSBrooks Davis.It Va kern.geom.raid.aggressive_spare : No 0
283e4b0a90eSBrooks DavisUse any disks without metadata connected to controllers of the vendor
284e4b0a90eSBrooks Davismatching to volume metadata format as spare.
285e4b0a90eSBrooks DavisUse it with much care to not lose data if connecting unrelated disk!
286e4b0a90eSBrooks Davis.It Va kern.geom.raid.clean_time : No 5
287e4b0a90eSBrooks DavisMark volume as clean when idle for the specified number of seconds.
288e4b0a90eSBrooks Davis.It Va kern.geom.raid.debug : No 0
289e4b0a90eSBrooks DavisDebug level of the
290e4b0a90eSBrooks Davis.Nm RAID
291e4b0a90eSBrooks DavisGEOM class.
292e4b0a90eSBrooks Davis.It Va kern.geom.raid.enable : No 1
293e4b0a90eSBrooks DavisEnable on-disk metadata taste.
294e4b0a90eSBrooks Davis.It Va kern.geom.raid.idle_threshold : No 1000000
295e4b0a90eSBrooks DavisTime in microseconds to consider a volume idle for rebuild purposes.
296e4b0a90eSBrooks Davis.It Va kern.geom.raid.name_format : No 0
297e4b0a90eSBrooks DavisProviders name format: 0 -- raid/r{num}, 1 -- raid/{label}.
298e4b0a90eSBrooks Davis.It Va kern.geom.raid.read_err_thresh : No 10
299e4b0a90eSBrooks DavisNumber of read errors equated to disk failure.
300e4b0a90eSBrooks DavisWrite errors are always considered as disk failures.
301e4b0a90eSBrooks Davis.It Va kern.geom.raid.start_timeout : No 30
302e4b0a90eSBrooks DavisTime to wait for missing array components on startup.
303e4b0a90eSBrooks Davis.It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1
304e4b0a90eSBrooks DavisEnable taste for specific metadata or transformation module.
305e4b0a90eSBrooks Davis.El
306e4b0a90eSBrooks Davis.Sh EXIT STATUS
307e4b0a90eSBrooks DavisExit status is 0 on success, and non-zero if the command fails.
308e4b0a90eSBrooks Davis.Sh SEE ALSO
309e4b0a90eSBrooks Davis.Xr geom 4 ,
310*27bd6c32SJohn Baldwin.Xr geom 8
311e4b0a90eSBrooks Davis.Sh HISTORY
312e4b0a90eSBrooks DavisThe
313e4b0a90eSBrooks Davis.Nm
314e4b0a90eSBrooks Davisutility appeared in
315e4b0a90eSBrooks Davis.Fx 9.0 .
316e4b0a90eSBrooks Davis.Sh AUTHORS
317e4b0a90eSBrooks Davis.An Alexander Motin Aq Mt mav@FreeBSD.org
318e4b0a90eSBrooks Davis.An M. Warner Losh Aq Mt imp@FreeBSD.org
319