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