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