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