Storcli: Difference between revisions
Jump to navigation
Jump to search
(Fix: remove --- horizontal lines (12 removed)) |
|||
| (19 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
= Storcli = | |||
{{Status | |||
|status=Draft | |||
|owner=Knowledge Agent | |||
|last_update=2026-07-15 | |||
|review=Pending | |||
}} | |||
{{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 == | ||
{| 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]] | |||
|} | |||
== Architecture == | |||
StorCLI는 MegaRAID 컨트롤러와 물리적 디스크 간 인터페이스입니다: | |||
<syntaxhighlight lang="mermaid"> | |||
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] | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== Workflow == | |||
{| class="wikitable" | {| 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 | |||
|} | |} | ||
== Detailed Explanation == | |||
==== | |||
=== | === StorCLI 설치 (Ubuntu) === | ||
<syntaxhighlight lang="bash"> | |||
# 최신 버전 다운로드 (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 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === StorCLI vs MegaCLI === | ||
StorCLI는 MegaCLI의 후속 버전이지만, **명령어 구문이 호환되지 않습니다**. Broadcom의 크로스 레퍼런스 페이지에서 차이점을 확인할 수 있습니다. | |||
=== StorCLI 명령어 사용 === | |||
====== | |||
**StorCLI는 루트 권한으로 실행해야 합니다.** (권한 없으면 에러 없이 실패) | |||
# | <syntaxhighlight lang="bash"> | ||
$ | # 권한 없이 실행 (실패) | ||
$ storcli show | |||
Number of Controllers = 0 | |||
# | # 권한 있고 실행 (성공) | ||
$ sudo | $ sudo storcli show | ||
Number of Controllers = 1 | |||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === 시스템 개요 === | ||
$ sudo storcli | <syntaxhighlight lang="bash"> | ||
$ 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 | |||
------------------------------------------------------------------------------------ | |||
</syntaxhighlight> | </syntaxhighlight> | ||
**기호 설명:** | |||
* 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 생성 === | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
# RAID6 생성 (6개 HDD) | |||
$ sudo storcli /c0 add vd r6 name=RAID6 drives=0:0-5 | |||
storcli /c0 | # 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 | |||
</syntaxhighlight> | |||
**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 삭제 === | |||
<syntaxhighlight lang="bash"> | |||
# 가상 드라이브 삭제 | |||
$ sudo storcli /c0/v0 del | |||
# 모든 가상 드라이브 삭제 | |||
storcli /c0/ | $ sudo storcli /c0/vall del | ||
</syntaxhighlight> | |||
=== 디스크 캐시 정책 === | |||
<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> | ||
**LSI 권장사항:** | |||
* 모든 RAID 레벨 → Direct I/O 권장 | |||
* RAID 0/1/10 (스트리밍) → Write Through 권장 | |||
* RAID 0/1/10 (랜덤) → Write Back 권장 | |||
* RAID 5/6 → Write Back 권장 | |||
=== Write Policy === | |||
{| class="wikitable" | {| class="wikitable" | ||
! Write Policy | |||
! | ! Description | ||
!Description | ! Recommendation | ||
! | |||
|- | |- | ||
| | | Write Back (WB) | ||
| | | 컨트롤러 캐시에 데이터 수신 시 완료 신호 | ||
| | | "bursty" 쓰기 환경에 효율적 | ||
|- | |||
| Write Through (WT) | |||
| 드라이브에 데이터 수신 시 완료 신호 | |||
| RAID 0/1/10 스트리밍 데이터에 권장 | |||
|- | |||
| Always Write Back (AWB) | |||
| BBU 부재 시에도 Write Back 강제 | |||
| BBU 필수 (데이터 손실 위험) | |||
|} | |||
=== 디스크 정보 확인 === | |||
storcli show | <syntaxhighlight lang="bash"> | ||
# 사용 가능한 디스크 확인 | |||
$ 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 - | |||
</syntaxhighlight> | |||
**디스크 상태:** | |||
* UGood: Unconfigured Good | |||
* GHS: Global Hot Spare | |||
* DHS: Dedicated Hot Spare | |||
* Onln: Online | |||
* Fld: Failed | |||
=== Foreign Configuration 처리 === | |||
<syntaxhighlight lang="bash"> | |||
# Foreign Configuration 삭제 | |||
$ sudo storcli /c0/fall delete | |||
storcli / | # Foreign Configuration 확인 | ||
$ sudo storcli /c0/fall show | |||
</syntaxhighlight> | |||
=== 핫 스페어 관리 === | |||
storcli /cx | {| class="wikitable" | ||
! Type | |||
storcli /cx | ! 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 | | `storcli /cx set eghs eug=on` | ||
|} | |||
**핫 스페어 제거:** | |||
<syntaxhighlight lang="bash"> | |||
# 핫 스페어 상태 제거 | |||
$ sudo storcli /c0/e65/s11 delete hotsparedrive | |||
# 디스크 오프라인 | |||
$ sudo storcli /c0/e65/s11 set offline | |||
</syntaxhighlight> | |||
=== 디스크 위치 찾기 === | |||
<syntaxhighlight lang="bash"> | |||
# 디스크 깜빡이기 (물리적 위치 확인) | |||
$ sudo storcli /c0/e0/s2 start locate | |||
# 깜빡임 중지 | |||
$ sudo storcli /c0/e0/s2 stop locate | |||
</syntaxhighlight> | |||
=== 디스크 교체 === | |||
storcli / | <syntaxhighlight lang="bash"> | ||
# 실패한 디스크 교체 | |||
$ sudo storcli /c0/e8/s0 insert dg=0 array=0 row=0 | |||
storcli / | # 수동 리빌드 시작 | ||
$ sudo storcli /c0/e8/s0 start rebuild | |||
</syntaxhighlight> | |||
=== 디스크 직렬 번호 확인 === | |||
storcli / | <syntaxhighlight lang="bash"> | ||
$ sudo storcli /c0/eALL/sALL show all | egrep 'Device attributes|SN = ' | |||
</syntaxhighlight> | |||
=== 디스크 상태 확인 (smartctl) === | |||
storcli / | <syntaxhighlight lang="bash"> | ||
# 디바이스 ID 확인 | |||
$ sudo storcli /c0/eall/sall show | |||
# smartctl로 디스크 테스트 | |||
$ smartctl -d megaraid,1 -a /dev/sda | |||
</syntaxhighlight> | |||
=== Direct Mode vs Persistent Mode === | |||
{| class="wikitable" | |||
! Mode | |||
! Description | |||
! Use Case | |||
|- | |- | ||
| | | Persistent (default) | ||
| | | device IDs 변경 가능, expanders에 적합 | ||
| 기본값 | |||
|- | |- | ||
| | | Direct | ||
| | | device IDs 고정, phy 번호와 일치 | ||
| | | 직접 연결 디스크 | ||
| | |} | ||
<syntaxhighlight lang="bash"> | |||
# 현재 설정 확인 | |||
$ sudo storcli /c0 show directpdmapping | |||
storcli / | # Direct Mode 활성화 | ||
$ sudo storcli /c0 set directpdmapping=on | |||
storcli / | # Direct Mode 비활성화 | ||
$ sudo storcli /c0 set directpdmapping=off | |||
</syntaxhighlight> | |||
=== RAID 확장 === | |||
storcli / | <syntaxhighlight lang="bash"> | ||
# 기존 RAID5에 디스크 추가 | |||
$ sudo storcli /c0/v0 start migrate type=raid5 option=add drives=8:0 | |||
</syntaxhighlight> | |||
※ RAID 00, 10, 50, 60은 이 방식으로 확장 불가 | |||
=== StorCLI 명령어 요약 === | |||
{| class="wikitable" | |||
! Type | |||
! Description | |||
! Example | |||
|- | |- | ||
| | | System | ||
|storcli | | 시스템 상태 확인 | ||
storcli | | `storcli show`<br>`storcli show ctrlcount`<br>`storcli -v` | ||
|- | |- | ||
| | | Controller | ||
| | | 컨트롤러 속성 | ||
|storcli / | | `storcli /cx show`<br>`storcli /cx set rebuildrate=50` | ||
storcli /cx | |||
|- | |- | ||
| | | Drive | ||
| | | 물리적 드라이브 | ||
| | | `storcli /cx/ex/sx show`<br>`storcli /cx/ex/sx set good` | ||
storcli /cx | |||
|- | |- | ||
| | | Virtual Drive | ||
| | | 가상 드라이브 | ||
| | | `storcli /cx/vx show init`<br>`storcli /cx/vx start init full` | ||
storcli /cx/vx | |||
|- | |- | ||
| | | Consistency Check | ||
| | | 일관성 검사 | ||
|storcli /cx/ | | `storcli /cx/vx start cc`<br>`storcli /cx/vx pause cc` | ||
storcli /cx/ | |||
|- | |- | ||
| | | Background Init | ||
| | | 백그라운드 초기화 | ||
|storcli/ | | `storcli /cx/vx start bgi`<br>`storcli /cx/vx stop bgi` | ||
storcli /cx/vx | |||
|- | |- | ||
| | | Foreign Config | ||
| | | 외부 구성 | ||
| `storcli /c0/fall import`<br>`storcli /c0/fall delete` | |||
|- | |- | ||
| | | BBU/CV | ||
| | | 캐시 보호 | ||
|storcli /cx/ | | `storcli /cx/cv show all`<br>`storcli /cx/bbu show status` | ||
storcli /cx/ | |||
|- | |- | ||
| | | Hot Spare | ||
| | | 핫 스페어 | ||
| | | `storcli /cx/ex/sx add hotsparedrive`<br>`storcli /cx/ex/sx delete hotsparedrive` | ||
storcli /cx/ | |} | ||
== Configuration == | |||
storcli / | <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 / | # 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 | |||
</syntaxhighlight> | |||
== Examples == | |||
=== Example 1: RAID6 생성 및 마운트 === | |||
drives | <syntaxhighlight lang="bash"> | ||
# 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 | |||
</syntaxhighlight> | |||
Example: | === Example 2: 디스크 교체 === | ||
storcli / | <syntaxhighlight lang="bash"> | ||
# 실패한 디스크 확인 | |||
$ 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 | |||
</syntaxhighlight> | |||
== 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 == | |||
* https://docs.broadcom.com/doc/12352476 | |||
* https://www.broadcom.com/support/knowledgebase/1211161499760/ | |||
== Related Pages == | |||
* [[HBA/RAID controller]] | |||
* [[Hardware RAID information on Linux]] | |||
* [[RAID]] | |||
* [[Storage]] | |||
* [[BBU]] | |||
[[Category:Linux]] | |||
== Knowledge Graph == | |||
Related | |||
→ [[Linux]] | |||
→ [[Server]] | |||
→ [[Hardware]] | |||
→ [[Network]] | |||
[[Category: | [[Category:Reference]] | ||
Latest revision as of 11:30, 17 July 2026
Storcli
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
- https://docs.broadcom.com/doc/12352476
- https://www.broadcom.com/support/knowledgebase/1211161499760/
Related Pages
Knowledge Graph
Related