]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.sbin/mfiutil/mfiutil.8
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / usr.sbin / mfiutil / mfiutil.8
1 .\" Copyright (c) 2008, 2009 Yahoo!, Inc.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. The names of the authors may not be used to endorse or promote
13 .\"    products derived from this software without specific prior written
14 .\"    permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\" $FreeBSD$
29 .\"
30 .Dd September 2, 2011
31 .Dt MFIUTIL 8
32 .Os
33 .Sh NAME
34 .Nm mfiutil
35 .Nd Utility for managing LSI MegaRAID SAS controllers
36 .Sh SYNOPSIS
37 .Nm
38 .Cm version
39 .Nm
40 .Op Fl u Ar unit
41 .Cm show adapter
42 .Nm
43 .Op Fl u Ar unit
44 .Cm show battery
45 .Nm
46 .Op Fl d
47 .Op Fl e
48 .Op Fl u Ar unit
49 .Cm show config
50 .Nm
51 .Op Fl u Ar unit
52 .Cm show drives
53 .Nm
54 .Op Fl u Ar unit
55 .Cm show events
56 .Op Fl c Ar class
57 .Op Fl l Ar locale
58 .Op Fl n Ar count
59 .Op Fl v
60 .Op Ar start Op Ar stop
61 .Nm
62 .Op Fl u Ar unit
63 .Cm show firmware
64 .Nm
65 .Op Fl u Ar unit
66 .Cm show foreign Op Ar volume
67 .Nm
68 .Op Fl u Ar unit
69 .Cm show logstate
70 .Nm
71 .Op Fl d
72 .Op Fl e
73 .Op Fl u Ar unit
74 .Cm show patrol
75 .Nm
76 .Op Fl d
77 .Op Fl e
78 .Op Fl u Ar unit
79 .Cm show progress
80 .Nm
81 .Op Fl u Ar unit
82 .Cm show volumes
83 .Nm
84 .Op Fl u Ar unit
85 .Cm fail Ar drive
86 .Nm
87 .Op Fl u Ar unit
88 .Cm good Ar drive
89 .Nm
90 .Op Fl u Ar unit
91 .Cm rebuild Ar drive
92 .Nm
93 .Op Fl u Ar unit
94 .Cm drive progress Ar drive
95 .Nm
96 .Op Fl u Ar unit
97 .Cm drive clear Ar drive Brq "start | stop"
98 .Nm
99 .Op Fl u Ar unit
100 .Cm start rebuild Ar drive
101 .Nm
102 .Op Fl u Ar unit
103 .Cm abort rebuild Ar drive
104 .Nm
105 .Op Fl u Ar unit
106 .Cm locate Ar drive Brq "on | off"
107 .Nm
108 .Op Fl u Ar unit
109 .Cm cache Ar volume Op Ar setting Oo Ar value Oc Op ...
110 .Nm
111 .Op Fl u Ar unit
112 .Cm name Ar volume Ar name
113 .Nm
114 .Op Fl u Ar unit
115 .Cm volume progress Ar volume
116 .Nm
117 .Op Fl u Ar unit
118 .Cm clear
119 .Nm
120 .Op Fl u Ar unit
121 .Cm create Ar type
122 .Op Fl v
123 .Op Fl s Ar stripe_size
124 .Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
125 .Op Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
126 .Nm
127 .Op Fl u Ar unit
128 .Cm delete Ar volume
129 .Nm
130 .Op Fl u Ar unit
131 .Cm add Ar drive Op Ar volume
132 .Nm
133 .Op Fl u Ar unit
134 .Cm remove Ar drive
135 .Nm
136 .Op Fl u Ar unit
137 .Cm start patrol
138 .Nm
139 .Op Fl u Ar unit
140 .Cm stop patrol
141 .Nm
142 .Op Fl u Ar unit
143 .Cm patrol Ar command Op Ar interval Op Ar start
144 .Nm
145 .Op Fl u Ar unit
146 .Cm foreign scan
147 .Nm
148 .Op Fl u Ar unit
149 .Cm foreign clear Op Ar config
150 .Nm
151 .Op Fl u Ar unit
152 .Cm foreign diag Op Ar config
153 .Nm
154 .Op Fl u Ar unit
155 .Cm foreign preview Op Ar config
156 .Nm
157 .Op Fl u Ar unit
158 .Cm foreign import Op Ar config
159 .Nm
160 .Op Fl u Ar unit
161 .Cm flash Ar file
162 .Nm
163 .Op Fl u Ar unit
164 .Cm start learn
165 .Nm
166 .Op Fl u Ar unit
167 .Cm bbu Ar setting Ar value
168 .Sh DESCRIPTION
169 The
170 .Nm
171 utility can be used to display or modify various parameters on LSI
172 MegaRAID SAS RAID controllers.
173 Each invocation of
174 .Nm
175 consists of zero or more global options followed by a command.
176 Commands may support additional optional or required arguments after the
177 command.
178 .Pp
179 Currently one global option is supported:
180 .Bl -tag -width indent
181 .It Fl u Ar unit
182 .Ar unit
183 specifies the unit of the controller to work with.
184 If no unit is specified,
185 then unit 0 is used.
186 .El
187 .Pp
188 Various commands accept either or both of the two options:
189 .Bl -tag -width indent
190 .It Fl d
191 Print numeric device IDs as drive identifier.
192 This is the default.
193 Useful in combination with
194 .Fl e
195 to print both, numeric device IDs and enclosure:slot information.
196 .It Fl e
197 Print drive identifiers in enclosure:slot form.
198 See next paragraph on format details in context of input rather than
199 output.
200 .El
201 .Pp
202 Drives may be specified in two forms.
203 First,
204 a drive may be identified by its device ID.
205 The device ID for configured drives can be found in
206 .Cm show config .
207 Second,
208 a drive may be identified by its location as
209 .Sm off
210 .Op E Ar xx Ns \&:
211 .Li S Ns Ar yy
212 .Sm on
213 where
214 .Ar xx
215 is the enclosure
216 and
217 .Ar yy
218 is the slot for each drive as displayed in
219 .Cm show drives .
220 .Pp
221 Volumes may be specified in two forms.
222 First,
223 a volume may be identified by its target ID.
224 Second,
225 on the volume may be specified by the corresponding
226 .Em mfidX
227 device,
228 such as
229 .Em mfid0 .
230 .Pp
231 The
232 .Nm
233 utility supports several different groups of commands.
234 The first group of commands provide information about the controller,
235 the volumes it manages, and the drives it controls.
236 The second group of commands are used to manage the physical drives
237 attached to the controller.
238 The third group of commands are used to manage the logical volumes
239 managed by the controller.
240 The fourth group of commands are used to manage the drive configuration for
241 the controller.
242 The fifth group of commands are used to manage controller-wide operations.
243 .Pp
244 The informational commands include:
245 .Bl -tag -width indent
246 .It Cm version
247 Displays the version of
248 .Nm .
249 .It Cm show adapter
250 Displays information about the RAID controller such as the model number.
251 .It Cm show battery
252 Displays information about the battery from the battery backup unit.
253 .It Cm show config
254 Displays the volume and drive configuration for the controller.
255 Each array is listed along with the physical drives the array is built from.
256 Each volume is listed along with the arrays that the volume spans.
257 If any hot spare drives are configured, then they are listed as well.
258 .It Cm show drives
259 Lists all of the physical drives attached to the controller.
260 .It Xo Cm show events
261 .Op Fl c Ar class
262 .Op Fl l Ar locale
263 .Op Fl n Ar count
264 .Op Fl v
265 .Op Ar start Op Ar stop
266 .Xc
267 Display entries from the controller's event log.
268 The controller maintains a circular buffer of events.
269 Each event is tagged with a class and locale.
270 .Pp
271 The
272 .Ar class
273 parameter limits the output to entries at the specified class or higher.
274 The default class is
275 .Dq warn .
276 The available classes from lowest priority to highest are:
277 .Bl -tag -width -indent
278 .It Cm debug
279 Debug messages.
280 .It Cm progress
281 Periodic progress updates for long-running operations such as background
282 initializations, array rebuilds, or patrol reads.
283 .It Cm info
284 Informational messages such as drive insertions and volume creations.
285 .It Cm warn
286 Indicates that some component may be close to failing.
287 .It Cm crit
288 A component has failed, but no data is lost.
289 For example, a volume becoming degraded due to a drive failure.
290 .It Cm fatal
291 A component has failed resulting in data loss.
292 .It Cm dead
293 The controller itself has died.
294 .El
295 .Pp
296 The
297 .Ar locale
298 parameter limits the output to entries for the specified part of the controller.
299 The default locale is
300 .Dq all .
301 The available locales are
302 .Dq volume ,
303 .Dq drive ,
304 .Dq enclosure ,
305 .Dq battery ,
306 .Dq sas ,
307 .Dq controller ,
308 .Dq config ,
309 .Dq cluster ,
310 and
311 .Dq all .
312 .Pp
313 The
314 .Ar count
315 parameter is a debugging aid that specifies the number of events to fetch from
316 the controller for each low-level request.
317 The default is 15 events.
318 .Pp
319 By default, matching event log entries from the previous shutdown up to the
320 present are displayed.  This range can be adjusted via the
321 .Ar start
322 and
323 .Ar stop
324 parameters.
325 Each of these parameters can either be specified as a log entry number or as
326 one of the following aliases:
327 .Bl -tag -width -indent
328 .It Cm newest
329 The newest entry in the event log.
330 .It Cm oldest
331 The oldest entry in the event log.
332 .It Cm clear
333 The first entry since the event log was cleared.
334 .It Cm shutdown
335 The entry in the event log corresponding to the last time the controller was
336 cleanly shut down.
337 .It Cm boot
338 The entry in the event log corresponding to the most recent boot.
339 .El
340 .It Cm show firmware
341 Lists all of the firmware images present on the controller.
342 .It Cm show foreign
343 Displays detected foreign configurations on disks for importation or removal.
344 .It Cm show logstate
345 Display the various sequence numbers associated with the event log.
346 .It Cm show patrol
347 Display the status of the controller's patrol read operation.
348 .It Cm show progress
349 Report the current progress and estimated completion time for active
350 operations on all volumes and drives.
351 .It Cm show volumes
352 Lists all of the logical volumes managed by the controller.
353 .El
354 .Pp
355 The physical drive management commands include:
356 .Bl -tag -width indent
357 .It Cm fail Ar drive
358 Mark
359 .Ar drive
360 as failed.
361 .Ar Drive
362 must be an online drive that is part of an array.
363 .It Cm good Ar drive
364 Mark
365 .Ar drive
366 as an unconfigured good drive.
367 .Ar Drive
368 must not be part of an existing array.
369 .It Cm rebuild Ar drive
370 Mark a failed
371 .Ar drive
372 that is still part of an array as a good drive suitable for a rebuild.
373 The firmware should kick off an array rebuild on its own if a failed drive
374 is marked as a rebuild drive.
375 .It Cm drive progress Ar drive
376 Report the current progress and estimated completion time of drive operations
377 such as rebuilds or patrol reads.
378 .It Cm drive clear Ar drive Brq "start | stop"
379 Start or stop the writing of all 0x00 characters to a drive.
380 .It Cm start rebuild Ar drive
381 Manually start a rebuild on
382 .Ar drive .
383 .It Cm abort rebuild Ar drive
384 Abort an in-progress rebuild operation on
385 .Ar drive .
386 It can be resumed with the
387 .Cm start rebuild
388 command.
389 .It Cm locate Ar drive Brq "on | off"
390 Change the state of the external LED associated with
391 .Ar drive .
392 .El
393 .Pp
394 The logical volume management commands include:
395 .Bl -tag -width indent
396 .It Cm cache Ar volume Op Ar setting Oo Ar value Oc Op ...
397 If no
398 .Ar setting
399 arguments are supplied, then the current cache policy for
400 .Ar volume
401 is displayed;
402 otherwise,
403 the cache policy for
404 .Ar volume
405 is modified.
406 One or more
407 .Ar setting
408 arguments may be given.
409 Some settings take an additional
410 .Ar value
411 argument as noted below.
412 The valid settings are:
413 .Bl -tag -width indent
414 .It Cm enable
415 Enable caching for both read and write I/O operations.
416 .It Cm disable
417 Disable caching for both read and write I/O operations.
418 .It Cm reads
419 Enable caching only for read I/O operations.
420 .It Cm writes
421 Enable caching only for write I/O operations.
422 .It Cm write-back
423 Use write-back policy for cached writes.
424 .It Cm write-through
425 Use write-through policy for cached writes.
426 .It Cm read-ahead Ar value
427 Set the read ahead policy for cached reads.
428 The
429 .Ar value
430 argument can be set to either
431 .Dq none ,
432 .Dq adaptive ,
433 or
434 .Dq always .
435 .It Cm bad-bbu-write-cache Ar value
436 Control the behavior of I/O write caching if the battery is dead or
437 missing.
438 The
439 .Ar value
440 argument can be set to either
441 .Dq disable
442 or
443 .Dq enable .
444 In general this setting should be left disabled to avoid data loss when
445 the system loses power.
446 .It Cm write-cache Ar value
447 Control the write caches on the physical drives backing
448 .Ar volume .
449 The
450 .Ar value
451 argument can be set to either
452 .Dq disable ,
453 .Dq enable ,
454 or
455 .Dq default .
456 .Pp
457 In general this setting should be left disabled to avoid data loss when the
458 physical drives lose power.
459 The battery backup of the RAID controller does not save data in the write
460 caches of the physical drives.
461 .El
462 .It Cm name Ar volume Ar name
463 Sets the name of
464 .Ar volume
465 to
466 .Ar name .
467 .It Cm volume progress Ar volume
468 Report the current progress and estimated completion time of volume operations
469 such as consistency checks and initializations.
470 .El
471 .Pp
472 The configuration commands include:
473 .Bl -tag -width indent
474 .It Cm clear
475 Delete the entire configuration including all volumes, arrays, and spares.
476 .It Xo Cm create Ar type
477 .Op Fl v
478 .Op Fl s Ar stripe_size
479 .Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
480 .Op Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
481 .Xc
482 Create a new volume.
483 The
484 .Ar type
485 specifies the type of volume to create.
486 Currently supported types include:
487 .Bl -tag -width indent
488 .It Cm jbod
489 Creates a RAID0 volume for each drive specified.
490 Each drive must be specified as a separate argument.
491 .It Cm raid0
492 Creates one RAID0 volume spanning the drives listed in the single drive list.
493 .It Cm raid1
494 Creates one RAID1 volume spanning the drives listed in the single drive list.
495 .It Cm raid5
496 Creates one RAID5 volume spanning the drives listed in the single drive list.
497 .It Cm raid6
498 Creates one RAID6 volume spanning the drives listed in the single drive list.
499 .It Cm raid10
500 Creates one RAID10 volume spanning multiple RAID1 arrays.
501 The drives for each RAID1 array are specified as a single drive list.
502 .It Cm raid50
503 Creates one RAID50 volume spanning multiple RAID5 arrays.
504 The drives for each RAID5 array are specified as a single drive list.
505 .It Cm raid60
506 Creates one RAID60 volume spanning multiple RAID6 arrays.
507 The drives for each RAID6 array are specified as a single drive list.
508 .It Cm concat
509 Creates a single volume by concatenating all of the drives in the single drive
510 list.
511 .El
512 .Pp
513 .Sy Note:
514 Not all volume types are supported by all controllers.
515 .Pp
516 If the
517 .Fl v
518 flag is specified after
519 .Ar type ,
520 then more verbose output will be enabled.
521 Currently this just provides notification as drives are added to arrays and
522 arrays to volumes when building the configuration.
523 .Pp
524 The
525 .Fl s
526 .Ar stripe_size
527 parameter allows the stripe size of the array to be set.
528 By default a stripe size of 64K is used.
529 Valid values are 512 through 1M, though the MFI firmware may reject some
530 values.
531 .It Cm delete Ar volume
532 Delete the volume
533 .Ar volume .
534 .It Cm add Ar drive Op Ar volume
535 Mark
536 .Ar drive
537 as a hot spare.
538 .Ar Drive
539 must be in the unconfigured good state.
540 If
541 .Ar volume
542 is specified,
543 then the hot spare will be dedicated to arrays backing that volume.
544 Otherwise,
545 .Ar drive
546 will be used as a global hot spare backing all arrays for this controller.
547 Note that
548 .Ar drive
549 must be as large as the smallest drive in all of the arrays it is going to
550 back.
551 .It Cm remove Ar drive
552 Remove the hot spare
553 .Ar drive
554 from service.
555 It will be placed in the unconfigured good state.
556 .El
557 .Pp
558 The controller management commands include:
559 .Bl -tag -width indent
560 .It Cm patrol Ar command Op Ar interval Op Ar start
561 Set the patrol read operation mode.
562 The
563 .Ar command
564 argument can be one of the following values:
565 .Bl -tag -width indent
566 .It Cm disable
567 Disable patrol reads.
568 .It Cm auto
569 Enable periodic patrol reads initiated by the firmware.
570 The optional
571 .Ar interval
572 argument specifies the interval in seconds between patrol reads.
573 If patrol reads should be run continuously,
574 then
575 .Ar interval
576 should consist of the word
577 .Dq continuously .
578 The optional
579 .Ar start
580 argument specifies a non-negative, relative start time for the next patrol read.
581 If an interval or start time is not specified,
582 then the existing setting will be used.
583 .It Cm manual
584 Enable manual patrol reads that are only initiated by the user.
585 .El
586 .It Cm start patrol
587 Start a patrol read operation.
588 .It Cm stop patrol
589 Stop a currently running patrol read operation.
590 .It Cm foreign scan
591 Scan for foreign configurations and display the number found. The
592 .Ar config
593 argument for the commands below takes the form of a number from 0 to the total
594 configurations found.
595 .It Cm foreign clear Op config
596 Clear the specifed foreign
597 .Ar config
598 or all if no
599 .Ar config
600 argument is provided.
601 .It Cm foreign diag Op config
602 Display a diagnostic display of the specifed foreign
603 .Ar config
604 or all if no
605 .Ar config
606 argument is provided.
607 .It Cm foreign preview Op config
608 Preview the specifed foreign
609 .Ar config
610 after import or all if no
611 .Ar config
612 argument is provided.
613 .It Cm foreign import Op config
614 Import the specifed foreign
615 .Ar config
616 or all if no
617 .Ar config
618 argument is provided.
619 .It Cm flash Ar file
620 Updates the flash on the controller with the firmware stored in
621 .Ar file .
622 A reboot is required for the new firmware to take effect.
623 .It Cm start learn
624 Start a battery relearn.
625 Note that this seems to always result in the battery being completely drained,
626 regardless of the BBU mode.
627 In particular, the controller write cache will be disabled during the relearn
628 even if transparent learning mode is enabled.
629 .It Cm bbu Ar setting Ar value
630 Update battery backup unit (BBU) properties related to battery relearning.
631 The following settings are configurable:
632 .Bl -tag -width indent
633 .It Cm learn-delay
634 Add a delay to the next scheduled battery relearn event. This setting is
635 given in hours and must lie in the range of 0 to 255.
636 .It Cm autolearn-mode
637 Enable or disable automatic periodic battery relearning.
638 The setting may be set to
639 .Dq enable
640 or
641 .Dq disable
642 to respectively enable or disable the relearn cycle.
643 Alternatively, a mode of 0, 1 or 2 may be given.
644 Mode 0 enables periodic relearning, mode 1 disables it, and mode 2 disables
645 it and logs a warning to the event log when it detects that a battery relearn
646 should be performed.
647 .It Cm bbu-mode
648 Set the BBU's mode of operation. This setting is not supported by all BBUs.
649 Where it is supported, the possible values are the integers between 1 and 5
650 inclusive.
651 Modes 1, 2 and 3 enable a transparent learn cycle, whereas modes 4 and 5 do not.
652 The BBU's data retention time is greater when transparent learning is not used.
653 .El
654 .El
655 .Sh EXAMPLES
656 Configure the cache for volume mfid0 to cache only writes:
657 .Pp
658 .Dl Nm Cm cache mfid0 writes
659 .Dl Nm Cm cache mfid0 write-back
660 .Pp
661 Create a RAID5 array spanning the first four disks in the second enclosure:
662 .Pp
663 .Dl Nm Cm create raid5 e1:s0,e1:s1,e1:s2,e1:s4
664 .Pp
665 Configure the first three disks on a controller as JBOD:
666 .Pp
667 .Dl Nm Cm create jbod 0 1 2
668 .Pp
669 Create a RAID10 volume that spans two arrays each of which contains two disks
670 from two different enclosures:
671 .Pp
672 .Dl Nm Cm create raid10 e1:s0,e1:s1 e2:s0,e2:s1
673 .Pp
674 Add drive with the device ID of 4 as a global hot spare:
675 .Pp
676 .Dl Nm Cm add 4
677 .Pp
678 Add the drive in slot 2 in the main chassis as a hot spare for volume mfid0:
679 .Pp
680 .Dl Nm Cm add s2 mfid0
681 .Pp
682 Configure the adapter to run periodic patrol reads once a week with the first
683 patrol read starting in 5 minutes:
684 .Pp
685 .Dl Nm Cm patrol auto 604800 300
686 .Pp
687 Display the second detected foreign configuration:
688 .Pp
689 .Dl Nm Cm show foreign 1
690 .Sh SEE ALSO
691 .Xr mfi 4
692 .Sh HISTORY
693 The
694 .Nm
695 utility first appeared in
696 .Fx 8.0 .