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