The LSI StorCLI is a command line tool to manage and control LSI MegaRAID controllers. In this article you will find a collection of useful commands to administer your LSI RAID controller.
First Download and Install the utility
cd /usr/local/src wget http://docs.avagotech.com/docs-and-downloads/docs-and-downloads/raid-controllers/raid-controllers-common-files/1.19.04_StorCLI.zip unzip 1.19.04_StorCLI.zip cd storcli_all_os cd Linux rpm -ivh storcli-1.19.04-1.noarch.rpm
It will install it in /opt/MegaRAID/storcli/storcli64
Create a symlink from /opt in /usr/bin
ln -s /opt/MegaRAID/storcli/storcli64 /usr/bin/storcli
Usage Information
-
/cx = Controller ID
/vx = Virtual Drive Number.
/ex = Enclosure ID
/sx = Slot ID
Run the following command to get the Controller ID
storcli show
Where Ctl is the Controller ID in the sample output below.
[root@server ~]# storcli show Status Code = 0 Status = Success Description = None Number of Controllers = 1 Host Name = server.name.com Operating System = Linux3.10.0-327.22.2.el7.x86_64 System Overview : =============== ----------------------------------------------------------------------------------- Ctl Model Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS EHS ASOs Hlth ----------------------------------------------------------------------------------- 0 LSIMegaRAIDSAS9260-4i 4 2 1 0 1 0 Msng On 1&2 Y 2 Opt ----------------------------------------------------------------------------------- Ctl=Controller Index|DGs=Drive groups|VDs=Virtual drives|Fld=Failed PDs=Physical drives|DNOpt=DG NotOptimal|VNOpt=VD NotOptimal|Opt=Optimal Msng=Missing|Dgd=Degraded|NdAtn=Need Attention|Unkwn=Unknown sPR=Scheduled Patrol Read|DS=DimmerSwitch|EHS=Emergency Hot Spare Y=Yes|N=No|ASOs=Advanced Software Options|BBU=Battery backup unit Hlth=Health|Safe=Safe-mode boot [root@server ~]#
The above output says there are 2 Physical Disks, 1 Virtual Disk and 1 Drive Group.
To get the details of attached Physical Disks, run the following command.
storcli /c0 /eall /sall show
There you can see the Enclosure ID and Slot ID of each drive.
Sample Output
[root@server ~]# storcli /c0 /eall /sall show Controller = 0 Status = Success Description = Show Drive Information Succeeded. Drive Information : ================= ------------------------------------------------------------------- EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp ------------------------------------------------------------------- 252:0 5 Onln 0 2.728 TB SATA HDD N N 512B ST33000650NS U 252:1 4 Onln 0 2.728 TB SATA HDD N N 512B ST33000650NS U ------------------------------------------------------------------- EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare UBad-Unconfigured Bad|Onln-Online|Offln-Offline|Intf-Interface Med-Media Type|SED-Self Encryptive Drive|PI-Protection Info SeSz-Sector Size|Sp-Spun|U-Up|D-Down|T-Transition|F-Foreign UGUnsp-Unsupported|UGShld-UnConfigured shielded|HSPShld-Hotspare shielded CFShld-Configured shielded|Cpybck-CopyBack|CBShld-Copyback Shielded [root@server ~]#
To get the details of attached Virtual Disk, run
storcli /c0 /vall show
Sample Output
[root@server ~]# storcli /c0 /vall show Controller = 0 Status = Success Description = None Virtual Drives : ============== ------------------------------------------------------------- DG/VD TYPE State Access Consist Cache Cac sCC Size Name ------------------------------------------------------------- 0/0 RAID1 Optl RW No RAWBD - ON 2.728 TB ------------------------------------------------------------- Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked| Consist=ConsistentR=Read Ahead Always|NR=No Read Ahead|WB=WriteBack| AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled Check Consistency [root@server ~]#
To get all info of Controller ID = 0, run
storcli /c0 show all