본문 바로가기

넋두리/linux 이야기

MegaRaid 사용 방법(기본)

1) 물리적 디스크(Physical Drive, PD) 정보
./MegaCli -PDList -aALL

… 생략 …
Enclosure Device ID: 32
Slot Number: 3
Enclosure position: 0
Device Id: 3
Sequence Number: 2 <– slot 번호
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0
PD Type: SAS
Raw Size: 136.732 GB [0x11177328 Sectors]
… 생략 …
Inquiry Data: SEAGATE ST9146852SS ___생략___ <– Disk 벤더명, 제품명과 시리얼번호(생략 부분)가 표시된다.
… 생략 …
Drive Temperature :27C (80.60 F) <– 온도
… 생략 …

2) 논리적 디스크(Logical Drive, LD) 정보
./MegaCli -LDInfo -Lall -aALL
… 생략 …
RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3 <– RAID5
Size : 408.375 GB
State : Optimal
Strip Size : 64 KB
Number Of Drives : 4 <– Disk 4개를 RAID5로 묶음
Span Depth : 1
Default Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
Current Cache Policy: WriteBack, ReadAheadNone, Direct, No Write Cache if Bad BBU
… 생략 …
위 Cache Policy 부분에서 캐시 정책을 표시한다.
- ‘WriteBack’은 캐시에 저장되면 전송 완료 신호를 보낸다.
만약 전원 공급이 갑자기 중단되면 RAID의 배터리(BBU)가 캐시 내용을 유지시켜준다. (BBU의 정보 확인방법은 뒤에서 설명)
- ‘WriteThrough’은 디스크에 저장되면 전송 완료 신호를 보낸다.

MegaCli는 결과를 화면에도 출력하는 것 외에 현재 디렉토리에 로그파일로도 남긴다.
로그가 남지 않도록 하려면 -NoLog옵션(대소문자 구별 없음)을 추가하면 된다. 개인적으로 -NoLog 옵션을 사용중이다.
옵션은 대소문자를 구분하지 않는다. -LDInfo 와 -ldinfo는 같다.

3) 물리적, 논리적 디스크 정보 확인
./MegaCli -LDPDInfo -aALL

4) 이벤트 로그를 확인
./MegaCli -AdpEventLog -GetEvents -f raid_event.log -aALL

raid_event.log를 살펴보면 된다.

5) Enclosure 정보
./MegaCli -EncInfo -aALL
… 생략 …
Enclosure 0:
Device ID : 32
Number of Slots : 6 <– Disk를 장착할 수 있는 slot이 6개
Number of Power Supplies : 0
Number of Fans : 0
Number of Temperature Sensors : 0
Number of Alarms : 0
Number of SIM Modules : 0
Number of Physical Drives : 4 <– 6개 중에 4개 Disk가 장착됨
… 생략 …

6) Adapter 정보
./MegaCli -AdpAllInfo -aALL

7) 간단한 요약 정보 (Controller 정보, PD(Physical Drive), VD(Virtual Drive) 정도 등)
./MegaCli -ShowSummary -aALL

8) Battery Backup Unit(BBU) 정보
./MegaCli -AdpBbuCmd -aALL

* MegaCLI 결과 예
* 간단한 MegaCLI 스크립트 내려받기

3. 에러 파악하기

./MegaCli -PDList -aALL 명령으로 물리적 디스크 정보를 살펴본다. Media Error Count, Other Error Count, Predictive Failure Count, Last Predictive Failure Event Seq Number 등의 수치가 0보다 크다면, 해당 디스크에 문제가 있을 가능성이 높으니 교체하기 바란다.

(예 1)
Slot Number: 0 <– slot 번호. 이 slot번호를 확인해뒀다가 교체하면 된다.
Enclosure position: 0
Device Id: 0
Sequence Number: 2
Media Error Count: 155 <– 0보다 크다.
Other Error Count: 0
Predictive Failure Count: 0
Last Predictive Failure Event Seq Number: 0

(예 2)
Slot Number: 3
Enclosure position: 0
Device Id: 3
Sequence Number: 2
Media Error Count: 58098 <– 0보다 크다.
Other Error Count: 0
Predictive Failure Count: 524 <– 0보다 크다.
Last Predictive Failure Event Seq Number: 75013 <– 0보다 크다.

4. 참고 자료

* DELL PERC5/i Integrated (LSI Logic MegaRAID)

http://tools.rapidsoft.de/perc/perc-cheat-sheet.html

* MegaCli -h 옵션