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