User Tools

Site Tools


computing:storage:megaraid

This is an old revision of the document!


LSI MegaRAID

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…

Install MegaCLI:

mkdir ~/MegaCLI
cd ~/MegaCLI

# copy the MegaCLI archive here
scp -P <ssh port> Desktop/8.07.06_MegaCLI.zip root@<server name or IP>:~

unzip 8.07.06_MegaCLI.zip

rpm -Uvh Linux/MegaCli-8.07.06-1.noarch.rpm

The path to MegaCLI may not be added during installation, so you might just 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 -LDGetProp -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

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

Controller Firmware Update

How to Flash Firmware

http://forums.anandtech.com/showthread.php?t=2229711

http://brycv.com/blog/2012/flashing-it-firmware-to-lsi-sas9211-8i/

  1. Install the MegaCLI package (per above)
  2. 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
  3. Flash the adapter
  4. Reboot
./MegaCli -AdpFwFlash -f smc2108.rom -a0

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:

  1. Enter the LSI card's WebBIOS
  2. Select Configuration Wizard
  3. Select Add Configuration
  4. Select CacheCade - SSD Caching Configuration
  5. Select an SSD drive from the left frame and click Add To Array
  6. Click Accept DG
  7. Click Select Array
  8. Select a Drive Group and click Accept
  9. Accept the final configuration
computing/storage/megaraid.1362251063.txt.gz · Last modified: 2013/03/02 12:04 by gcooper