mfiutil
Utility for managing LSI MegaRAID SAS controllers
Utility for managing LSI MegaRAID SAS controllers
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] |
The mfiutil utility can be used to display
or modify various parameters on LSI MegaRAID SAS RAID controllers. Each
invocation of mfiutil consists of zero or more
global options followed by a command. Commands may support additional
optional or required arguments after the command.
The global options are:
-t
drv_typemfi or
mrsas. The default type is
mrsas if this tool was invoked as
mrsasutil, otherwise mfi.
(Solaris only) drv_type specifies the
type of driver to work with. The default type is
mr_sas.
-u
unitEither or both of the following two global options have effect on various commands that display physical drives:
-d-e to print both, numeric
device IDs and enclosure:slot information.-eThe following global option have effect on commands that display byte values:
-pDrives may be specified in two forms. First, a drive may be
identified by its device ID. The device ID for configured drives can be
found in show config. Second, a drive may be
identified by its location as
[Exx:]Syy
where xx is the enclosure and yy
is the slot for each drive as displayed in show
drives.
A volume may be identified by its target ID. Alternatively, when working with mfi(4) driver, the volume may also be specified by the corresponding mfidX device name, such as mfid0.
The mfiutil utility 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:
versionmfiutil.show
adaptershow
batteryshow
configshow
drivesshow
events [-c class]
[-l locale]
[-n count]
[-v] [start
[stop]]The class parameter 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:
debugprogressinfowarncritfataldeadThe locale parameter 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 count parameter is a debugging aid that specifies the number of events to fetch from the controller for each low-level request. The default is 15 events.
By default, matching event log entries from the previous shutdown up to the present are displayed. This range can be adjusted via the start and stop parameters. Each of these parameters can either be specified as a log entry number or as one of the following aliases:
newestoldestclearshutdownbootshow
firmwareshow
foreignshow
logstateshow
patrolshow
progressshow
volumesThe physical drive management commands include:
fail
drivegood
driverebuild
drivesyspd
drivegood drivedrive
progress drivedrive
clear drive {start | stop}start
rebuild driveabort
rebuild drivestart rebuild
command.locate
drive {on | off}The logical volume management commands include:
cache
volume [setting
[value] [...]]enabledisablereadswriteswrite-backwrite-throughread-ahead
valuebad-bbu-write-cache
valuewrite-cache
valueIn general this setting should be left disabled to avoid data loss when the physical drives lose power. The battery backup of the RAID controller does not save data in the write caches of the physical drives.
name
volume namevolume
progress volumeThe configuration commands include:
clearcreate
type [-v]
[-s stripe_size]
drive[,drive[,...]]
[drive[,drive[,...]]]jbodraid0raid1raid5raid6raid10raid50raid60concatNote: Not all volume types are supported by all controllers.
If the -v flag is specified after
type, then more verbose output will be enabled.
Currently this just provides notification as drives are added to arrays
and arrays to volumes when building the configuration.
The -s
stripe_size parameter allows the stripe size of
the array to be set. By default a stripe size of 64K is used. Valid
values are 512 through 1M, though the MFI firmware may reject some
values.
delete
volumeadd
drive [volume]remove
driveThe controller management commands include:
patrol
command [interval
[start]]disableautomanualstart
patrolstop
patrolforeign
scanforeign
clear [config]foreign
diag [config]foreign
preview [config]foreign
import [config]flash
filestart
learnbbu
setting valuelearn-delayautolearn-modebbu-modectrlprop
rebuild [rate]ctrlprop
alarm [on|off]on or an off argument,
enable or disable alarm.mfiutil makes no attempt to enumerate all
the installed controllers; instead the correct unit number of the intended
controller must be passed via global option -u,
otherwise the controller with unit 0 is assumed.
The particular ways of listing controllers differ between different drivers and kernels; the following descriptions use X to indicate the unit number.
This driver creates a /dev/mfiX device
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]*.
Similar to the mfi(4) driver, this driver creates a /dev/mrsasX device node for each controller it attached.
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.
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 0lrwxrwxrwx 1 root root 0 Aug 26 00:00 host0 -> ../../devices/pci0000:00/0000:00:01.0/0000:02:00.0/host0/scsi_host/host0lrwxrwxrwx 1 root root 0 Aug 26 00:00 host1 -> ../../devices/pci0000:00/0000:00:11.4/ata1/host1/scsi_host/host1lrwxrwxrwx 1 root root 0 Aug 26 00:00 host2 -> ../../devices/pci0000:00/0000:00:11.4/ata2/host2/scsi_host/host2lrwxrwxrwx 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.
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 /sys/kernel/debug/megaraid_sas/ directory. For example:
# ls -l /sys/kernel/debug/megaraid_sas/total 0drwxr-xr-x 2 root root 0 May 29 11:43 scsi_host0drwxr-xr-x 2 root root 0 May 29 11:43 scsi_host3
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.
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
adapterConfigure the cache for volume mfid0 to cache only writes:
mfiutil
cache mfid0 writesmfiutil
cache mfid0 write-backCreate a RAID5 array spanning the first four disks in the second enclosure:
mfiutil
create raid5 e1:s0,e1:s1,e1:s2,e1:s4Configure the first three disks on a controller as JBOD:
mfiutil
create jbod 0 1 2Create 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:s1Add drive with the device ID of 4 as a global hot spare:
mfiutil
add 4Add the drive in slot 2 in the main chassis as a hot spare for volume mfid0:
mfiutil
add s2 mfid0Reconfigure a disk as a SYSTEM physical drive with no RAID:
mfiutil
syspd 0Configure the adapter to run periodic patrol reads once a week with the first patrol read starting in 5 minutes:
mfiutil
patrol auto 604800 300Display the second detected foreign configuration:
mfiutil
show foreign 1Set the current rebuild rate for volumes to 40%:
mfiutil
ctrlprop rebuild 40The mfiutil utility first appeared in
FreeBSD 8.0.