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