MFIUTIL(8)
πΈ NAME πΈ
okay bestie, say hi to mfiutil β section 8 of the System Manager's Manual, and it's literally the Utility for managing LSI MegaRAID SAS controllers. she's giving sysadmin royalty, no cap. π
β¨ SYNOPSIS β¨
mfiutil version
mfiutil [-t drv_type] [-u unit] show adapter
mfiutil [-t drv_type] [-u unit] show battery
mfiutil [-d] [-e] [-p] [-t drv_type] [-u unit] show config
mfiutil [-p] [-t drv_type] [-u unit] show drives
mfiutil [-t drv_type] [-u unit] show events [-c class] [-l locale]
[-n count] [-v] [start [stop]]
mfiutil [-t drv_type] [-u unit] show firmware
mfiutil [-p] [-t drv_type] [-u unit] show foreign [volume]
mfiutil [-t drv_type] [-u unit] show logstate
mfiutil [-d] [-e] [-t drv_type] [-u unit] show patrol
mfiutil [-d] [-e] [-t drv_type] [-u unit] show progress
mfiutil [-p] [-t drv_type] [-u unit] show volumes
mfiutil [-t drv_type] [-u unit] fail drive
mfiutil [-t drv_type] [-u unit] good drive
mfiutil [-t drv_type] [-u unit] rebuild drive
mfiutil [-t drv_type] [-u unit] syspd drive
mfiutil [-t drv_type] [-u unit] drive progress drive
mfiutil [-t drv_type] [-u unit] drive clear drive {start | stop}
mfiutil [-t drv_type] [-u unit] start rebuild drive
mfiutil [-t drv_type] [-u unit] abort rebuild drive
mfiutil [-t drv_type] [-u unit] locate drive {on | off}
mfiutil [-t drv_type] [-u unit] cache volume [setting [value] [...]]
mfiutil [-t drv_type] [-u unit] name volume name
mfiutil [-t drv_type] [-u unit] volume progress volume
mfiutil [-t drv_type] [-u unit] clear
mfiutil [-t drv_type] [-u unit] create type [-v] [-s stripe_size]
drive[,drive[,...]] [drive[,drive[,...]]]
mfiutil [-t drv_type] [-u unit] delete volume
mfiutil [-t drv_type] [-u unit] add drive [volume]
mfiutil [-t drv_type] [-u unit] remove drive
mfiutil [-t drv_type] [-u unit] start patrol
mfiutil [-t drv_type] [-u unit] stop patrol
mfiutil [-t drv_type] [-u unit] patrol command [interval [start]]
mfiutil [-t drv_type] [-u unit] foreign scan
mfiutil [-t drv_type] [-u unit] foreign clear [config]
mfiutil [-t drv_type] [-u unit] foreign diag [config]
mfiutil [-t drv_type] [-u unit] foreign preview [config]
mfiutil [-t drv_type] [-u unit] foreign import [config]
mfiutil [-t drv_type] [-u unit] flash file
mfiutil [-t drv_type] [-u unit] start learn
mfiutil [-t drv_type] [-u unit] bbu setting value
mfiutil [-t drv_type] [-u unit] ctrlprop rebuild [rate]
mfiutil [-t drv_type] [-u unit] ctrlprop alarm [on|off]
π¦ DESCRIPTION π¦
so the whole point of mfiutil is that it can display or modify a bunch of parameters on LSI MegaRAID SAS RAID controllers. every single time you invoke it, you give it zero or more global options and then a command. and psst β commands can take their own extra optional or required arguments after the command itself. π«
The global options are:
-t drv_typeβ (FreeBSD only)drv_typesays which type of driver you're working with; it takes eithermfiormrsas. the default type ismrsasif this tool was invoked asmrsasutil, otherwise it'smfi. (Solaris only)drv_typesays which type of driver you're working with. the default type ismr_sas.-u unitβunitsays which unit of the controller you're working with. if you don't specify a unit, then unit0is used. simple as. β¨
Either or both of the following two global options have effect on various commands that display physical drives:
-dβ print numeric device IDs as the drive identifier. this is the default. super useful in combination with-eso you can print both numeric device IDs and enclosure:slot info at the same time. π-eβ print drive identifiers inenclosure:slotform. (see the next paragraph for the format deets, in the context of input rather than output.) π
The following global option have effect on commands that display byte values:
-pβ print byte values in machine-parsable (exact) instead of human-readable values.
Drives may be specified in two forms, bestie, so listen up:
- a drive may be identified by its device ID. you can find the device ID for configured drives in
show config. - a drive may be identified by its location as
[Exx:]Syywherexxis the enclosure andyyis the slot for each drive, exactly as displayed inshow drives.
A volume may be identified by its target ID. alternatively, when you're working with the mfi(4) driver, the volume may also be specified by the corresponding mfidX device name, such as mfid0. π
ok so, the way that this tool is organized: mfiutil supports several different groups of commands. π§
- The first group of commands provide information about the controller, the volumes it manages, and the drives it controls.
- The second group of commands are used to manage the physical drives attached to the controller.
- The third group of commands are used to manage the logical volumes managed by the controller.
- The fourth group of commands are used to manage the drive configuration for the controller.
- The fifth group of commands are used to manage controller-wide operations.
The informational commands include:
versionβ Displays the version ofmfiutil. iconic lil flex. πshow adapterβ Displays information about the RAID controller, such as the model number.show batteryβ Displays information about the battery from the battery backup unit. πshow configβ Displays the volume and drive configuration for the controller. each array is listed along with the physical drives the array is built from. each volume is listed along with the arrays that the volume spans. and if any hot spare drives are configured, then they're listed as well. β¨show drivesβ Lists all of the physical drives attached to the controller.show events [-c class] [-l locale] [-n count] [-v] [start [stop]]β Display entries from the controller's event log. the controller maintains a circular buffer of events, and each event is tagged with a class and a locale.- The
classparameter limits the output to entries at the specified class or higher. the default class is"warn". the available classes, from lowest priority to highest, are:debugβ Debug messages.progressβ Periodic progress updates for long-running operations such as background initializations, array rebuilds, or patrol reads. β³infoβ Informational messages such as drive insertions and volume creations.warnβ Indicates that some component may be close to failing. π¬critβ A component has failed, but no data is lost. for example, a volume becoming degraded due to a drive failure.fatalβ A component has failed resulting in data loss. πdeadβ The controller itself has died. π
- The
localeparameter limits the output to entries for the specified part of the controller. the default locale is"all". the available locales are"volume","drive","enclosure","battery","sas","controller","config","cluster", and"all". - The
countparameter is a debugging aid that specifies the number of events to fetch from the controller for each low-level request. the default is15events. - By default, matching event log entries from the previous shutdown up to the present are displayed. this range can be adjusted via the
startandstopparameters. each of these parameters can either be specified as a log entry number or as one of the following aliases:newestβ The newest entry in the event log.oldestβ The oldest entry in the event log.clearβ The first entry since the event log was cleared.shutdownβ The entry in the event log corresponding to the last time the controller was cleanly shut down.bootβ The entry in the event log corresponding to the most recent boot.
- The
show firmwareβ Lists all of the firmware images present on the controller.show foreignβ Displays detected foreign configurations on disks for importation or removal. πshow logstateβ Display the various sequence numbers associated with the event log.show patrolβ Display the status of the controller's patrol read operation.show progressβ Report the current progress and estimated completion time for active operations on all volumes and drives.show volumesβ Lists all of the logical volumes managed by the controller.
π The physical drive management commands π
fail driveβ Markdriveas failed.drivemust be an online drive that is part of an array.good driveβ Markdriveas an unconfigured good drive.drivemust not be part of an existing array.rebuild driveβ Mark a failed drive that is still part of an array as a good drive suitable for a rebuild. the firmware should kick off an array rebuild on its own if a failed drive is marked as a rebuild drive. π οΈsyspd driveβ Present the drive to the host operating system directly as a system physical drive. when using themfi(4)driver, the device node will be in format/dev/mfisyspdX. clear this state withgood drive. πdrive progress driveβ Report the current progress and estimated completion time of drive operations such as rebuilds or patrol reads.drive clear drive {start | stop}β Start or stop the writing of all0x00characters to a drive.start rebuild driveβ Manually start a rebuild ondrive.abort rebuild driveβ Abort an in-progress rebuild operation ondrive. it can be resumed with thestart rebuildcommand.locate drive {on | off}β Change the state of the external LED associated withdrive. β¨ blink blink β¨
π The logical volume management commands π
cache volume [setting [value] [...]]β If nosettingarguments are supplied, then the current cache policy forvolumeis displayed; otherwise, the cache policy forvolumeis modified. one or moresettingarguments may be given. some settings take an additionalvalueargument, as noted below. the valid settings are:enableβ Enable caching for both read and write I/O operations.disableβ Disable caching for both read and write I/O operations.readsβ Enable caching only for read I/O operations.writesβ Enable caching only for write I/O operations.write-backβ Use write-back policy for cached writes.
write-throughβ bestie, this one says use the write-through policy for cached writes. That's it, that's the whole vibe. β¨read-aheadvalue β sets the read ahead policy for cached reads, and value can benone,adaptive, oralways. pick your fighter πbad-bbu-write-cachevalue β controls what happens with I/O write caching when the battery is dead or straight up missing π. value is eitherdisableorenable. ngl the general consensus is leave this disabled, because otherwise you're risking data loss the second the system loses power. no cap.write-cachevalue β controls the write caches sitting on the physical drives backing the volume. value can bedisable,enable, ordefault.
and fr fr, leave this one disabled too, because data loss is on the table when the physical drives lose power. here's the tea: the RAID controller's battery backup does not save data in the write caches of the physical drives. it's giving false security, so don't. π
namevolumenameβ sets the name ofvolumetoname. cute, simple, iconic.volume progressvolumeβ reports the current progress and the estimated completion time of volume operations, like consistency checks and initializations. it's the "are we there yet" command π
β¨ the configuration commands β¨
the ones that actually change stuff, bestie. handle with care π«Ά
clearβ deletes the entire configuration. all volumes, all arrays, all spares. gone. poof. π proceed with intention.createtype[-v] [-s stripe_size] drive[,drive[,...]] [drive[,drive[,...]]]β creates a new volume, slay. type tells it what kind of volume to make. the currently supported types are:jbodβ creates a RAID0 volume for each drive specified. every drive has to be its own separate argument, so don't try to be cute and group them.raid0β creates one RAID0 volume spanning the drives listed in the single drive list.raid1β creates one RAID1 volume spanning the drives listed in the single drive list.raid5β creates one RAID5 volume spanning the drives listed in the single drive list.raid6β creates one RAID6 volume spanning the drives listed in the single drive list.raid10β creates one RAID10 volume spanning multiple RAID1 arrays. the drives for each RAID1 array get specified as a single drive list.raid50β creates one RAID50 volume spanning multiple RAID5 arrays. the drives for each RAID5 array get specified as a single drive list.raid60β creates one RAID60 volume spanning multiple RAID6 arrays. the drives for each RAID6 array get specified as a single drive list.concatβ creates a single volume by concatenating all of the drives in the single drive list.
Note: not all volume types are supported by all controllers. so like, vibe check your hardware first π
if you drop the -v flag after type, you get more verbose output. currently it just notifies you as drives get added to arrays and arrays get added to volumes while the configuration is being built. little live commentary, we love that. πΈ
the -s stripe_size parameter lets you set the stripe size of the array. default is a stripe size of 64K. valid values are 512 through 1M, though the MFI firmware may reject some values. so it's giving "suggestions welcome, decisions final." π
deletevolumeβ deletes the volumevolume. bye bestie πadddrive[volume] β marksdriveas a hot spare. the drive has to be in the unconfigured good state. ifvolumeis specified, the hot spare gets dedicated to the arrays backing that volume. otherwise,driveis used as a global hot spare backing all arrays for this controller. and heads up:drivehas to be as large as the smallest drive in all of the arrays it's going to back. no shortcuts. πremovedriveβ removes the hot sparedrivefrom service. it goes right back to the unconfigured good state. retirement era. β¨
π the controller management commands π
patrolcommand[interval[start]] β sets the patrol read operation mode. thecommandargument can be one of these:disableβ disables patrol reads. nope, not today.autoβ enables periodic patrol reads initiated by the firmware. the optionalintervalargument sets how many seconds between patrol reads. and if you want patrol reads running continuously,intervalshould just be the wordcontinuously. the optionalstartargument sets a non-negative, relative start time for the next patrol read. if you don't specify an interval or a start time, the existing setting is kept. β¨manualβ enables manual patrol reads that are only initiated by the user. you're the main character here π
start patrolβ starts a patrol read operation. go go go π₯stop patrolβ stops a currently running patrol read operation. okay bestie, rest. π«Άforeign scanβ scans for foreign configurations and displays how many it found. and psst β theconfigargument for the commands below takes the form of a number from0to the total configurations found. iykyk.foreign clear[config] β clears the specified foreign config, or all of them if noconfigargument is given.foreign diag[config] β displays a diagnostic display of the specified foreign config, or all of them if noconfigargument is given.foreign preview[config] β previews the specified foreign config after import, or all of them if noconfigargument is given.foreign import[config] β imports the specified foreign config, or all of them if noconfigargument is given.flashfileβ updates the flash on the controller with the firmware stored infile. a reboot is required for the new firmware to take effect, so don't come for me when nothing changes without one. πstart learnβ starts a battery relearn. and okay, fair warning: this seems to always result in the battery being completely drained, regardless of the BBU mode. in particular, the controller write cache will be disabled during the relearn even if transparent learning mode is enabled. it's giving chaos, honestly. πbbu settingvalueβ updates battery backup unit (BBU) properties related to battery relearning. here's what's configurable:learn-delayβ adds a delay to the next scheduled battery relearn event. this setting is given in hours and must lie in the range of0to255.autolearn-modeβ enables or disables automatic periodic battery relearning. you can set it toenableordisableto respectively enable or disable the relearn cycle. or alternatively, you can give a mode of0,1or2. mode0enables periodic relearning, mode1disables it, and mode2disables it and logs a warning to the event log when it detects that a battery relearn should be performed. pick your poison, but like, the logging one is lowkey the responsible choice β¨bbu-modeβ sets the BBU's mode of operation. this setting is not supported by all BBUs, so don't be shocked if yours ghosts you. where it is supported, the possible values are the integers between1and5inclusive. modes1,2and3enable a transparent learn cycle, whereas modes4and5do not. and here's the tradeoff: the BBU's data retention time is greater when transparent learning is not used. β¨
ctrlprop rebuild[rate] β with no arguments, it displays the rate of rebuild (percentage)a for volumes. with an integer argument (0-100), it sets that value as the new rebuild rate for volumes. go fast or go careful, your call πctrlprop alarm[on|off] β with no arguments, it displays the current alarm enable/disable status. with anonor anoffargument, it enables or disables the alarm. π¨
π GET UNIT NUMBER OF CONTROLLERS π
okay bestie so here's the tea: mfiutil makes no attempt to enumerate all the installed controllers. Nope, not doing it. Instead, the correct unit number of the intended controller must be passed via the global option -u. Otherwise, the controller with unit 0 is assumed. So yeah, don't sleep on -u.
The particular ways of listing controllers differ between different drivers and kernels; the following descriptions use X to indicate the unit number. Periodt.
mfi(4)driver β This driver creates a/dev/mfiXdevice node for each controller it attached. A list of the available device nodes can be queried using a shell command such as:
ls -l /dev/mfi[0-9]*
mrsas(4)driver β Similar to themfi(4)driver, this driver creates a/dev/mrsasXdevice node for each controller it attached.- Linux
megaraid_sas(4)driver β This driver uses the global SCSI host unit number as the controller unit number; therefore if other SCSI host devices are also installed, multiple unit numbers are sometimes not continuous as users might expect. It's giving chaotic numbering, lowkey.
To find out the SCSI host unit numbers assigned to the installed controllers, list the sysfs directory /sys/class/scsi_host/, where /sys/class/scsi_host/hostX are symbolic links to different SCSI host device directories. For example:
# ls -l /sys/class/scsi_host/
total 0
lrwxrwxrwx 1 root root 0 Aug 26 00:00 host0 -> ../../devices/pci0000:00/0000:00:01.0/0000:02:00.0/host0/scsi_host/host0
lrwxrwxrwx 1 root root 0 Aug 26 00:00 host1 -> ../../devices/pci0000:00/0000:00:11.4/ata1/host1/scsi_host/host1
lrwxrwxrwx 1 root root 0 Aug 26 00:00 host2 -> ../../devices/pci0000:00/0000:00:11.4/ata2/host2/scsi_host/host2
lrwxrwxrwx 1 root root 0 Aug 26 00:00 host3 -> ../../devices/pci0000:00/0000:00:02.2/0000:05:00.0/host3/scsi_host/host3
Manual inspection must be taken to distinguish MegaRAID SAS controllers from other devices if any. No cap, you gotta look.
Newer versions of megaraid_sas(4) driver creates per-controller nodes in debugfs, so if the debugfs is mounted at conventional path, a clearer list of available controller can also be queried by listing the /sys/kernel/debug/megaraid_sas/ directory. For example:
# ls -l /sys/kernel/debug/megaraid_sas/
total 0
drwxr-xr-x 2 root root 0 May 29 11:43 scsi_host0
drwxr-xr-x 2 root root 0 May 29 11:43 scsi_host3
- Solaris kernel β Drivers for Solaris kernel assign a per-driver instance number when a newly installed controller is probed; this number is then recorded, so it is generally persistent if the hardware configuration remain unchanged. Iconic behavior honestly.
The instance numbers can be queried from the path_to_inst(4) file. Simply search the double quoted driver name in it, by running:
grep -F \"driver\" /etc/path_to_inst
For example, listing instances of the mr_sas(7D) driver would be look like:
# /usr/xpg4/bin/grep -F \"mr_sas\" /etc/path_to_inst
"/pci@0,0/pci8086,2f02@1/pci1028,1f49@0" 0 "mr_sas"
"/pci@76,0/pci8086,2f04@2/pci1014,454@0" 1 "mr_sas"
Then take an appropriate instance number for use in mfiutil.
If multiple supported controllers are installed in the system, it is suggested to run a
mfiutil -u X show adapter
first to ensure the unit number X is correct for the intended controller. Do that vibe check before you commit, bestie. π«Ά
β¨ EXAMPLES β¨
Configure the cache for volume mfid0 to cache only writes:
mfiutil cache mfid0 writes
mfiutil cache mfid0 write-back
Create a RAID5 array spanning the first four disks in the second enclosure:
mfiutil create raid5 e1:s0,e1:s1,e1:s2,e1:s4
Configure the first three disks on a controller as JBOD:
mfiutil create jbod 0 1 2
Create a RAID10 volume that spans two arrays each of which contains two disks from two different enclosures:
mfiutil create raid10 e1:s0,e1:s1 e2:s0,e2:s1
Add drive with the device ID of 4 as a global hot spare:
mfiutil add 4
Add the drive in slot 2 in the main chassis as a hot spare for volume mfid0:
mfiutil add s2 mfid0
Reconfigure a disk as a SYSTEM physical drive with no RAID:
mfiutil syspd 0
Configure the adapter to run periodic patrol reads once a week with the first patrol read starting in 5 minutes:
mfiutil patrol auto 604800 300
Display the second detected foreign configuration:
mfiutil show foreign 1
Set the current rebuild rate for volumes to 40%:
mfiutil ctrlprop rebuild 40
π SEE ALSO π
π HISTORY π
The mfiutil utility first appeared in FreeBSD 8.0.
okay that's the whole page bestie! this was mfiutil 1.0.15-rivoreo-r2 from 2024, and you're reading MFIUTIL(8). slay π
β¨
π¦ where this page comes from
- ubuntu resolute: mfiutil 1.0.15-rivoreo-r2~rc-20250214-e8c6289-2 Β· BSD-3-Clause
- ubuntu stonking: mfiutil 1.0.15-rivoreo-r2~rc-20250214-e8c6289-2 Β· BSD-3-Clause
- Copyright (c) 2008, 2009 Yahoo!, Inc
- Copyright 2015-2024 Rivoreo
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms