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