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