Skip to main content
  1. Posts/

StorCLI Command Cheat Sheet

·3 mins·
Table of Contents

StorCLI adalah command-line utility untuk mengelola storage controllers LSI/Broadcom MegaRAID, memungkinkan kontrol penuh atas drive fisik dan virtual, konfigurasi RAID, dan diagnostik sistem. Tool ini menggunakan sintaks hierarkis dengan pengidentifikasi seperti /c0 untuk controller 0, /e0 untuk enclosure, and /s0 untuk slot. Sebagian besar perintah mendukung operasi show, set, dan delete, dan menambahkan J di akhir akan menghasilkan output dalam format JSON.

🔹 Quick Health & Error Check
#

storcli /c0 /eall /sall show
storcli /c0 /e252 /sall show all
storcli /c0 /eall /sall show all | egrep "Slot Number|State|Media Error Count|Other Error Count|Predictive Failure Count"

Controller & System Overview
#

  • List all controllers:
storcli /call show
  • Show detailed controller information:
storcli /c0 show all
  • Display system overview (controllers, drives, health):
storcli show
  • Show firmware, model, and serial number:
storcli /c0 show

Physical Drives
#

  • Show all physical drives:
storcli /call/dall show
  • Show detailed info for all physical drives:
storcli /call/dall show all
  • Show drives in specific enclosure (example: enclosure 252):
storcli /c0/e252/sall show
  • Show specific drive (enclosure 252, slot 0):
storcli /c0/e252/s0 show

Virtual Drives
#

  • List all virtual drives:
storcli /call/vall show
  • Show detailed info for virtual drive 0:
storcli /c0/v0 show
  • Show virtual drive properties in JSON format:
storcli /c0/v0 show J
  • Show initialization status:
storcli /c0/v0 show init

RAID Management
#

Create RAID Arrays
#

  • Create RAID 1 (mirror) with 2 drives:
storcli /c0 add vd r1 drives=252:0,252:1
  • Create RAID 5 with drives slot 0–7:
storcli /c0 add vd r5 drives=252:0-7
  • Create RAID 10 with 8 drives (2 drives per array):
storcli /c0 add vd r10 drives=252:0-7 pdperarray=2

Delete Virtual Drives
#

  • Delete all virtual drives on controller 0:
storcli /c0/vall delete force

⚠️ WARNING: This will destroy all data.

RAID Migration / Expansion
#

  • Expand RAID 5 by adding a new drive:
storcli /c0/v0 start migrate type=raid5 option=add drives=252:8

Tips & Best Practices:

  • Always check Media Error Count and Predictive Failure Count before replacing disks.
  • Use show all for full SMART-like detail.
  • RAID migration can take hours to days depending on disk size and load.
  • Backup before RAID operations.

Disk & Enclosure Operations
#

Locate / Identify Disk
#

  • Blink LED untuk identifikasi disk:
storcli /c0/e252/s0 start locate
  • Matikan LED locate:
storcli /c0/e252/s0 stop locate

Mark Disk as Failed / Missing (Untuk Replacement)
#

StorCLI tidak memakai insert untuk mark missing. Command yang benar adalah set state atau offline.
  • Mark disk sebagai failed (manual fail):
storcli /c0/e252/s0 set failed
  • Mark disk sebagai offline:
storcli /c0/e252/s0 set offline

Replace Failed Drive & Rebuild
#

  1. Replace disk secara fisik
  2. Start rebuild (biasanya otomatis jika hot spare atau RAID policy mendukung)

Manual rebuild:

storcli /c0/e252/s0 start rebuild

Correct replacement workflow:

storcli /c0/e252/s0 set failed
# Replace disk physically
storcli /c0/e252/s0 start rebuild

Clear Foreign Configuration
#

storcli /call/fall delete

Controller Settings
#

  • Enable JBOD mode:
storcli /c0 set jbod=on
  • Disable JBOD mode:
storcli /c0 set jbod=off
  • Set rebuild rate (30%):
storcli /c0 set rebuildrate=30
  • Enable alarm:
storcli /c0 set alarm=enbl
  • Silence alarm:
storcli /c0 set alarm=silence

Diagnostics & Maintenance
#

  • Show BBU status:
storcli /c0/bbu show
  • Show CacheVault info:
storcli /c0/cv show
  • Show enclosure info:
storcli /c0/eall show
  • Show event logs:
storcli /c0 show events
  • Clear event logs:
storcli /c0 delete events
  • Start patrol read:
storcli /c0 start patrolread

Advanced Operations
#

Initialize Virtual Drive
#

  • Full initialization:
storcli /c0/v0 start init full
  • Force init (⚠️ DESTROYS DATA):
storcli /c0/v0 start init full force
  • Show init progress:
storcli /c0/v0 show init

Cache Policy
#

  • Set cache policy (WriteBack + ReadAhead):
storcli /c0/v0 set wrcache=WB rdcache=RA

Common options:

  • WB / WT → Write Back / Write Through
  • RA / NR → Read Ahead / No Read Ahead

Global Hot Spare
#

  • Set drive as global hot spare:
storcli /c0/e252/s1 add hotsparedrive

Related