Storcli: Difference between revisions

From HPCWIKI
Jump to navigation Jump to search
(Fix: remove --- horizontal lines (12 removed))
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''StorCLI''' is a command line tool for the administration of '''MegaRAID Controllers''' and the '''successor of MegaCLI.'''
= Storcli =


[[HBA/RAID controller]] provides high level summary for HBA and RAID controller. 
{{Status
|status=Draft
|owner=Knowledge Agent
|last_update=2026-07-15
|review=Pending
}}


Detailed background and overall introduction is available [https://docs.broadcom.com/doc/12352476 this old document] and user reference manual is available at this Broadcom site<ref>https://docs.broadcom.com/doc/12352476</ref>
{{TOC}}


== Install storcli under Ubuntu ==
== Overview ==


# Download the latest version of storecli from [https://www.broadcom.com/site-search?page=1&per_page=100&q=storcli&sort_direction&#x5B;pages&#x5D;=desc&sort_field&#x5B;pages&#x5D;=updated_at Broadcom URL] then unzip the zip file.
StorCLI는 Broadcom(구 LSI/Avago) MegaRAID 컨트롤러를 관리하기 위한 명령줄 도구입니다. MegaCLI의 후속 버전으로, 더 향상된 기능과 호환성을 제공합니다.
# Unzip will create folder name storcli_rel and this folder containes Unified_storcli_all_os.zip
# Again, unzip Unified_storcli_all_os.zip under the storcli_rel folder then it creates Unified_storcli_all_os folder which contains installable package to [[support]] various version of operating system.
# For Ubuntu, move to Unbuntu folder under the unzipped folder name Unified_storcli_all_os, e.g, Unified_storcli_all_os/Ubuntu
# Install Debian packages. By default, storcli64 executable file will be installed at  /opt/MegaRAID/storcli/storcli64
<syntaxhighlight lang="bash">
$ sudo dpkg -i storcli_rel/Unified_storcli_all_os/Ubuntu/*.deb  #example to install deb package


# To verify storcli installation
=== Summary ===
$dpkg -l | grep -i storecli


# Default storcli command will be installed at By default, storcli64 executable file will be installed at /opt/MegaRAID/storcli/storcli64
* 무엇인가? — MegaRAID 컨트롤러 관리 CLI 도구
* 왜 필요한가? — RAID 구성, 모니터링, 성능 최적화
* 언제 사용하는가? — 데이터센터 서버 RAID 관리


</syntaxhighlight>


* Administrator can add /opt/MegaRAID/storcli/storcli64 to $PATH or create symbolic link to exist $PATH such as /usr/local/bin
== Purpose ==


* HPCMATE storage system has symbolic link at /usr/loca/bin/storcli -> /opt/MegaRAID/storcli/storcli64
이 문서가 존재하는 이유


== Storcli vs Megacli ==
* Goal: StorCLI 설치, 명령어, RAID 구성, 모니터링 방법 제공
Although Storcli is '''successor of MegaCLI, StorCLI command syntax does not compatible with MegaCLI.'''  [https://www.broadcom.com/support/knowledgebase/1211161499760/lsi-command-line-interface-cross-reference-megacli-vs-twcli-vs-s this Broadcom page] '''describes the difference''' between MegaCLI and StorCLI
* Scope: StorCLI 설치, 명령어 요약, RAID 생성/삭제/확장, 핫 스페어 관리
* Non-goals: MegaCLI 레거시 명령어, 특정 OEM 펌웨어 설정은 별도 문서


== Storcli Commands ==


====== Storcli command should be used as root priviliges otherwise command result is not successful without any error message. ======
== Key Concepts ==
<syntaxhighlight lang="bash">
$ storcli show      #cli without priviliges
CLI Version = 007.2310.0000.0000 Nov 02, 2022
Operating system = Linux 5.4.0-153-generic
Status Code = 0
Status = Success
Description = None
 
Number of Controllers = 0
Host Name = shannon-nas
Operating System  = Linux 5.4.0-153-generic


{| class="wikitable"
! Concept
! Description
! Related
|-
| MegaRAID
| Broadcom RAID 컨트롤러 라인업
| [[Storcli]]
|-
| Virtual Drive
| RAID로 구성된 논리 드라이브
| [[Storcli]]
|-
| Physical Drive
| 실제 물리적 디스크
| [[Storcli]]
|-
| Hot Spare
| 예비 디스크 — 자동 복구
| [[Storcli]]
|-
| Write Policy
| Write Back/Through — 성능 vs 안전
| [[Storcli]]
|-
| BBU/CacheVault
| 캐시 보호 장치
| [[HBA/RAID controller]]
|-
| Direct Mode
| PD 매핑 고정
| [[Storcli]]
|-
| Foreign Config
| 이전 서버 구성 이력
| [[Storcli]]
|}


$ sudo storcli show    ##cli with priviliges
CLI Version = 007.2310.0000.0000 Nov 02, 2022
Operating system = Linux 5.4.0-153-generic
Status Code = 0
Status = Success
Description = None


Number of Controllers = 1
== Architecture ==
Host Name = shannon-nas
Operating System  = Linux 5.4.0-153-generic


System Overview :
StorCLI는 MegaRAID 컨트롤러와 물리적 디스크 간 인터페이스입니다:
===============
 
------------------------------------------------------------------------------------
Ctl Model                  Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS  EHS ASOs Hlth
------------------------------------------------------------------------------------
  0 AVAGOMegaRAIDSAS9361-8i    8  6  0    0  0    0 N/A On  1&2 Y      3 Opt 
------------------------------------------------------------------------------------


Ctl=Controller Index|DGs=Drive groups|VDs=Virtual drives|Fld=Failed
<syntaxhighlight lang="mermaid">
PDs=Physical drives|DNOpt=Array NotOptimal|VNOpt=VD NotOptimal|Opt=Optimal
graph TD
Msng=Missing|Dgd=Degraded|NdAtn=Need Attention|Unkwn=Unknown
    A[StorCLI] --> B[MegaRAID Controller]
sPR=Scheduled Patrol Read|DS=DimmerSwitch|EHS=Emergency Spare Drive
    B --> C[Physical Drives]
Y=Yes|N=No|ASOs=Advanced Software Options|BBU=Battery backup unit/CV
    B --> D[Virtual Drives]
Hlth=Health|Safe=Safe-mode boot|CertProv-Certificate Provision mode
    B --> E[BBU/CacheVault]
Chrg=Charging | MsngCbl=Cable Failure
    C --> F[HDD/SSD]
    D --> G[OS / Filesystem]
    E --> H[Cache Protection]
</syntaxhighlight>
</syntaxhighlight>


== Creating and Deleting a RAID ==


=== Create Virtual Drives ===
== Workflow ==
Storcli /cx add vd type=raid[0|1|5|6|10|50|60][Size=<VD1_Sz>,<VD2_Sz>,..|*all] [name=<VDNAME1>,..] drives=e:s|e:s-x|e:s-x,y [PDperArray=x|auto*] [SED] [pdcache=on|off|*default][pi] [DimmerSwitch(ds)=default|automatic(auto)| *none|maximum(max)|MaximumWithoutCaching(maxnocache)] [wt|*wb] [nora|*ra] [*direct|cached] [CachedBadBBU|*NoCachedBadBBU]


[strip=<8|16|32|64|128|256|512|1024] [AfterVd=x] [Spares=[e:]s|[e:]s-x|[e:]s-x,y] [force]
{| class="wikitable"
! Stage
! Input
! Output
|-
| Install
| .deb package
| storcli64 binary
|-
| Show
| storcli show
| Controller info
|-
| Create RAID
| storcli add vd
| Virtual Drive
|-
| Monitor
| storcli /c0/vall show
| RAID status
|-
| Replace Disk
| storcli /c0/e8/s0 start rebuild
| Rebuild in progress
|}




<u>** LSI recommend to use sequential access patterns in the range of 64 KB to 1 MB. Use random access patterns in the range of 0.5 KB to 8 KB</u> <ref>https://www.supermicro.com/CaseStudies/6Gbs_LSI_b.pdf</ref>
== Detailed Explanation ==


=== Deleting Virtual Drives ===
=== StorCLI 설치 (Ubuntu) ===
The following command deletes virtual drives:


storcli /cx/v(x|all) del [cc|cachecade]. (The cc or cachecade option to confirm that the deleted drive is a [[CacheCade drive]])
<syntaxhighlight lang="bash">
# 최신 버전 다운로드 (Broadcom 공식 URL)
# storcli_rel 폴더 생성
# Unified_storcli_all_os.zip 추출
# Ubuntu 폴더로 이동


=== Setting the disk cache policy in a Virtual Drive ===
# Debian 패키지 설치
To set the current disk cache policy on a virtual drive to on, off, or default setting.
$ sudo dpkg -i storcli_rel/Unified_storcli_all_os/Ubuntu/*.deb


storcli /cx/vx set pdcache=<on|off|default>
# 설치 확인
$ dpkg -l | grep -i storcli


Example) storcli /c0/v0 set pdcache=on
# 기본 설치 경로: /opt/MegaRAID/storcli/storcli64


# 심볼릭 링크 생성 (권장)
$ sudo ln -s /opt/MegaRAID/storcli/storcli64 /usr/local/bin/storcli
</syntaxhighlight>


<u>** LSI recommends Direct I/O for all RAID level configurations.</u><ref>https://www.supermicro.com/CaseStudies/6Gbs_LSI_b.pdf</ref>
=== StorCLI vs MegaCLI ===


=== Setting the read cache policy in a Virtual Drive ===
StorCLI는 MegaCLI의 후속 버전이지만, **명령어 구문이 호환되지 않습니다**. Broadcom의 크로스 레퍼런스 페이지에서 차이점을 확인할 수 있습니다.
To set the read cache policy on a virtual drive to read ahead, no read ahead, or adaptive read ahead.


storcli /cx/vx set rdcache=<ra|nora>
=== StorCLI 명령어 사용 ===


Example) storcli /c0/v0 set rdcache=nora
**StorCLI는 루트 권한으로 실행해야 합니다.** (권한 없으면 에러 없이 실패)


<syntaxhighlight lang="bash">
# 권한 없이 실행 (실패)
$ storcli show
Number of Controllers = 0


<u>** LSI does not recommend using the Always Read Ahead policy</u><ref>https://www.supermicro.com/CaseStudies/6Gbs_LSI_b.pdf</ref>
# 권한 있고 실행 (성공)
$ sudo storcli show
Number of Controllers = 1
</syntaxhighlight>


=== Setting the Write Policy in a Virtual Drive<ref>https://techdocs.broadcom.com/content/dam/broadcom/techdocs/data-center-solutions/tools/generated-pdfs/12Gbs-MegaRAID-Tri-Mode-Software.pdf</ref> ===
=== 시스템 개요 ===
Storcli /cx/v(x|all) set wrcache=wt|wb|awb  (write cache to write back, write through, or always write back)
{| class="wikitable"
|+
!Write Policy
!Description
!Some recommendation
|-
|Write Back
|The controller sends a data transfer completion signal to the host when the controller


cache receives the data in a transaction. If you select the Write Back policy and the
<syntaxhighlight lang="bash">
$ sudo storcli show


battery is absent, the firmware disables the Write Back policy and defaults to the Write
System Overview :
===============
------------------------------------------------------------------------------------
Ctl Model                  Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS  EHS ASOs Hlth
------------------------------------------------------------------------------------
  0 AVAGOMegaRAIDSAS9361-8i    8  6  0    0  0    0 N/A On  1&2 Y      3 Opt
------------------------------------------------------------------------------------
</syntaxhighlight>


Through policy.
**기호 설명:**
|Write-back is more efficient in environments with “bursty” write activity.
* Ctl: Controller Index
|-
* DGs: Drive Groups
|Write Through
* VDs: Virtual Drives
|The controller sends a data transfer completion signal to the host when the drive
* PDs: Physical Drives
subsystem receives all the data in a transaction.
* Fld: Failed
|LSI recommends using the Write-through policy for RAID 0, RAID 1, and RAID 10 configurations with streaming or sequential data reads, because it can avoid
* DNOpt: Array NotOptimal
copying data into a cache
* VNOpt: VD NotOptimal
|-
* Opt: Optimal
|Always Write Back
* Msng: Missing
|The controller sends a data transfer completion signal to the host when the controller
* Dgd: Degraded
cache receives all the data in a transaction. If you select the Always Write Back policy
* sPR: Scheduled Patrol Read
* DS: DimmerSwitch
* EHS: Emergency Spare Drive
* Hlth: Health


and the battery is absent, the firmware is forced to use the Write Back policy.
=== RAID 생성 ===
|
|}


=== '''Listup available HDDs to create RAID disk group under controller #0''' ===
<syntaxhighlight lang="bash">
Before we begin to initialize and create RAID disk group, we would need to check and the necessary disk information.
# RAID6 생성 (6개 HDD)
$ sudo storcli /c0 add vd r6 name=RAID6 drives=0:0-5


# RAID1 생성 (OS용)
$ sudo storcli /c0 add vd type=raid1 drives=0:0-1 name=OS


NOTE: Newly added physical disks will be under the status, UGOOD (Unconfigured Good)<syntaxhighlight lang="bash">
# RAID10 생성
$ sudo storcli /c0/eall/sall show
$ sudo storcli /c0 add vd type=raid10 drives=0:0-3 name=RAID10
CLI Version = 007.2310.0000.0000 Nov 02, 2022
Operating system = Linux 5.4.0-153-generic
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.


Drive Information :
# RAID5 생성
=================
$ sudo storcli /c0 add vd type=raid5 drives=0:0-5 name=RAID5
-----------------------------------------------------------------------------
EID:Slt DID State DG      Size Intf Med SED PI SeSz Model            Sp Type
-----------------------------------------------------------------------------
0:0      4 UGood -  10.913 TB SAS  HDD N  N  512B HUH721212AL5200  U  -   
0:1      3 UGood -  10.913 TB SAS  HDD N  N  512B HUH721212AL5200  U  -   
0:2      2 UGood -  10.913 TB SAS  HDD N  N  512B HUH721212AL5200  U  -   
0:3      1 UGood - 10.913 TB SAS  HDD N  N  512B HUH721212AL5200  U  -   
0:4      6 UGood -  10.913 TB SAS  HDD N  N  512B HUH721212AL5200  U  -   
0:5       5 UGood -  10.913 TB SAS  HDD N  N  512B HUH721212AL5200  U  -   
-----------------------------------------------------------------------------
</syntaxhighlight>** Some disks may have the ‘F’ indicator which means that the disk came from a previously configured RAID group in a different server. To delete any foreign drives, simply enter the following command: –<syntaxhighlight lang="bash">
$sudo storcli /c0 /fall delete
</syntaxhighlight>
</syntaxhighlight>


=== Create RAID1 group for OS ===
**RAID 생성 옵션:**
To protect OS boot issue, RAID1 (mirror with two disk) would increase safty on OS bootup under enterprise environment.
* `strip=<8|16|32|64|128|256|512|1024>` — 스트라이프 크기
* `pdcache=on|off|default` — 물리적 드라이브 캐시
* `wt|wb` — Write Through/Back
* `nora|ra` — Read Ahead
* `Spares=[e:]s|[e:]s-x` — 핫 스페어


Folloing shows RAID1 configuration example using two 1TB SSD for OS <syntaxhighlight lang="bash">
=== RAID 삭제 ===
$ sudo storcli /c0 /vall show
CLI Version = 007.2310.0000.0000 Nov 02, 2022
Operating system = Linux 5.4.0-42-generic
Controller = 0
Status = Success
Description = None


<syntaxhighlight lang="bash">
# 가상 드라이브 삭제
$ sudo storcli /c0/v0 del


Virtual Drives :
# 모든 가상 드라이브 삭제
==============
$ sudo storcli /c0/vall del
</syntaxhighlight>


---------------------------------------------------------------
=== 디스크 캐시 정책 ===
DG/VD TYPE  State Access Consist Cache Cac sCC      Size Name
---------------------------------------------------------------
0/0  RAID1 Optl  RW    No      RWTD  -  ON  931.000 GB OS 
---------------------------------------------------------------


<syntaxhighlight lang="bash">
# 가상 드라이브 캐시 정책 설정
$ sudo storcli /c0/v0 set pdcache=on
$ sudo storcli /c0/v0 set rdcache=nora
$ sudo storcli /c0/v0 set wrcache=wb
</syntaxhighlight>
</syntaxhighlight>


=== Create RAID group ===
**LSI 권장사항:**
add the disks into a single virtual disk group via the '''''add vd''''' command. In this case, we will setup a RAID Level 6 disk group with RAID6.<syntaxhighlight lang="bash">
* 모든 RAID 레벨 → Direct I/O 권장
# Create RAID6 disk group with 6 HDDs range 0:0-5 as name RAID6
* RAID 0/1/10 (스트리밍) → Write Through 권장
$ sudo storcli /c0 add vd r6 name=RAID6 drives=0:0-5
* RAID 0/1/10 (랜덤) → Write Back 권장
CLI Version = 007.2310.0000.0000 Nov 02, 2022
* RAID 5/6 → Write Back 권장
Operating system = Linux 5.4.0-153-generic
Controller = 0
Status = Success
Description = Add VD Succeeded.


# Verify RAID6 disk group
=== Write Policy ===
$ sudo storcli /c0/vall show
CLI Version = 007.2310.0000.0000 Nov 02, 2022
Operating system = Linux 5.4.0-153-generic
Controller = 0
Status = Success
Description = None


Virtual Drives :
{| class="wikitable"
==============
! Write Policy
---------------------------------------------------------------
! Description
DG/VD TYPE  State Access Consist Cache Cac sCC      Size Name 
! Recommendation
---------------------------------------------------------------
|-
0/0  RAID6 Optl  RW    No      RWTD  -   ON  43.654 TB RAID6
| Write Back (WB)
---------------------------------------------------------------
| 컨트롤러 캐시에 데이터 수신 시 완료 신호
| "bursty" 쓰기 환경에 효율적
|-
| Write Through (WT)
| 드라이브에 데이터 수신 시 완료 신호
| RAID 0/1/10 스트리밍 데이터에 권장
|-
| Always Write Back (AWB)
| BBU 부재 시에도 Write Back 강제
| BBU 필수 (데이터 손실 위험)
|}


$lsblk
=== 디스크 정보 확인 ===
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda          8:0    0  43.7T  0 disk <<< VD name RAID6 is available on OS


#make GPT partition
<syntaxhighlight lang="bash">
$ sudo parted -s -a optimal /dev/sda mklabel gpt mkpart primary 0% 100%
# 사용 가능한 디스크 확인
$ lsblk
$ sudo storcli /c0/eall/sall show
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda          8:0    0  43.7T  0 disk
└─sda1        8:1    0  43.7T  0 part


#Make filesystem
# 출력 예시
$ sudo sudo mkfs.ext4 /dev/sda1
# EID:Slt DID State DG      Size Intf Med SED PI SeSz Model            Sp Type
# 0:0      4 UGood -  10.913 TB SAS  HDD N  N  512B HUH721212AL5200  U  -
</syntaxhighlight>
</syntaxhighlight>


=== Delete RAID6 disk groups ===
**디스크 상태:**
To delete exist disk groups, use del command options<syntaxhighlight lang="bash">
* UGood: Unconfigured Good
$ sudo storcli /c0/v0 del
* GHS: Global Hot Spare
CLI Version = 007.2310.0000.0000 Nov 02, 2022
* DHS: Dedicated Hot Spare
Operating system = Linux 5.4.0-153-generic
* Onln: Online
Controller = 0
* Fld: Failed
Status = Success
 
Description = Delete VD succeeded
=== Foreign Configuration 처리 ===
 
<syntaxhighlight lang="bash">
# Foreign Configuration 삭제
$ sudo storcli /c0/fall delete


hpcmate@shannon-nas:~$ sudo storcli /c0/vall show  
# Foreign Configuration 확인
CLI Version = 007.2310.0000.0000 Nov 02, 2022
$ sudo storcli /c0/fall show
Operating system = Linux 5.4.0-153-generic
Controller = 0
Status = Success
Description = No VD's have been configured.
</syntaxhighlight>
</syntaxhighlight>


== remove a dedicated (DHS) or global hot spare (GHS)? ==
=== 핫 스페어 관리 ===
Determine enclosure and slot with this command:
<code>storcli /c0/eall/sall show</code>


{| class="wikitable"
! Type
! Description
! Example
|-
| Global Hot Spare
| 모든 RAID 그룹에 자동 할당
| `storcli /cx/ex/sx add hotsparedrive`
|-
| Dedicated Hot Spare
| 특정 RAID 그룹에 할당
| `storcli /cx/ex/sx add hotsparedrive dgs=N`
|-
| Emergency Hot Spare
| SMART 오류 시 자동 할당
| `storcli /cx set eghs eug=on`
|}


<code>storcli /c0/e252/s4 delete hotsparedrive</code>
**핫 스페어 제거:**


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Determine GHS disk's enclosure and slot with this command:
# 핫 스페어 상태 제거
$ sudo storcli /c0/e65/s11 delete hotsparedrive


storcli /c0/eall/sall show
# 디스크 오프라인
$ sudo storcli /c0/e65/s11 set offline
</syntaxhighlight>


=== 디스크 위치 찾기 ===


EID:Slt DID State DG      Size Intf Med SED PI SeSz Model                  Sp Type
<syntaxhighlight lang="bash">
-------------------------------------------------------------------------------------
# 디스크 깜빡이기 (물리적 위치 확인)
...
$ sudo storcli /c0/e0/s2 start locate
65:10    6 UGood -  10.913 TB SAS  HDD N  N  512B MG07SCA12TE            U  -   
65:11    3 GHS  -  10.913 TB SAS  HDD N  N  512B MG07SCA12TE            U  -   
66:0    10 UGood -  10.913 TB SAS  HDD N  N  512B MG07SCA12TE            D  -   


To remove the disk, you first have to turn it into a UGOOD - "unconfigured good" disk by deleting the hotspare status:
# 깜빡임 중지
$ sudo storcli /c0/e0/s2 stop locate
</syntaxhighlight>


storcli /c0/e65/s11 delete hotsparedrive
=== 디스크 교체 ===


The drive will now look like this:
<syntaxhighlight lang="bash">
65:11    3 UGood  -  10.913 TB SAS  HDD N  N  512B MG07SCA12TE            U  -   
# 실패한 디스크 교체
$ sudo storcli /c0/e8/s0 insert dg=0 array=0 row=0


Now you can turn it off using
# 수동 리빌드 시작
storcli /c0/e65/s11 set offline
$ sudo storcli /c0/e8/s0 start rebuild
</syntaxhighlight>


which changes the state to:
=== 디스크 직렬 번호 확인 ===
65:11    3 UGood  -  10.913 TB SAS  HDD N  N  512B MG07SCA12TE      D  -   
                                                                        ^


(the value in the "Sp" = Spun column changed from "U" = Up to "D" = Down).
<syntaxhighlight lang="bash">
$ sudo storcli /c0/eALL/sALL show all | egrep 'Device attributes|SN = '
</syntaxhighlight>
</syntaxhighlight>


== Location of HDDs<ref>https://www.thomas-krenn.com/en/wiki/StorCLI_commands#Creating_a_Virtual_Drive</ref> ==
=== 디스크 상태 확인 (smartctl) ===
 
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
# Blinking HDD to find location, controller 0, Enclosure0, slot 2
# 디바이스 ID 확인
$ sudo storcli /c0/e0/s2 start locate
$ sudo storcli /c0/eall/sall show
# To stop blinking
 
$ sudo storcli /c0/e0/s2 stop locate
# smartctl로 디스크 테스트
$ smartctl -d megaraid,1 -a /dev/sda
</syntaxhighlight>
</syntaxhighlight>


== Storcli Commands Summary<ref>https://docs.broadcom.com/doc/12352476</ref> ==
=== Direct Mode vs Persistent Mode ===
 
{| class="wikitable"
{| class="wikitable"
|+
! Mode
!Type
! Description
!Description
! Use Case
!Example
|-
|-
|System Commands
| Persistent (default)
|show system status
| device IDs 변경 가능, expanders에 적합
|storcli show
| 기본값
storcli show all
 
storcli show ctrlcount
 
storcli show help
 
storcli -v
|-
|-
|Controller Commands
| Direct
|show and set controller properties
| device IDs 고정, phy 번호와 일치
Syntax : 
| 직접 연결 디스크
|}


storcli /cx show <property>
<syntaxhighlight lang="bash">
# 현재 설정 확인
$ sudo storcli /c0 show directpdmapping


storcli /cx set <property>=<value>
# Direct Mode 활성화
$ sudo storcli /c0 set directpdmapping=on


where x is controller number
# Direct Mode 비활성화
|
$ sudo storcli /c0 set directpdmapping=off
* storcli /cx show
</syntaxhighlight>
* storcli /cx show all
* storcli /cx show freespace
*storcli /cx set rebuildrate=<value>
*storcli /cx show rebuildrate
|-
|Drive Commands
|information and perform actions related to physical drives
storcli /cx[/ex]/sx show


torcli /cx[/ex]/sx set properties
=== RAID 확장 ===


where,
<syntaxhighlight lang="bash">
# 기존 RAID5에 디스크 추가
$ sudo storcli /c0/v0 start migrate type=raid5 option=add drives=8:0
</syntaxhighlight>


* c specifies the controller #.
※ RAID 00, 10, 50, 60은 이 방식으로 확장 불가
* e specifies the enclosure ID.
* s represents the slot in the enclosure.
* e:s-x is the range convention used to represent slots s to x in the enclosure e.
|Sets physical drive properties


* missing: Sets the drive status as missing.
=== StorCLI 명령어 요약 ===
* good: Sets the drive status to unconfigured good.
* offline: Sets the drive status to offline.
* online: Sets the drive status to online.


Shows virtual drive information
{| class="wikitable"
 
! Type
* all: shows all properties of the physical drive
! Description
! Example
|-
|-
|Virtual Drives Commands
| System
|Creates/Delete/Set/Show virtual drives
| 시스템 상태 확인
|
| `storcli show`<br>`storcli show ctrlcount`<br>`storcli -v`
|-
|-
|Foreign Configurations Commands
| Controller
|commands to view, import, and delete foreign configurations:
| 컨트롤러 속성
|storcli /c0/fall show preview foreign
| `storcli /cx show`<br>`storcli /cx set rebuildrate=50`
storcli /c0/fall import preview
 
storcli /c0/fall show all
 
storcli /cx/fx|fall del|delete [ securitykey=ss... ]
storcli /cx/fx|fall import [preview][ securitykey=ss... ]
 
storcli /cx/fx|fall show [all] [ securitykey=ss... ]
|-
|-
|BIOS-Related Commands
| Drive
|
| 물리적 드라이브
|<nowiki>storcli /cx autobootselect(abs)=<on|off></nowiki>
| `storcli /cx/ex/sx show`<br>`storcli /cx/ex/sx set good`
storcli /cx set bios=<on|off>
 
storcli /cx set headlessafemode|hsm=<on/off>
 
storcli /cx set headlesscontinueonerror|hcoe=<on/off>
 
storcli /cx set stoponerror|soe=<on|off>
 
storcli /cx show bios
|-
|-
|OPROM BIOS Commands
| Virtual Drive
|
| 가상 드라이브
|<nowiki>storcli /cx/ex/sx set bootdrive=on|off</nowiki>
| `storcli /cx/vx show init`<br>`storcli /cx/vx start init full`
storcli /cx/vx set bootdrive=on|off
 
storcli /cx show bootdrive
|-
|-
|Drive Group Commands
| Consistency Check
|
| 일관성 검사
|storcli /cx/dall show
| `storcli /cx/vx start cc`<br>`storcli /cx/vx pause cc`
storcli /cx/dall show all
 
storcli /cx/dall show cachecade
|-
|-
|Dimmer Switch Commands
| Background Init
|Dimmer Switch is the power-saving policy for the virtual drive
| 백그라운드 초기화
|storcli/c0 show ds
| `storcli /cx/vx start bgi`<br>`storcli /cx/vx stop bgi`
storcli /cx/vx set ds=<default | auto | none | max | maxnocache>
|-
|-
|BBU Commands
| Foreign Config
|<u>Recent Versions of Storcli now use the /cv command instead of bbu</u><ref>https://support.siliconmechanics.com/portal/en/kb/articles/bbu-commands-for-storcli</ref>
| 외부 구성
$ sudo storcli /c0/cv show
| `storcli /c0/fall import`<br>`storcli /c0/fall delete`
 
|<u>Old version of storcli,</u> 
storcli /cx/bbu show
storcli /cx/bbu show all
 
storcli /cx/bbu set bbuMode=<value>
 
storcli /cx/bbu set learndelayinterval=<value>
 
storcli /cx/bbu set powermode=sleep
 
storcli /cx/bbu set writeaceess=sealed
 
storcli /cx/bbu show modes
 
storcli /cx/bbu show properties
 
storcli /cx/bbu show status
 
storcli /cx/bbu start learn
|-
|-
|Enclosure Commands
| BBU/CV
|shows the enclosure status and the status of all the enclosure elements
| 캐시 보호
|storcli /cx/ex download src=filepath[forceActivate]
| `storcli /cx/cv show all`<br>`storcli /cx/bbu show status`
storcli /cx/ex show all
 
storcli /cx/ex show status
|-
|-
|PHY Commands
| Hot Spare
|shows  PHY layer information, sets the PHY link speed
| 핫 스페어
|<nowiki>storcli /cx/px|pall set linkspeed=0(auto)|1.5|3|6|12</nowiki>
| `storcli /cx/ex/sx add hotsparedrive`<br>`storcli /cx/ex/sx delete hotsparedrive`
storcli /cx/px|pall show
|}


storcli /cx/px|pall show all
|-
|Logging Commands
|generate and maintain log files
|storcli /cx clear events
storcli /cx delete termlog


storcli /cx show events file=<absolute path>
== Configuration ==


storcli /cx show eventloginfo
<syntaxhighlight lang="bash">
# StorCLI 설치
$ sudo dpkg -i storcli_rel/Unified_storcli_all_os/Ubuntu/*.deb
$ sudo ln -s /opt/MegaRAID/storcli/storcli64 /usr/local/bin/storcli


storcli /cx show termlog type=config|contents
# RAID 구성
|}
$ sudo storcli /c0 add vd type=raid6 drives=0:0-5 name=DATA
{| class="wikitable"
|+Properties for Show and Set Commands
!Property Name
!Set Command Range
!Description
|-
|abortcconerror
|<nowiki>on|off</nowiki>
|Aborts consistency check when it detects an inconsistency.
|-
|activityforlocate
|<nowiki>on|off</nowiki>
|Enables/disables drive activity, drive activity locates function for systems without SGPIO/SES capabilities.
|-
|alarm
|<nowiki>on|off|silence</nowiki>
silence: Silences the alarm
|Enables/disables alarm on critical errors
|-
|backplane
|0: Use autodetect logic of backplanes,
such as SGPIO and I2C SEP using GPIO


pins.
# RAID 상태 확인
$ sudo storcli /c0/vall show


1: Disable autodetect SGPIO.
# 디스크 상태 확인
$ sudo storcli /c0/eall/sall show


2: Disable I2C SEP autodetect.
# 캐시 정책 설정
$ sudo storcli /c0/v0 set wrcache=wb
$ sudo storcli /c0/v0 set rdcache=nora
$ sudo storcli /c0/v0 set pdcache=on
</syntaxhighlight>


3: Disable both the autodetects.
|Configures enclosure detection on a non-SES/expander
backplane.
|-
|batterywarning
|<nowiki>on|off</nowiki>
|Enables/disables battery warnings
|-
|bgirate
|0 to 100
|Sets background initialization rate in percentage.
|-
|cacheflushint
|0 to 255, default value 4
|Sets cache flush interval in seconds
|-
|ccrate
|0 to 100
|Sets consistency check rate in percentage
|-
|coercion
|0: No coercion
1: 128 MB


2: 1 GB
== Examples ==
|Sets drive capacity in coercion mode
|-
|consistencycheck
|See  Consistency Check.
|See  Consistency Check.
|-
|copyback
|<nowiki>on|off</nowiki>
type = smartssd|smarthdd|all


smartssd: Copy back enabled for SSD
=== Example 1: RAID6 생성 및 마운트 ===


drives.
<syntaxhighlight lang="bash">
# RAID6 생성
$ sudo storcli /c0 add vd r6 name=RAID6 drives=0:0-5


smarthdd: Copy back enabled for HDD
# RAID6 확인
$ sudo storcli /c0/vall show


drives.
# 파티션 생성
$ sudo parted -s -a optimal /dev/sda mklabel gpt mkpart primary 0% 100%


all: Copy back enabled for both ssd
# 파일시스템 생성
$ sudo mkfs.ext4 /dev/sda1


drives and HDD drives.
# 마운트
$ sudo mount /dev/sda1 /mnt/data
</syntaxhighlight>


Example:
=== Example 2: 디스크 교체 ===


storcli /cx set copyback=on
<syntaxhighlight lang="bash">
# 실패한 디스크 확인
$ sudo storcli /c0/eall/sall show


type=all
# 디스크 교체
|Enables/disables copy back for drive types.
$ sudo storcli /c0/e8/s0 insert dg=0 array=0 row=0
|-
|directpdmapping
|<nowiki>on|off</nowiki>
|Enables/disables direct physical drive mapping. When
enclosures are used, this feature is disabled; otherwise it


should be enabled.
# 리빌드 시작
|-
$ sudo storcli /c0/e8/s0 start rebuild
|eccbucketleakrate
|0 to 65535
|Sets leak rate of the single-bit bucket in minutes (one
entry removed per leak-rate).
|-
|eccbucketsize
|0 to 255
|Sets size of ECC single-bit-error bucket (logs event
when full).
|-
|enableeghsp
|<nowiki>on|off</nowiki>
|Enables/disables the commissioning of otherwise
incompatible global hot spare drives as Emergency Hot


Spare (EHSP) drives
# 리빌드 진행률 확인
|-
$ sudo storcli /c0 show rebuild
|enableesmarter
</syntaxhighlight>
|<nowiki>on|off</nowiki>
|Enables/disables the commissioning of Emergency Hot
Spare (EHSP) drives for Predictive Failure (PFA) events.
|-
|enableeug
|<nowiki>on|off</nowiki>
|Enables/disables the commissioning of Unconfigured
Good drives as Emergency Hot Spare (EHSP) drives
|-
|exposeencldevice
|<nowiki>on|off</nowiki>
|Enables/disables device drivers to expose enclosure
devices; for example, expanders, SEPs
|-
|<nowiki>dimmerswitch|ds</nowiki>
|Todo Dimmer Switch Commands.
|Todo Dimmer Switch Commands.
|-
|foreignautoimport
|<nowiki>on|off</nowiki>
|Imports foreign configuration automatically, at boot.
|-
|jbod
|<nowiki>on|off</nowiki>
|Enables/disables JBOD mode; by default, drives become system drives.
'''NOTE Not supported by all controllers'''
|-
|loadbalancemode
|<nowiki>on|off</nowiki>
|Enables/disables automatic load balancing between SAS phys or ports in a wide port configuration
|-
|maintainpdfailhistory
|<nowiki>on|off</nowiki>
|Maintains the physical drive fail history
|-
|migraterate
|0 to 100
|Sets data migration rate in percentage
|-
|<nowiki>patrolread|pr</nowiki>
|Todo Patrol Read
|Todo Patrol Read
|-
|perfmode
|0: Tuned to provide best [[IOPS]], currently
applicable to non-FastPath


1: Tuned to provide least latency, currently


applicable to non-FastPath
== Best Practices ==
|Performance tuning setting for the controller
|-
|pi
|<nowiki>on|off</nowiki>
|Enables/disables data protection on the controller
|-
|preventpiimport
|<nowiki>on|off </nowiki>
|Enables/disables import data protection drives on the controller
|-
|prcorrectunconfiguredareas
|<nowiki>on|off </nowiki>
|Correct media errors during PR by writing 0s to unconfigured areas of the disk
|-
|prrate 
|0 to 100
|Sets patrol read rate of the virtual drives in percentage
|-
|rebuildrate
|0 to 100
|Sets rebuild rate of the drive in percentage
|-
|reconrate 
|0 to 100
|Sets reconstruction rate for a drive in percentage
|-
|restorehotspare 
|<nowiki>on|off</nowiki>
|Becomes a hot spare on insertion of a failed drive.
|-
|smartpollinterval 
|0 to 65535
|Set time for polling of SMART errors in seconds
|-
|spinupdrivecount
|0 to 255
|Sets number of drives that are spun up at a time
|-
|spinupdelay 
|0 to 255
|Sets spin-up delay between a group of drives or a set of drives, in seconds
|-
|stoponerror 
|<nowiki>on|off</nowiki>
|Stops the MegaRAID [[BIOS]] during POST, if any errors are
encountered
|-
|time
|Valid time in yymmdd hh:mm:ss format or systemtime
|Sets the controller time to your input value or the system
time (local time in 24-hour format)
|-
|usefdeonlyencrypt 
|<nowiki>on|off</nowiki>
|Enables/disables FDE drive-based encryption
|}


== Hot spare drives ==
* StorCLI는 항상 루트 권한으로 실행
A hot spare is an extra, unused drive that is part of the disk subsystem. It is usually in Standby mode, ready for service if a drive fails.
* Write Back + BBU/CacheVault 조합 사용 (성능 최적화)
* 핫 스페어 구성 (자동 복구)
* 정기적인 Consistency Check 실행
* Foreign Configuration 처리 (교체 서버 디스크)
* Direct Mode 활성화 (직접 연결 디스크)
* 디스크 직렬 번호 기록 (물리적 위치 추적)
* 정기적인 [[smartctl]] 모니터링


Hot spares let you replace failed drives without system shutdown or user intervention. The controller supports automatic and transparent rebuilds of failed drives using hot spare drives, which provide a high degree of fault tolerance and zero downtime.


The failed drive is removed from the virtual drive and marked ready awaiting removal after the rebuild to a hot spare begins. You can make hot spares of the drives that are not in a RAID virtual drive
== Limitations ==


=== Types of hot spare ===
* StorCLI는 MegaCLI와 명령어 호환 안됨
* RAID 00/10/50/60은 확장 불가
* Write Back은 BBU 필수 (데이터 손실 위험)
* StorCLI는 루트 권한 필요
* 일부 기능은 컨트롤러 모델에 따라 제한됨


* Global hot spare
* Dedicated hot spare


<syntaxhighlight lang="bash">
== References ==
create and delete hot spare drives


storcli /cx[/ex]/sx add hotsparedrive {dgs=<n|0,1,2...>}[enclaffinity][nonrevertible]
* https://docs.broadcom.com/doc/12352476
storcli /cx/[ex]/sx delete hotsparedrive
* https://www.broadcom.com/support/knowledgebase/1211161499760/


dgs - Valid drive group number
enclaffinity - Valid enclosure number, Specifies the enclosure with which the hot spare is
associated. If this option is specified, affinity is set; if it is not specified, there is no affinity.
</syntaxhighlight>** NOTE Affinity cannot be removed after it is set for a hot spare drive.<ref>https://docs.broadcom.com/doc/12352476</ref>


If the hot spare is designated as having enclosure affinity, it tries to rebuild any failed drives on the backplane in which it resides before rebuilding any other drives on other backplanes.
== Related Pages ==


== Direct mode / Persistent mode / Device IDs <ref>https://www.broadcom.com/support/knowledgebase/1211161503520/direct-mode---persistant-mode---device-ids-on-megaraid</ref> ==
* [[HBA/RAID controller]]
* [[Hardware RAID information on Linux]]
* [[RAID]]
* [[Storage]]
* [[BBU]]


* Persistent mode (directpdmapping=off)(the default) device IDs can change, and increment, or be different even on new controllers depending on what was connected during the LSI manufacturing process.  '''Persistent mode is good for expanders'''.
* Direct mode (directpdmapping=on) device IDs never change, and always match the phy number.
<syntaxhighlight lang="bash">
#To check the current setting:
syntax: storcli /cx show directpdmapping
example:  storcli /c0 show directpdmapping


#To enable direct PD mapping:
[[Category:Linux]]
syntax: storcli /cx set directpdmapping=on
== Knowledge Graph ==
example:  storcli /cx set directpdmapping=on


#To disable direct PD mapping:
Related
syntax: storcli /cx set directpdmapping=off
example:  storcli /cx set directpdmapping=off
</syntaxhighlight>


== References ==
→ [[Linux]]
<references />
→ [[Server]]
→ [[Hardware]]
→ [[Network]]


[[Category: storage]]
[[Category:Reference]]

Latest revision as of 11:30, 17 July 2026

Storcli

Template:Status

Template:TOC

Overview

StorCLI는 Broadcom(구 LSI/Avago) MegaRAID 컨트롤러를 관리하기 위한 명령줄 도구입니다. MegaCLI의 후속 버전으로, 더 향상된 기능과 호환성을 제공합니다.

Summary

  • 무엇인가? — MegaRAID 컨트롤러 관리 CLI 도구
  • 왜 필요한가? — RAID 구성, 모니터링, 성능 최적화
  • 언제 사용하는가? — 데이터센터 서버 RAID 관리


Purpose

이 문서가 존재하는 이유

  • Goal: StorCLI 설치, 명령어, RAID 구성, 모니터링 방법 제공
  • Scope: StorCLI 설치, 명령어 요약, RAID 생성/삭제/확장, 핫 스페어 관리
  • Non-goals: MegaCLI 레거시 명령어, 특정 OEM 펌웨어 설정은 별도 문서


Key Concepts

Concept Description Related
MegaRAID Broadcom RAID 컨트롤러 라인업 Storcli
Virtual Drive RAID로 구성된 논리 드라이브 Storcli
Physical Drive 실제 물리적 디스크 Storcli
Hot Spare 예비 디스크 — 자동 복구 Storcli
Write Policy Write Back/Through — 성능 vs 안전 Storcli
BBU/CacheVault 캐시 보호 장치 HBA/RAID controller
Direct Mode PD 매핑 고정 Storcli
Foreign Config 이전 서버 구성 이력 Storcli


Architecture

StorCLI는 MegaRAID 컨트롤러와 물리적 디스크 간 인터페이스입니다:

graph TD
    A[StorCLI] --> B[MegaRAID Controller]
    B --> C[Physical Drives]
    B --> D[Virtual Drives]
    B --> E[BBU/CacheVault]
    C --> F[HDD/SSD]
    D --> G[OS / Filesystem]
    E --> H[Cache Protection]


Workflow

Stage Input Output
Install .deb package storcli64 binary
Show storcli show Controller info
Create RAID storcli add vd Virtual Drive
Monitor storcli /c0/vall show RAID status
Replace Disk storcli /c0/e8/s0 start rebuild Rebuild in progress


Detailed Explanation

StorCLI 설치 (Ubuntu)

# 최신 버전 다운로드 (Broadcom 공식 URL)
# storcli_rel 폴더 생성
# Unified_storcli_all_os.zip 추출
# Ubuntu 폴더로 이동

# Debian 패키지 설치
$ sudo dpkg -i storcli_rel/Unified_storcli_all_os/Ubuntu/*.deb

# 설치 확인
$ dpkg -l | grep -i storcli

# 기본 설치 경로: /opt/MegaRAID/storcli/storcli64

# 심볼릭 링크 생성 (권장)
$ sudo ln -s /opt/MegaRAID/storcli/storcli64 /usr/local/bin/storcli

StorCLI vs MegaCLI

StorCLI는 MegaCLI의 후속 버전이지만, **명령어 구문이 호환되지 않습니다**. Broadcom의 크로스 레퍼런스 페이지에서 차이점을 확인할 수 있습니다.

StorCLI 명령어 사용

    • StorCLI는 루트 권한으로 실행해야 합니다.** (권한 없으면 에러 없이 실패)
# 권한 없이 실행 (실패)
$ storcli show
Number of Controllers = 0

# 권한 있고 실행 (성공)
$ sudo storcli show
Number of Controllers = 1

시스템 개요

$ sudo storcli show

System Overview :
===============
------------------------------------------------------------------------------------
Ctl Model                   Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS  EHS ASOs Hlth
------------------------------------------------------------------------------------
  0 AVAGOMegaRAIDSAS9361-8i     8   6   0     0   0     0 N/A On  1&2 Y      3 Opt
------------------------------------------------------------------------------------
    • 기호 설명:**
  • Ctl: Controller Index
  • DGs: Drive Groups
  • VDs: Virtual Drives
  • PDs: Physical Drives
  • Fld: Failed
  • DNOpt: Array NotOptimal
  • VNOpt: VD NotOptimal
  • Opt: Optimal
  • Msng: Missing
  • Dgd: Degraded
  • sPR: Scheduled Patrol Read
  • DS: DimmerSwitch
  • EHS: Emergency Spare Drive
  • Hlth: Health

RAID 생성

# RAID6 생성 (6개 HDD)
$ sudo storcli /c0 add vd r6 name=RAID6 drives=0:0-5

# RAID1 생성 (OS용)
$ sudo storcli /c0 add vd type=raid1 drives=0:0-1 name=OS

# RAID10 생성
$ sudo storcli /c0 add vd type=raid10 drives=0:0-3 name=RAID10

# RAID5 생성
$ sudo storcli /c0 add vd type=raid5 drives=0:0-5 name=RAID5
    • RAID 생성 옵션:**
  • `strip=<8|16|32|64|128|256|512|1024>` — 스트라이프 크기
  • `pdcache=on|off|default` — 물리적 드라이브 캐시
  • `wt|wb` — Write Through/Back
  • `nora|ra` — Read Ahead
  • `Spares=[e:]s|[e:]s-x` — 핫 스페어

RAID 삭제

# 가상 드라이브 삭제
$ sudo storcli /c0/v0 del

# 모든 가상 드라이브 삭제
$ sudo storcli /c0/vall del

디스크 캐시 정책

# 가상 드라이브 캐시 정책 설정
$ sudo storcli /c0/v0 set pdcache=on
$ sudo storcli /c0/v0 set rdcache=nora
$ sudo storcli /c0/v0 set wrcache=wb
    • LSI 권장사항:**
  • 모든 RAID 레벨 → Direct I/O 권장
  • RAID 0/1/10 (스트리밍) → Write Through 권장
  • RAID 0/1/10 (랜덤) → Write Back 권장
  • RAID 5/6 → Write Back 권장

Write Policy

Write Policy Description Recommendation
Write Back (WB) 컨트롤러 캐시에 데이터 수신 시 완료 신호 "bursty" 쓰기 환경에 효율적
Write Through (WT) 드라이브에 데이터 수신 시 완료 신호 RAID 0/1/10 스트리밍 데이터에 권장
Always Write Back (AWB) BBU 부재 시에도 Write Back 강제 BBU 필수 (데이터 손실 위험)

디스크 정보 확인

# 사용 가능한 디스크 확인
$ sudo storcli /c0/eall/sall show

# 출력 예시
# EID:Slt DID State DG      Size Intf Med SED PI SeSz Model            Sp Type
# 0:0       4 UGood -  10.913 TB SAS  HDD N   N  512B HUH721212AL5200  U  -
    • 디스크 상태:**
  • UGood: Unconfigured Good
  • GHS: Global Hot Spare
  • DHS: Dedicated Hot Spare
  • Onln: Online
  • Fld: Failed

Foreign Configuration 처리

# Foreign Configuration 삭제
$ sudo storcli /c0/fall delete

# Foreign Configuration 확인
$ sudo storcli /c0/fall show

핫 스페어 관리

Type Description Example
Global Hot Spare 모든 RAID 그룹에 자동 할당 `storcli /cx/ex/sx add hotsparedrive`
Dedicated Hot Spare 특정 RAID 그룹에 할당 `storcli /cx/ex/sx add hotsparedrive dgs=N`
Emergency Hot Spare SMART 오류 시 자동 할당 `storcli /cx set eghs eug=on`
    • 핫 스페어 제거:**
# 핫 스페어 상태 제거
$ sudo storcli /c0/e65/s11 delete hotsparedrive

# 디스크 오프라인
$ sudo storcli /c0/e65/s11 set offline

디스크 위치 찾기

# 디스크 깜빡이기 (물리적 위치 확인)
$ sudo storcli /c0/e0/s2 start locate

# 깜빡임 중지
$ sudo storcli /c0/e0/s2 stop locate

디스크 교체

# 실패한 디스크 교체
$ sudo storcli /c0/e8/s0 insert dg=0 array=0 row=0

# 수동 리빌드 시작
$ sudo storcli /c0/e8/s0 start rebuild

디스크 직렬 번호 확인

$ sudo storcli /c0/eALL/sALL show all | egrep 'Device attributes|SN = '

디스크 상태 확인 (smartctl)

# 디바이스 ID 확인
$ sudo storcli /c0/eall/sall show

# smartctl로 디스크 테스트
$ smartctl -d megaraid,1 -a /dev/sda

Direct Mode vs Persistent Mode

Mode Description Use Case
Persistent (default) device IDs 변경 가능, expanders에 적합 기본값
Direct device IDs 고정, phy 번호와 일치 직접 연결 디스크
# 현재 설정 확인
$ sudo storcli /c0 show directpdmapping

# Direct Mode 활성화
$ sudo storcli /c0 set directpdmapping=on

# Direct Mode 비활성화
$ sudo storcli /c0 set directpdmapping=off

RAID 확장

# 기존 RAID5에 디스크 추가
$ sudo storcli /c0/v0 start migrate type=raid5 option=add drives=8:0

※ RAID 00, 10, 50, 60은 이 방식으로 확장 불가

StorCLI 명령어 요약

Type Description Example
System 시스템 상태 확인 `storcli show`
`storcli show ctrlcount`
`storcli -v`
Controller 컨트롤러 속성 `storcli /cx show`
`storcli /cx set rebuildrate=50`
Drive 물리적 드라이브 `storcli /cx/ex/sx show`
`storcli /cx/ex/sx set good`
Virtual Drive 가상 드라이브 `storcli /cx/vx show init`
`storcli /cx/vx start init full`
Consistency Check 일관성 검사 `storcli /cx/vx start cc`
`storcli /cx/vx pause cc`
Background Init 백그라운드 초기화 `storcli /cx/vx start bgi`
`storcli /cx/vx stop bgi`
Foreign Config 외부 구성 `storcli /c0/fall import`
`storcli /c0/fall delete`
BBU/CV 캐시 보호 `storcli /cx/cv show all`
`storcli /cx/bbu show status`
Hot Spare 핫 스페어 `storcli /cx/ex/sx add hotsparedrive`
`storcli /cx/ex/sx delete hotsparedrive`


Configuration

# StorCLI 설치
$ sudo dpkg -i storcli_rel/Unified_storcli_all_os/Ubuntu/*.deb
$ sudo ln -s /opt/MegaRAID/storcli/storcli64 /usr/local/bin/storcli

# RAID 구성
$ sudo storcli /c0 add vd type=raid6 drives=0:0-5 name=DATA

# RAID 상태 확인
$ sudo storcli /c0/vall show

# 디스크 상태 확인
$ sudo storcli /c0/eall/sall show

# 캐시 정책 설정
$ sudo storcli /c0/v0 set wrcache=wb
$ sudo storcli /c0/v0 set rdcache=nora
$ sudo storcli /c0/v0 set pdcache=on


Examples

Example 1: RAID6 생성 및 마운트

# RAID6 생성
$ sudo storcli /c0 add vd r6 name=RAID6 drives=0:0-5

# RAID6 확인
$ sudo storcli /c0/vall show

# 파티션 생성
$ sudo parted -s -a optimal /dev/sda mklabel gpt mkpart primary 0% 100%

# 파일시스템 생성
$ sudo mkfs.ext4 /dev/sda1

# 마운트
$ sudo mount /dev/sda1 /mnt/data

Example 2: 디스크 교체

# 실패한 디스크 확인
$ sudo storcli /c0/eall/sall show

# 디스크 교체
$ sudo storcli /c0/e8/s0 insert dg=0 array=0 row=0

# 리빌드 시작
$ sudo storcli /c0/e8/s0 start rebuild

# 리빌드 진행률 확인
$ sudo storcli /c0 show rebuild


Best Practices

  • StorCLI는 항상 루트 권한으로 실행
  • Write Back + BBU/CacheVault 조합 사용 (성능 최적화)
  • 핫 스페어 구성 (자동 복구)
  • 정기적인 Consistency Check 실행
  • Foreign Configuration 처리 (교체 서버 디스크)
  • Direct Mode 활성화 (직접 연결 디스크)
  • 디스크 직렬 번호 기록 (물리적 위치 추적)
  • 정기적인 smartctl 모니터링


Limitations

  • StorCLI는 MegaCLI와 명령어 호환 안됨
  • RAID 00/10/50/60은 확장 불가
  • Write Back은 BBU 필수 (데이터 손실 위험)
  • StorCLI는 루트 권한 필요
  • 일부 기능은 컨트롤러 모델에 따라 제한됨


References


Related Pages

Knowledge Graph

Related

LinuxServerHardwareNetwork