summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mfiutil/mfiutil.8
blob: b1be5d96f28e0c61bafc6e7987a4e8329fe235de (plain)
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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
.\" Copyright (c) 2008, 2009 Yahoo!, Inc.
.\" 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.
.\" 3. The names of the authors may not be used to endorse or promote
.\"    products derived from this software without specific prior written
.\"    permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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 September 2, 2011
.Dt MFIUTIL 8
.Os
.Sh NAME
.Nm mfiutil
.Nd Utility for managing LSI MegaRAID SAS controllers
.Sh SYNOPSIS
.Nm
.Cm version
.Nm
.Op Fl u Ar unit
.Cm show adapter
.Nm
.Op Fl u Ar unit
.Cm show battery
.Nm
.Op Fl d
.Op Fl e
.Op Fl u Ar unit
.Cm show config
.Nm
.Op Fl u Ar unit
.Cm show drives
.Nm
.Op Fl u Ar unit
.Cm show events
.Op Fl c Ar class
.Op Fl l Ar locale
.Op Fl n Ar count
.Op Fl v
.Op Ar start Op Ar stop
.Nm
.Op Fl u Ar unit
.Cm show firmware
.Nm
.Op Fl u Ar unit
.Cm show logstate
.Nm
.Op Fl d
.Op Fl e
.Op Fl u Ar unit
.Cm show patrol
.Nm
.Op Fl d
.Op Fl e
.Op Fl u Ar unit
.Cm show progress
.Nm
.Op Fl u Ar unit
.Cm show volumes
.Nm
.Op Fl u Ar unit
.Cm fail Ar drive
.Nm
.Op Fl u Ar unit
.Cm good Ar drive
.Nm
.Op Fl u Ar unit
.Cm rebuild Ar drive
.Nm
.Op Fl u Ar unit
.Cm drive progress Ar drive
.Nm
.Op Fl u Ar unit
.Cm drive clear Ar drive Brq "start | stop"
.Nm
.Op Fl u Ar unit
.Cm start rebuild Ar drive
.Nm
.Op Fl u Ar unit
.Cm abort rebuild Ar drive
.Nm
.Op Fl u Ar unit
.Cm locate Ar drive Brq "on | off"
.Nm
.Op Fl u Ar unit
.Cm cache Ar volume Op Ar setting Oo Ar value Oc Op ...
.Nm
.Op Fl u Ar unit
.Cm name Ar volume Ar name
.Nm
.Op Fl u Ar unit
.Cm volume progress Ar volume
.Nm
.Op Fl u Ar unit
.Cm clear
.Nm
.Op Fl u Ar unit
.Cm create Ar type
.Op Fl v
.Op Fl s Ar stripe_size
.Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
.Op Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
.Nm
.Op Fl u Ar unit
.Cm delete Ar volume
.Nm
.Op Fl u Ar unit
.Cm add Ar drive Op Ar volume
.Nm
.Op Fl u Ar unit
.Cm remove Ar drive
.Nm
.Op Fl u Ar unit
.Cm start patrol
.Nm
.Op Fl u Ar unit
.Cm stop patrol
.Nm
.Op Fl u Ar unit
.Cm patrol Ar command Op Ar interval Op Ar start
.Nm
.Op Fl u Ar unit
.Cm flash Ar file
.Sh DESCRIPTION
The
.Nm
utility can be used to display or modify various parameters on LSI
MegaRAID SAS RAID controllers.
Each invocation of
.Nm
consists of zero or more global options followed by a command.
Commands may support additional optional or required arguments after the
command.
.Pp
Currently one global option is supported:
.Bl -tag -width indent
.It Fl u Ar unit
.Ar unit
specifies the unit of the controller to work with.
If no unit is specified,
then unit 0 is used.
.El
.Pp
Various commands accept either or both of the two options:
.Bl -tag -width indent
.It Fl d
Print numeric device IDs as drive identifier.
This is the default.
Useful in combination with
.Fl e
to print both, numeric device IDs and enclosure:slot information.
.It Fl e
Print drive identifiers in enclosure:slot form.
See next paragraph on format details in context of input rather than
output.
.El
.Pp
Drives may be specified in two forms.
First,
a drive may be identified by its device ID.
The device ID for configured drives can be found in
.Cm show config .
Second,
a drive may be identified by its location as
.Sm off
.Op E Ar xx Ns \&:
.Li S Ns Ar yy
.Sm on
where
.Ar xx
is the enclosure
and
.Ar yy
is the slot for each drive as displayed in
.Cm show drives .
.Pp
Volumes may be specified in two forms.
First,
a volume may be identified by its target ID.
Second,
on the volume may be specified by the corresponding
.Em mfidX
device,
such as
.Em mfid0 .
.Pp
The
.Nm
utility supports several different groups of commands.
The first group of commands provide information about the controller,
the volumes it manages, and the drives it controls.
The second group of commands are used to manage the physical drives
attached to the controller.
The third group of commands are used to manage the logical volumes
managed by the controller.
The fourth group of commands are used to manage the drive configuration for
the controller.
The fifth group of commands are used to manage controller-wide operations.
.Pp
The informational commands include:
.Bl -tag -width indent
.It Cm version
Displays the version of
.Nm .
.It Cm show adapter
Displays information about the RAID controller such as the model number.
.It Cm show battery
Displays information about the battery from the battery backup unit.
.It Cm show config
Displays the volume and drive configuration for the controller.
Each array is listed along with the physical drives the array is built from.
Each volume is listed along with the arrays that the volume spans.
If any hot spare drives are configured, then they are listed as well.
.It Cm show drives
Lists all of the physical drives attached to the controller.
.It Xo Cm show events
.Op Fl c Ar class
.Op Fl l Ar locale
.Op Fl n Ar count
.Op Fl v
.Op Ar start Op Ar stop
.Xc
Display entries from the controller's event log.
The controller maintains a circular buffer of events.
Each event is tagged with a class and locale.
.Pp
The
.Ar class
parameter limits the output to entries at the specified class or higher.
The default class is
.Dq warn .
The available classes from lowest priority to highest are:
.Bl -tag -width indent
.It Cm debug
Debug messages.
.It Cm progress
Periodic progress updates for long-running operations such as background
initializations, array rebuilds, or patrol reads.
.It Cm info
Informational messages such as drive insertions and volume creations.
.It Cm warn
Indicates that some component may be close to failing.
.It Cm crit
A component has failed, but no data is lost.
For example, a volume becoming degraded due to a drive failure.
.It Cm fatal
A component has failed resulting in data loss.
.It Cm dead
The controller itself has died.
.El
.Pp
The
.Ar locale
parameter limits the output to entries for the specified part of the controller.
The default locale is
.Dq all .
The available locales are
.Dq volume ,
.Dq drive ,
.Dq enclosure ,
.Dq battery ,
.Dq sas ,
.Dq controller ,
.Dq config ,
.Dq cluster ,
and
.Dq all .
.Pp
The
.Ar count
parameter is a debugging aid that specifies the number of events to fetch from
the controller for each low-level request.
The default is 15 events.
.Pp
By default, matching event log entries from the previous shutdown up to the
present are displayed.  This range can be adjusted via the
.Ar start
and
.Ar stop
parameters.
Each of these parameters can either be specified as a log entry number or as
one of the following aliases:
.Bl -tag -width indent
.It Cm newest
The newest entry in the event log.
.It Cm oldest
The oldest entry in the event log.
.It Cm clear
The first entry since the event log was cleared.
.It Cm shutdown
The entry in the event log corresponding to the last time the controller was
cleanly shut down.
.It Cm boot
The entry in the event log corresponding to the most recent boot.
.El
.It Cm show firmware
Lists all of the firmware images present on the controller.
.It Cm show logstate
Display the various sequence numbers associated with the event log.
.It Cm show patrol
Display the status of the controller's patrol read operation.
.It Cm show progress
Report the current progress and estimated completion time for active
operations on all volumes and drives.
.It Cm show volumes
Lists all of the logical volumes managed by the controller.
.El
.Pp
The physical drive management commands include:
.Bl -tag -width indent
.It Cm fail Ar drive
Mark
.Ar drive
as failed.
.Ar Drive
must be an online drive that is part of an array.
.It Cm good Ar drive
Mark
.Ar drive
as an unconfigured good drive.
.Ar Drive
must not be part of an existing array.
.It Cm rebuild Ar drive
Mark a failed
.Ar drive
that is still part of an array as a good drive suitable for a rebuild.
The firmware should kick off an array rebuild on its own if a failed drive
is marked as a rebuild drive.
.It Cm drive progress Ar drive
Report the current progress and estimated completion time of drive operations
such as rebuilds or patrol reads.
.It Cm drive clear Ar drive Brq "start | stop"
Start or stop the writing of all 0x00 characters to a drive.
.It Cm start rebuild Ar drive
Manually start a rebuild on
.Ar drive .
.It Cm abort rebuild Ar drive
Abort an in-progress rebuild operation on
.Ar drive .
It can be resumed with the
.Cm start rebuild
command.
.It Cm locate Ar drive Brq "on | off"
Change the state of the external LED associated with
.Ar drive .
.El
.Pp
The logical volume management commands include:
.Bl -tag -width indent
.It Cm cache Ar volume Op Ar setting Oo Ar value Oc Op ...
If no
.Ar setting
arguments are supplied, then the current cache policy for
.Ar volume
is displayed;
otherwise,
the cache policy for
.Ar volume
is modified.
One or more
.Ar setting
arguments may be given.
Some settings take an additional
.Ar value
argument as noted below.
The valid settings are:
.Bl -tag -width indent
.It Cm enable
Enable caching for both read and write I/O operations.
.It Cm disable
Disable caching for both read and write I/O operations.
.It Cm reads
Enable caching only for read I/O operations.
.It Cm writes
Enable caching only for write I/O operations.
.It Cm write-back
Use write-back policy for cached writes.
.It Cm write-through
Use write-through policy for cached writes.
.It Cm read-ahead Ar value
Set the read ahead policy for cached reads.
The
.Ar value
argument can be set to either
.Dq none ,
.Dq adaptive ,
or
.Dq always .
.It Cm bad-bbu-write-cache Ar value
Control the behavior of I/O write caching if the battery is dead or
missing.
The
.Ar value
argument can be set to either
.Dq disable
or
.Dq enable .
In general this setting should be left disabled to avoid data loss when
the system loses power.
.It Cm write-cache Ar value
Control the write caches on the physical drives backing
.Ar volume .
The
.Ar value
argument can be set to either
.Dq disable ,
.Dq enable ,
or
.Dq default .
.Pp
In general this setting should be left disabled to avoid data loss when the
physical drives lose power.
The battery backup of the RAID controller does not save data in the write
caches of the physical drives.
.El
.It Cm name Ar volume Ar name
Sets the name of
.Ar volume
to
.Ar name .
.It Cm volume progress Ar volume
Report the current progress and estimated completion time of volume operations
such as consistency checks and initializations.
.El
.Pp
The configuration commands include:
.Bl -tag -width indent
.It Cm clear
Delete the entire configuration including all volumes, arrays, and spares.
.It Xo Cm create Ar type
.Op Fl v
.Op Fl s Ar stripe_size
.Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
.Op Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
.Xc
Create a new volume.
The
.Ar type
specifies the type of volume to create.
Currently supported types include:
.Bl -tag -width indent
.It Cm jbod
Creates a RAID0 volume for each drive specified.
Each drive must be specified as a separate argument.
.It Cm raid0
Creates one RAID0 volume spanning the drives listed in the single drive list.
.It Cm raid1
Creates one RAID1 volume spanning the drives listed in the single drive list.
.It Cm raid5
Creates one RAID5 volume spanning the drives listed in the single drive list.
.It Cm raid6
Creates one RAID6 volume spanning the drives listed in the single drive list.
.It Cm raid10
Creates one RAID10 volume spanning multiple RAID1 arrays.
The drives for each RAID1 array are specified as a single drive list.
.It Cm raid50
Creates one RAID50 volume spanning multiple RAID5 arrays.
The drives for each RAID5 array are specified as a single drive list.
.It Cm raid60
Creates one RAID60 volume spanning multiple RAID6 arrays.
The drives for each RAID6 array are specified as a single drive list.
.It Cm concat
Creates a single volume by concatenating all of the drives in the single drive
list.
.El
.Pp
.Sy Note:
Not all volume types are supported by all controllers.
.Pp
If the
.Fl v
flag is specified after
.Ar type ,
then more verbose output will be enabled.
Currently this just provides notification as drives are added to arrays and
arrays to volumes when building the configuration.
.Pp
The
.Fl s
.Ar stripe_size
parameter allows the stripe size of the array to be set.
By default a stripe size of 64K is used.
Valid values are 512 through 1M, though the MFI firmware may reject some
values.
.It Cm delete Ar volume
Delete the volume
.Ar volume .
.It Cm add Ar drive Op Ar volume
Mark
.Ar drive
as a hot spare.
.Ar Drive
must be in the unconfigured good state.
If
.Ar volume
is specified,
then the hot spare will be dedicated to arrays backing that volume.
Otherwise,
.Ar drive
will be used as a global hot spare backing all arrays for this controller.
Note that
.Ar drive
must be as large as the smallest drive in all of the arrays it is going to
back.
.It Cm remove Ar drive
Remove the hot spare
.Ar drive
from service.
It will be placed in the unconfigured good state.
.El
.Pp
The controller management commands include:
.Bl -tag -width indent
.It Cm patrol Ar command Op Ar interval Op Ar start
Set the patrol read operation mode.
The
.Ar command
argument can be one of the following values:
.Bl -tag -width indent
.It Cm disable
Disable patrol reads.
.It Cm auto
Enable periodic patrol reads initiated by the firmware.
The optional
.Ar interval
argument specifies the interval in seconds between patrol reads.
If patrol reads should be run continuously,
then
.Ar interval
should consist of the word
.Dq continuously .
The optional
.Ar start
argument specifies a non-negative, relative start time for the next patrol read.
If an interval or start time is not specified,
then the existing setting will be used.
.It Cm manual
Enable manual patrol reads that are only initiated by the user.
.El
.It Cm start patrol
Start a patrol read operation.
.It Cm stop patrol
Stop a currently running patrol read operation.
.It Cm flash Ar file
Updates the flash on the controller with the firmware stored in
.Ar file .
A reboot is required for the new firmware to take effect.
.El
.Sh EXAMPLES
Configure the cache for volume mfid0 to cache only writes:
.Pp
.Dl Nm Cm cache mfid0 writes
.Dl Nm Cm cache mfid0 write-back
.Pp
Create a RAID5 array spanning the first four disks in the second enclosure:
.Pp
.Dl Nm Cm create raid5 e1:s0,e1:s1,e1:s2,e1:s4
.Pp
Configure the first three disks on a controller as JBOD:
.Pp
.Dl Nm Cm create jbod 0 1 2
.Pp
Create a RAID10 volume that spans two arrays each of which contains two disks
from two different enclosures:
.Pp
.Dl Nm Cm create raid10 e1:s0,e1:s1 e2:s0,e2:s1
.Pp
Add drive with the device ID of 4 as a global hot spare:
.Pp
.Dl Nm Cm add 4
.Pp
Add the drive in slot 2 in the main chassis as a hot spare for volume mfid0:
.Pp
.Dl Nm Cm add s2 mfid0
.Pp
Configure the adapter to run periodic patrol reads once a week with the first
patrol read starting in 5 minutes:
.Pp
.Dl Nm Cm patrol auto 604800 300
.Sh SEE ALSO
.Xr mfi 4
.Sh HISTORY
The
.Nm
utility first appeared in
.Fx 8.0 .
OpenPOWER on IntegriCloud