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