The Storage Command Line Tool (StorCLI) is the command line management software designed for the MegaRAID® product line. it's drive commands provide information and perform actions related to physical drives.

Storcli Drive Show Commands

The Storage Command Line Tool supports the following drive show commands:

storcli /cx[/ex]/sx show
storcli /cx[/eall]/sall show
storcli /cx[/ex]/sx|sall show all

Here is one example:

 storcli64 /c0/e54/s1 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
---------------------------------------------------------------------------
54:1     66 Onln   0 7.276 TB SATA HDD N   N  512B HGST HUH728080ALE604 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

Storcli Disk group Drives Commands

Disk group command show disk drives that in a group, especially useful when finding missing drive:

storcli /cx/dx|dall show

Example:

storcli64 /c0/d0 show  
Controller = 0
Status = Success
Description = Show Diskgroup Succeeded


TOPOLOGY :
========

----------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type  State BT      Size PDC  PI SED DS3  FSpace TR
----------------------------------------------------------------------------
 0 -   -   -        -   RAID6 Optl  Y  65.491 TB dflt N  N   dflt N      N  
 0 0   -   -        -   RAID6 Optl  Y  65.491 TB dflt N  N   dflt N      N  
 0 0   0   54:0     58  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   1   54:1     66  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   2   54:2     67  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   3   54:3     59  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   4   54:4     56  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   5   54:5     64  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   6   54:6     62  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   7   54:7     68  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   8   54:8     55  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   9   54:9     65  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 0 0   10  54:10    57  DRIVE Onln  Y   7.276 TB dflt N  N   dflt -      N  
 - -   -   54:44    93  DRIVE GHS   -   7.276 TB -    -  -   -    -      N  
----------------------------------------------------------------------------

DG=Disk Group Index|Arr=Array Index|Row=Row Index|EID=Enclosure Device ID
DID=Device ID|Type=Drive Type|Onln=Online|Rbld=Rebuild|Dgrd=Degraded
Pdgd=Partially degraded|Offln=Offline|BT=Background Task Active
PDC=PD Cache|PI=Protection Info|SED=Self Encrypting Drive|Frgn=Foreign
DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present
TR=Transport Ready

Storcli Missing Drives Commands

The Storage Command Line Tool supports the following commands to mark and replace missing physical drives:

storcli /cx[/ex]/sx insert array=a row=b
storcli /cx[/ex]/sx set missing
storcli /cx[/ex]/sx set offline
storcli /cx/dall

Example:

The command below set drive 1 in enclosure 54 to offline

storcli64 /c0/e54/d1 set offline

Storcli Set Drive State Commands

The Storage Command Line Tool supports the following commands to set the status of physical drives:

storcli /cx[/ex]/sx set jbod
storcli /cx[/ex]/sx set good [force]
storcli /cx[/ex]/sx set offline
storcli /cx[/ex]/sx set online

Example:

This drive changes the drive state to unconfigured good. If the drive has the operating system in it, use the force option.

storcli64 /c1/e54/s3 set good

Storcli Drive Initialization Commands

When you initialize drives, all the data from the drives is cleared. The Storage Command Line Tool supports the
following commands to initialize drives:

storcli /cx[/ex]/sx show initialization
storcli /cx[/ex]/sx start initialization
storcli /cx[/ex]/sx stop initialization

Example:

This command shows the current progress of the initialization progress in percentage.

storcli64 /c0/e54/s4 show initialization

Storcli Drive Firmware Download Commands

The Storage Command Line Tool supports the following command to download drive firmware:

storcli /cx[/ex]/sx download src=filepath [satabridge]

This command flashes the firmware with the specified file. The satabridge option lets you download the SATA
bridge firmware in online mode.

storcli64 /c0/e54/s1 download src=c:\file1.bin

Storcli Locate Drives Commands

The Storage Command Line Tool supports the following commands to locate a drive and activate the physical disk
activity LED:

storcli /cx[/ex]/sx start locate
storcli /cx[/ex]/sx stop locate

Example:
This command locates a drive and activates the drive’s LED.

storcli /c0/e54/s1 start locate

This command stops a locate operation and deactivates the drive’s LED.

storcli64 /c0/e54/s1 stop locate

Storcli Prepare to Remove Drives Commands

The Storage CLI supports the following commands to prepare the physical drive for removal:

storcli /cx[/ex]/sx spindown
storcli /cx[/ex]/sx spinup

Storcli Drive Secure Erase Commands

The Storage Command Line supports the following drive erase commands:

storcli /cx[/ex]/sx secureerase [force]
storcli /cx[/ex]/sx start erase [simple|normal|thorough] [erasepatternA=<value1>]
[erasepatternB=<value2>]
storcli /cx[/ex]/sx stop erase

Example:

This command erases the drive's security configuration and securely erases data on a drive. You can use the force
option as a confirmation to erase the data on the drive and the security information.

storcli64 /c0/e54/s1 secureerase

NOTE This command deletes data on the disk

Storcli Rebuild Drives Commands

The following commands rebuild drives in the Storage Command Line Tool:

storcli /cx[/ex]/sx pause rebuild
storcli /cx[/ex]/sx resume rebuild
storcli /cx[/ex]/sx show rebuild
storcli /cx[/ex]/sx start rebuild
storcli /cx[/ex]/sx stop rebuild

Example:

This command pauses an ongoing rebuild process. You can run this command only for a drive that is currently rebuilt.

storcli64 /c0/s4 pause rebuild

This command resumes a paused rebuild process. You can run this command only when a paused rebuild process for the drive exists.

storcli64 /c0/s4 resume rebuild

This command shows the progress of the rebuild process in percentage.

storcli64 /c0/s5 show rebuild

Storcli Drive Copyback Commands

The Storage Command Line Tool supports the following commands for drive copyback:

storcli /cx[/ex]/sx pause copyback
storcli /cx[/ex]/sx resume copyback
storcli /cx[/ex]/sx show copyback
storcli /cx[/ex]/sx start copyback target=eid:sid
storcli /cx[/ex]/sx stop copyback

Example:

This command pauses a copyback operation. You can run this command only when there is a copyback operation running.

storcli64 /c0/e54/s4 pause copyback

This command resumes a paused copyback operation. You can run this command only when there is a paused
copyback process for the drive.

storcli64 /c0/e54/s4 resume copyback

This command shows the progress of the copyback operation in percentage.

storcli64 /c0/e54/s4 show copyback

This command starts a copyback operation for a drive.

storcli64 /c0/e54/s4 start copyback target=54:8

This command stops a copyback operation. You can run this command only on drives that have the copyback
operation running.

storcli64 /c0/e54/s4 stop copyback

Storcli Hot Spare Drive Commands

The following commands create and delete hot spare drives:

storcli64 /cx[/ex]/sx add hotsparedrive
{dgs=<n|0,1,2...>}[enclaffinity][nonrevertible]
storcli /cx/[ex]/sx delete hotsparedrive

This command sets the drives /c0/e54/s43,44 as Global Hot spare.

storcli64 /c0/e54/s43,44 add hotsparedrive

This command sets /c0/e3/s6,8 as Dedicated Hot spare for disk groups 0,1.

storcli64 /c0/e54/s4344 add hotsparedrive dgs=0,1

This command deletes a hot spare drive.

storcli64 /c0/e54/s43 delete hotsparedrive

Storcli Drive Security Commands

The Storage Command Line Tool supports the following drive security command:

storcli /cx[/ex]/sx show securitykey keyid
storcli /cx[/ex]/sx show securitykey keyid

This command shows the security key for secured physical drives.
storcli /c0/e64/s1 show SecurityKey keyid