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