====== LSI Storage Tools ======
See also **[[computing:storage:lsi:megaraid_monitor|Monitoring LSI SAS RAID Controllers on Linux]]**
===== MegaCLI =====
http://thatlinuxbox.com/blog/article.php/lsi-megaraid-megacli
http://www.damtp.cam.ac.uk/internal/computing/docs/public/megacli_raid_lsi.html
:!: Download the MegaCLI archive from LSI and upload it to the desired Linux server. You can't use wget any more...
:!: 8.07.10_MegaCLI_Linux.zip is the version I needed for XenServer 6.2.
https://www.broadcom.com/support/download-search?pg=&pf=&pn=&pa=&po=&dk=megacli
Copy MegaCLI to the XenServer:
# copy the MegaCLI archive here
scp -P Desktop/8.07.10_MegaCLI_Linux.zip root@:~
Install MegaCLI on the XenServer:
unzip 8.07.10_MegaCLI_Linux.zip
rpm -Uvh MegaCli-8.07.10-1.noarch.rpm
The path to MegaCLI is not added during installation, so you need to change into the directory containing the binaries and preface commands with ''./'':
cd /opt/MegaRAID/MegaCli/
:!: If you are on a 64-bit platform, you may need to use ''MegaCli64'' instead of ''MegaCli''
:!: In the following examples, we assume only one controller is installed and use ''-a0'' for "Adapter 0". If you have multiple RAID cards, you will need to specify which card to operate on.
==== Silence an Alarm ====
./MegaCli -AdpSetProp -AlarmSilence -a0
:!: You have to escape the brackets and braces needed by some commands.
:!: To manipulate a particular physical device, address it by enclosure and slot:
^E |Enclosure Device ID|
^S |Slot Number |
==== Show Information ====
Disk info for drive on port 6:
./MegaCli -pdInfo -PhysDrv \[252:6\] -aALL
BBU Info:
./MegaCli -AdpBbuCmd -aALL
Display all information about all RAID adapter / settings:
./MegaCli -AdpAllinfo -aALL
Display information about all physical drives:
./MegaCli -PDList -aALL
Display information about all logical / virtual drives:
./MegaCli -LDinfo -LALL -aALL
:!: Removing a drive and putting it right back onto the same RAID controller will cause the drive to marked as "Foreign". A drive in the "Foreign" state is not usable in an array.
==== How to Rebuild a Drive That is Marked as "Foreign" When Inserted ====
See the detailed section here: http://thatlinuxbox.com/blog/article.php/lsi-megaraid-megacli
=== Summary ===
Find the drive that is not "Online" which should be the newly replaced drive by showing the first few lines of output for each drive:
./MegaCli -PDList -aALL | grep --before-context=12 Firmware
./MegaCli -PDMakeGood -PhysDrv \[E:S\] -aALL
Drives (arrays) from another controller (in a "Foreign" state) can be imported and used. However, if you just want to reuse a drive, you have to clear the "Foreign" state before you can use it again:
./MegaCli -CfgForeign -Clear -a0
Make this unconfigured drive a hot spare:
./MegaCli -PDHSP -Set -PhysDrv \[E:S\] -a0
Verify RAID rebuild in progress:
./MegaCli -pdrbld -showprog -physdrv\[E:S\] -a0
or display a continuous text-gui rebuild status:
./MegaCli -pdrbld -progdsply -physdrv\[E:S\] -a0
Change the adapter rebuild rate to 60%:
./MegaCli -AdpSetProp \{RebuildRate -60\} -a0
==== Create a Logical Disk (Logical Volume or Array) ====
Create a single disk (RAID 0):
./MegaCli -CfgLdAdd -r0 \[252:6\] -a0
Create a two-disk (RAID 1):
./MegaCli -CfgLdAdd -r1 \[252:6,252:7\] -a0
In some circumstances, the OS can’t see the new drive when using ''fdisk -l''. Try forcing a SCSI bus rescan:
echo "- - -" > /sys/class/scsi_host/host0/scan
You may need to find the proper host#:
cat /sys/class/scsi_host/host0/proc_name
cat /sys/class/scsi_host/host1/proc_name
cat /sys/class/scsi_host/host2/proc_name
==== Replace Failed Disk ====
https://www.advancedclustering.com/act_kb/replacing-a-disk-with-megacli/
https://sysadmin.compxtreme.ro/how-to-replace-an-lsi-raid-disk-with-megacli/
==== Controller Firmware Update ====
Supermicro FAQ: http://www.supermicro.com/support/faqs/faq.cfm?faq=11360
Supermicro Firmware: ftp://ftp.supermicro.com/driver/SAS/LSI/2108/Firmware/2.130.363-1846/
LSI Downloads: http://www.lsi.com/channel/support/Pages/download-search.aspx
:!: When booting the USB DOS flash drive, boot without additional memory/drivers.
=== How to Flash Firmware ===
http://forums.anandtech.com/showthread.php?t=2229711
http://brycv.com/blog/2012/flashing-it-firmware-to-lsi-sas9211-8i/
- Install the MegaCLI package (per above)
- Copy the firmware image to the directory containing MegaCLI
* You can probably use it anywhere, but it's safer to have it on the machine being flashed
- Flash the adapter
- Reboot
./MegaCli -AdpFwFlash -f smc2108.rom -a0
=== How to Recover Firmware ===
http://www.supermicro.com/support/faqs/faq.cfm?faq=13612
If hou have problems with firwmare, you may be able to use MegaRec to fix the problem.
Example: I was unable to upgrade a AOC-USAS2LP-H8iR card to the latest firmware. MegaCLI kept saying the image was corrupt even though I know it was not.
I was able to flash the controller to a newer version using the 8MB .rom file, then upgrade the controller to the latest version with MegaCLI.
megarec.exe -m0flash 0 af21088m.rom
===== SAS2Flash =====
:!: This tool works on HBAs.
**Manual**: https://docs.broadcom.com/doc/12355769
* ''-o'' enable advanced commands
* ''-c'' controller
* ''-f'' firmware
* ''-b'' BIOS
* ''-u'' backup
* ''-l'' log
Example to boot from USB DOS drive, backup and update 9207-8i HBA firmware and BIOS:
c:
cd c:\9207_8i_LSI_SAS\sas2flash_dos_rel
sas2flsh_x86.exe -ufirmware SAS9207-8i_FW-Backup.fw
sas2flsh_x86.exe -ubios SAS9207-8i_BIOS-Backup.rom
sas2flsh_x86.exe -l flashlog.txt -o -f ..\Firmware\9207_8i_LSI_SAS\Firmware\9207-8.bin -b ..\sasbios_rel\mptsas2.rom
==== Other People's Notes ====
:!: Use Rufus to make a FreeDOS USB boot volume.
Copy:
sas2flsh.exe
2118it.bin
to the root of the USB flash drive.
Boot from the USB flash drive.
execute:
sas2flsh -listall
:!: Note the numbers of the 2 cards (should be 0 and 1).
Execute:
sas2flsh -c 0 -o -e 6 (erases the firmware ROM, do not reboot until new firmware is loaded)
sas2flsh -c 0 -f 2118it.bin
sas2flsh -c 1 -o -e 6 (erases the firmware ROM, do not reboot until new firmware is loaded)
sas2flsh -c 1 -f 2118it.bin
sas2flsh -listall
Verify the firmware is loaded properly.
There is no need to load the ''mptsas2.rom'' unless you want to boot from a disk connected to the HBA cards (just use the SATA ports for boot, or USB).
The above is also true if you use the UEFI installer which is recommended. The command is sas2flash.efi instead. The command map lists all drives in the EFI shell. Change drives in UEFI like DOS ''DriveName:'' to change dir.
===== CacheCade 2.0 SSD Caching =====
http://www.lsi.com/downloads/Public/Advanced%20Software/LSI%20MegaRAID%20CacheCade%20Software/megaraid-cachecade-user-guide.pdf
Create a CacheCade software virtual drive that functions as a secondary tier of cache:
- Enter the LSI card's WebBIOS
- Select ''Configuration Wizard''
- Select ''Add Configuration''
- Select ''CacheCade - SSD Caching Configuration''
- Select an SSD drive from the left frame and click ''Add To Array''
- Click ''Accept DG''
- Click ''Select Array''
- Select a Drive Group and click ''Accept''
- ''Accept'' the final configuration