xref: /freebsd/usr.sbin/mfiutil/mfiutil.8 (revision 9768746b)
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.
330This range can be adjusted via the
331.Ar start
332and
333.Ar stop
334parameters.
335Each of these parameters can either be specified as a log entry number or as
336one of the following aliases:
337.Bl -tag -width indent
338.It Cm newest
339The newest entry in the event log.
340.It Cm oldest
341The oldest entry in the event log.
342.It Cm clear
343The first entry since the event log was cleared.
344.It Cm shutdown
345The entry in the event log corresponding to the last time the controller was
346cleanly shut down.
347.It Cm boot
348The entry in the event log corresponding to the most recent boot.
349.El
350.It Cm show firmware
351Lists all of the firmware images present on the controller.
352.It Cm show foreign
353Displays detected foreign configurations on disks for importation or removal.
354.It Cm show logstate
355Display the various sequence numbers associated with the event log.
356.It Cm show patrol
357Display the status of the controller's patrol read operation.
358.It Cm show progress
359Report the current progress and estimated completion time for active
360operations on all volumes and drives.
361.It Cm show volumes
362Lists all of the logical volumes managed by the controller.
363.El
364.Pp
365The physical drive management commands include:
366.Bl -tag -width indent
367.It Cm fail Ar drive
368Mark
369.Ar drive
370as failed.
371.Ar Drive
372must be an online drive that is part of an array.
373.It Cm good Ar drive
374Mark
375.Ar drive
376as an unconfigured good drive.
377.Ar Drive
378must not be part of an existing array.
379.It Cm rebuild Ar drive
380Mark a failed
381.Ar drive
382that is still part of an array as a good drive suitable for a rebuild.
383The firmware should kick off an array rebuild on its own if a failed drive
384is marked as a rebuild drive.
385.It Cm syspd Ar drive
386Present the drive to the host operating system as a disk SYSPD block device in
387the format /dev/mfisyspdX.
388Clear this flag with
389.Cm good
390.Ar drive
391.It Cm drive progress Ar drive
392Report the current progress and estimated completion time of drive operations
393such as rebuilds or patrol reads.
394.It Cm drive clear Ar drive Brq "start | stop"
395Start or stop the writing of all 0x00 characters to a drive.
396.It Cm start rebuild Ar drive
397Manually start a rebuild on
398.Ar drive .
399.It Cm abort rebuild Ar drive
400Abort an in-progress rebuild operation on
401.Ar drive .
402It can be resumed with the
403.Cm start rebuild
404command.
405.It Cm locate Ar drive Brq "on | off"
406Change the state of the external LED associated with
407.Ar drive .
408.El
409.Pp
410The logical volume management commands include:
411.Bl -tag -width indent
412.It Cm cache Ar volume Op Ar setting Oo Ar value Oc Op ...
413If no
414.Ar setting
415arguments are supplied, then the current cache policy for
416.Ar volume
417is displayed;
418otherwise,
419the cache policy for
420.Ar volume
421is modified.
422One or more
423.Ar setting
424arguments may be given.
425Some settings take an additional
426.Ar value
427argument as noted below.
428The valid settings are:
429.Bl -tag -width indent
430.It Cm enable
431Enable caching for both read and write I/O operations.
432.It Cm disable
433Disable caching for both read and write I/O operations.
434.It Cm reads
435Enable caching only for read I/O operations.
436.It Cm writes
437Enable caching only for write I/O operations.
438.It Cm write-back
439Use write-back policy for cached writes.
440.It Cm write-through
441Use write-through policy for cached writes.
442.It Cm read-ahead Ar value
443Set the read ahead policy for cached reads.
444The
445.Ar value
446argument can be set to either
447.Dq none ,
448.Dq adaptive ,
449or
450.Dq always .
451.It Cm bad-bbu-write-cache Ar value
452Control the behavior of I/O write caching if the battery is dead or
453missing.
454The
455.Ar value
456argument can be set to either
457.Dq disable
458or
459.Dq enable .
460In general this setting should be left disabled to avoid data loss when
461the system loses power.
462.It Cm write-cache Ar value
463Control the write caches on the physical drives backing
464.Ar volume .
465The
466.Ar value
467argument can be set to either
468.Dq disable ,
469.Dq enable ,
470or
471.Dq default .
472.Pp
473In general this setting should be left disabled to avoid data loss when the
474physical drives lose power.
475The battery backup of the RAID controller does not save data in the write
476caches of the physical drives.
477.El
478.It Cm name Ar volume Ar name
479Sets the name of
480.Ar volume
481to
482.Ar name .
483.It Cm volume progress Ar volume
484Report the current progress and estimated completion time of volume operations
485such as consistency checks and initializations.
486.El
487.Pp
488The configuration commands include:
489.Bl -tag -width indent
490.It Cm clear
491Delete the entire configuration including all volumes, arrays, and spares.
492.It Xo Cm create Ar type
493.Op Fl v
494.Op Fl s Ar stripe_size
495.Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
496.Op Ar drive Ns Op \&, Ns Ar drive Ns Op ",..."
497.Xc
498Create a new volume.
499The
500.Ar type
501specifies the type of volume to create.
502Currently supported types include:
503.Bl -tag -width indent
504.It Cm jbod
505Creates a RAID0 volume for each drive specified.
506Each drive must be specified as a separate argument.
507.It Cm raid0
508Creates one RAID0 volume spanning the drives listed in the single drive list.
509.It Cm raid1
510Creates one RAID1 volume spanning the drives listed in the single drive list.
511.It Cm raid5
512Creates one RAID5 volume spanning the drives listed in the single drive list.
513.It Cm raid6
514Creates one RAID6 volume spanning the drives listed in the single drive list.
515.It Cm raid10
516Creates one RAID10 volume spanning multiple RAID1 arrays.
517The drives for each RAID1 array are specified as a single drive list.
518.It Cm raid50
519Creates one RAID50 volume spanning multiple RAID5 arrays.
520The drives for each RAID5 array are specified as a single drive list.
521.It Cm raid60
522Creates one RAID60 volume spanning multiple RAID6 arrays.
523The drives for each RAID6 array are specified as a single drive list.
524.It Cm concat
525Creates a single volume by concatenating all of the drives in the single drive
526list.
527.El
528.Pp
529.Sy Note :
530Not all volume types are supported by all controllers.
531.Pp
532If the
533.Fl v
534flag is specified after
535.Ar type ,
536then more verbose output will be enabled.
537Currently this just provides notification as drives are added to arrays and
538arrays to volumes when building the configuration.
539.Pp
540The
541.Fl s
542.Ar stripe_size
543parameter allows the stripe size of the array to be set.
544By default a stripe size of 64K is used.
545Valid values are 512 through 1M, though the MFI firmware may reject some
546values.
547.It Cm delete Ar volume
548Delete the volume
549.Ar volume .
550.It Cm add Ar drive Op Ar volume
551Mark
552.Ar drive
553as a hot spare.
554.Ar Drive
555must be in the unconfigured good state.
556If
557.Ar volume
558is specified,
559then the hot spare will be dedicated to arrays backing that volume.
560Otherwise,
561.Ar drive
562will be used as a global hot spare backing all arrays for this controller.
563Note that
564.Ar drive
565must be as large as the smallest drive in all of the arrays it is going to
566back.
567.It Cm remove Ar drive
568Remove the hot spare
569.Ar drive
570from service.
571It will be placed in the unconfigured good state.
572.El
573.Pp
574The controller management commands include:
575.Bl -tag -width indent
576.It Cm patrol Ar command Op Ar interval Op Ar start
577Set the patrol read operation mode.
578The
579.Ar command
580argument can be one of the following values:
581.Bl -tag -width indent
582.It Cm disable
583Disable patrol reads.
584.It Cm auto
585Enable periodic patrol reads initiated by the firmware.
586The optional
587.Ar interval
588argument specifies the interval in seconds between patrol reads.
589If patrol reads should be run continuously,
590then
591.Ar interval
592should consist of the word
593.Dq continuously .
594The optional
595.Ar start
596argument specifies a non-negative, relative start time for the next patrol read.
597If an interval or start time is not specified,
598then the existing setting will be used.
599.It Cm manual
600Enable manual patrol reads that are only initiated by the user.
601.El
602.It Cm start patrol
603Start a patrol read operation.
604.It Cm stop patrol
605Stop a currently running patrol read operation.
606.It Cm foreign scan
607Scan for foreign configurations and display the number found.
608The
609.Ar config
610argument for the commands below takes the form of a number from 0 to the total
611configurations found.
612.It Cm foreign clear Op config
613Clear the specified foreign
614.Ar config
615or all if no
616.Ar config
617argument is provided.
618.It Cm foreign diag Op config
619Display a diagnostic display of the specified foreign
620.Ar config
621or all if no
622.Ar config
623argument is provided.
624.It Cm foreign preview Op config
625Preview the specified foreign
626.Ar config
627after import or all if no
628.Ar config
629argument is provided.
630.It Cm foreign import Op config
631Import the specified foreign
632.Ar config
633or all if no
634.Ar config
635argument is provided.
636.It Cm flash Ar file
637Updates the flash on the controller with the firmware stored in
638.Ar file .
639A reboot is required for the new firmware to take effect.
640.It Cm start learn
641Start a battery relearn.
642Note that this seems to always result in the battery being completely drained,
643regardless of the BBU mode.
644In particular, the controller write cache will be disabled during the relearn
645even if transparent learning mode is enabled.
646.It Cm bbu Ar setting Ar value
647Update battery backup unit (BBU) properties related to battery relearning.
648The following settings are configurable:
649.Bl -tag -width indent
650.It Cm learn-delay
651Add a delay to the next scheduled battery relearn event.
652This setting is given in hours and must lie in the range of 0 to 255.
653.It Cm autolearn-mode
654Enable or disable automatic periodic battery relearning.
655The setting may be set to
656.Dq enable
657or
658.Dq disable
659to respectively enable or disable the relearn cycle.
660Alternatively, a mode of 0, 1 or 2 may be given.
661Mode 0 enables periodic relearning, mode 1 disables it, and mode 2 disables
662it and logs a warning to the event log when it detects that a battery relearn
663should be performed.
664.It Cm bbu-mode
665Set the BBU's mode of operation.
666This setting is not supported by all BBUs.
667Where it is supported, the possible values are the integers between 1 and 5
668inclusive.
669Modes 1, 2 and 3 enable a transparent learn cycle, whereas modes 4 and 5 do not.
670The BBU's data retention time is greater when transparent learning is not used.
671.El
672.It Cm ctrlprop Ar rebuild Op Ar rate
673With no arguments display the rate of rebuild (percentage)a for volumes.
674With an integer argument (0-100), set that value as the new rebuild rate for volumes.
675.It Cm ctrlprop Ar alarm Op Ar 0/1
676With no arguments display the current alarm enable/disable status.
677With a 0, disable alarms.
678With a 1, enable alarms.
679.El
680.Sh EXAMPLES
681Configure the cache for volume mfid0 to cache only writes:
682.Pp
683.Dl Nm Cm cache mfid0 writes
684.Dl Nm Cm cache mfid0 write-back
685.Pp
686Create a RAID5 array spanning the first four disks in the second enclosure:
687.Pp
688.Dl Nm Cm create raid5 e1:s0,e1:s1,e1:s2,e1:s4
689.Pp
690Configure the first three disks on a controller as JBOD:
691.Pp
692.Dl Nm Cm create jbod 0 1 2
693.Pp
694Create a RAID10 volume that spans two arrays each of which contains two disks
695from two different enclosures:
696.Pp
697.Dl Nm Cm create raid10 e1:s0,e1:s1 e2:s0,e2:s1
698.Pp
699Add drive with the device ID of 4 as a global hot spare:
700.Pp
701.Dl Nm Cm add 4
702.Pp
703Add the drive in slot 2 in the main chassis as a hot spare for volume mfid0:
704.Pp
705.Dl Nm Cm add s2 mfid0
706.Pp
707Reconfigure a disk as a SYSPD block device with no RAID
708.Pp
709.Dl Nm Cm syspd 0
710.Pp
711Configure the adapter to run periodic patrol reads once a week with the first
712patrol read starting in 5 minutes:
713.Pp
714.Dl Nm Cm patrol auto 604800 300
715.Pp
716Display the second detected foreign configuration:
717.Pp
718.Dl Nm Cm show foreign 1
719.Pp
720Set the current rebuild rate for volumes to 40%:
721.Dl Nm Cm ctrlprop rebuild 40
722.Sh SEE ALSO
723.Xr mfi 4
724.Sh HISTORY
725The
726.Nm
727utility first appeared in
728.Fx 8.0 .
729