드레스룸 시스템행거 인테리어

lsi storcil - 사용법

2020. 7. 9. 16:56
반응형

lsi 3108 storcli 사용법

 

오늘은 또 raid에 대하여 써 보도록 하겠다.

 

raid는 webbios (<-링크)에서 설정하는 게 가장 안전하고 쉽다..

하지만 서비스가 실행중인 서버를 끄는 게 쉽지는 않기 때문에 os상에서 raid 구성 변경을 해야 하는 경우가 많다.

오늘은 LSI에서 제공하는 storcli 툴에 대하여 몇 가지만 살펴보겠다.

 

 

(base) root@ubuntu:~# rpm -ivh storcli-1.23.02-1.noarch.rpm --nodeps

rpm파일을 다운로드한 후 rpm을 설치하게 되면

/opt/MegaRAID/storcli 폴더가 생성된다.

 

List of commands:

Commands   Description
-------------------------------------------------------------------
add        Adds/creates a new element to controller like VD,Spare..etc
delete     Deletes an element like VD,Spare
show       Displays information about an element
set        Set a particular value to a property
get        Get a particular value to a property
compare    Compares particular value to a property
start      Start background operation
stop       Stop background operation
pause      Pause background operation
resume     Resume background operation
download   Downloads file to given device
expand     expands size of given drive
insert     inserts new drive for missing
transform  downgrades the controller
/cx        Controller specific commands
/ex        Enclosure specific commands
/sx        Slot/PD specific commands
/vx        Virtual drive specific commands
/dx        Disk group specific commands
/fall      Foreign configuration specific commands
/px        Phy specific commands
/[bbu|cv]  Battery Backup Unit, Cachevault commands
/jbodx      JBOD drive specific commands

Other aliases : cachecade, freespace, sysinfo

Use a combination of commands to filter the output of help further.
E.g. 'storcli cx show help' displays all the show operations on cx.
Use verbose for detailed description E.g. 'storcli add  verbose help'
Use 'page=[x]' as the last option in all the commands to set the page break.
X=lines per page. E.g. 'storcli help page=10'
Use J as the last option to print the command output in JSON format
Command options must be entered in the same order as displayed in the help of
the respective commands.
(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 show
Generating detailed summary of the adapter, it may take a while to complete.

Controller = 0
Status = Success
Description = None

Product Name = AVAGO 3108 MegaRAID
Serial Number = FW-AKWETI6AARBWA
SAS Address =  500304802349aa02
PCI Address = 00:17:00:00
System Time = 07/09/2020 01:10:52
Mfg. Date = 00/00/00
Controller Time = 07/09/2020 05:10:52
FW Package Build = 24.21.0-0100
BIOS Version = 6.36.00.3_4.19.08.00_0x06180203
FW Version = 4.680.00-8465
Driver Name = megaraid_sas
Driver Version = 07.703.05.00-rc1
Current Personality = RAID-Mode
Vendor Id = 0x1000
Device Id = 0x5D
SubVendor Id = 0x15D9
SubDevice Id = 0x809
Host Interface = PCI-E
Device Interface = SATA-3G
Bus Number = 23
Device Number = 0
Function Number = 0
Drive Groups = 1

TOPOLOGY :
========

----------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type  State BT      Size PDC  PI SED DS3  FSpace TR
----------------------------------------------------------------------------
 0 -   -   -        -   RAID1 Optl  N  465.25 GB dflt N  N   dflt N      N
 0 0   -   -        -   RAID1 Optl  N  465.25 GB dflt N  N   dflt N      N
 0 0   0   252:0    1   DRIVE Onln  N  465.25 GB dflt N  N   dflt -      N
 0 0   1   252:1    0   DRIVE Onln  N  465.25 GB dflt N  N   dflt -      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

Virtual Drives = 1

VD LIST :
=======

--------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache Cac sCC      Size Name
--------------------------------------------------------------
0/0   RAID1 Optl  RW     No      RAWBD -   ON  465.25 GB data
--------------------------------------------------------------

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|Dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
Consist=Consistent|R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency

Physical Drives = 2

PD LIST :
=======

-------------------------------------------------------------------------------
EID:Slt DID State DG      Size Intf Med SED PI SeSz Model              Sp Type
-------------------------------------------------------------------------------
252:0     1 Onln   0 465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
252:1     0 Onln   0 465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 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​

 

위에 커맨드 리스트에 자세히 설명이 나왔지만.

찬찬히 다시 봐보자~

./storcli64 /c0 show

/c0 - raid contorller 0번 을 뜻한다.

보통 1개를 사용하지만 bandwidth가 중요한 업체나 특별한 경우에 2개 이상 사용하는 경우 c1 c2 이런 식으로 표기된다.

show - c0 컨트롤러의 모든 정보를 볼 수 있다.

 

 

/v0 - virtual drives 0 vd가 더 많다면 역시 /v1 /v2가 표기된다.

/c0 show로 하게 되면 너무 많은 정보가 나오기 때문에 특정 vd를 보기 위해 사용한다.

 

 

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 /v0 show
Controller = 0
Status = Success
Description = None


Virtual Drives :
==============

--------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache Cac sCC      Size Name
--------------------------------------------------------------
0/0   RAID1 Optl  RW     No      RAWBD -   ON  465.25 GB data
--------------------------------------------------------------

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|Dgrd=Degraded
Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|TRANS=TransportReady|B=Blocked|
Consist=Consistent|R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|
AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled
Check Consistency


(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 /v0 delete
Controller = 0
Status = Success
Description = Delete VD succeeded

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 /v0 show
Controller = 0
Status = Failure
Description = None

Detailed Status :
===============

----------------------------------
VD Status ErrCd ErrMsg
----------------------------------
 0 Failed   255 Invalid Vd number
----------------------------------

 

이전 글에서 raid 1을 잡아 놓은 게 그대로 있다.

먼저 삭제를 먼저 해보기 위해 /v0 delete 옵션을 사용 후 vd가 사라진 걸 확인할 수 있다.

 

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 show
Generating detailed summary of the adapter, it may take a while to complete.

..
..

PD LIST :
=======

-------------------------------------------------------------------------------
EID:Slt DID State DG      Size Intf Med SED PI SeSz Model              Sp Type
-------------------------------------------------------------------------------
252:0     1 UGood -  465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
252:1     0 UGood -  465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
-------------------------------------------------------------------------------

 

controller를 show로 보아도 vd list는 사라진 상태이다.

자 이제 다시 cli 통해서 raid 구성을 해보겠다.

 

 

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 add vd r1 drives=252:0-1
Controller = 0
Status = Success
Description = Add VD Succeeded
(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 show
..
..
TOPOLOGY :
========

----------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type  State BT      Size PDC  PI SED DS3  FSpace TR
----------------------------------------------------------------------------
 0 -   -   -        -   RAID1 Optl  N  465.25 GB dflt N  N   dflt N      N
 0 0   -   -        -   RAID1 Optl  N  465.25 GB dflt N  N   dflt N      N
 0 0   0   252:0    1   DRIVE Onln  N  465.25 GB dflt N  N   dflt -      N
 0 0   1   252:1    0   DRIVE Onln  N  465.25 GB dflt N  N   dflt -      N
----------------------------------------------------------------------------
..

Virtual Drives = 1

VD LIST :
=======

--------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache Cac sCC      Size Name
--------------------------------------------------------------
0/0   RAID1 Optl  RW     No      RWTD  -   ON  465.25 GB
--------------------------------------------------------------



Physical Drives = 2

PD LIST :
=======

-------------------------------------------------------------------------------
EID:Slt DID State DG      Size Intf Med SED PI SeSz Model              Sp Type
-------------------------------------------------------------------------------
252:0     1 Onln   0 465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
252:1     0 Onln   0 465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
-------------------------------------------------------------------------------

 

 

구성이 잘 됐다.

디스크 하나를 빼서 장애를 만들어 보자!!!

 

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 show

..
..


TOPOLOGY :
========

----------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type  State BT      Size PDC  PI SED DS3  FSpace TR
----------------------------------------------------------------------------
 0 -   -   -        -   RAID1 Dgrd  N  465.25 GB dflt N  N   dflt N      N
 0 0   -   -        -   RAID1 Dgrd  N  465.25 GB dflt N  N   dflt N      N
 0 0   0   -        -   DRIVE Msng  -  465.25 GB -    -  -   -    -      N
 0 0   1   252:1    0   DRIVE Onln  N  465.25 GB dflt N  N   dflt -      N
----------------------------------------------------------------------------



Missing Drives Count = 1

Missing Drives :
==============

--------------------
Array Row      Size
--------------------
    0   0 465.25 GB
--------------------

Virtual Drives = 1

VD LIST :
=======

--------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache Cac sCC      Size Name
--------------------------------------------------------------
0/0   RAID1 Dgrd  RW     No      RWTD  -   ON  465.25 GB
--------------------------------------------------------------


Physical Drives = 1

PD LIST :
=======

-------------------------------------------------------------------------------
EID:Slt DID State DG      Size Intf Med SED PI SeSz Model              Sp Type
-------------------------------------------------------------------------------
252:1     0 Onln   0 465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
-------------------------------------------------------------------------------



 

위와 같이 PD List도 디스크 하나 가 표기된다.

VD List도 확인해보면 state가 Dgrd - degraded상태에 빠져버렸다.

더 위에 topology를 보아도 252:0번이 msng - missing으로 디스크가 빠져 있다고 나온다.

자 이제 장애를 극복해보자~!

 

다시 디스크를 장착 후

TOPOLOGY :
========

----------------------------------------------------------------------------
DG Arr Row EID:Slot DID Type  State BT      Size PDC  PI SED DS3  FSpace TR
----------------------------------------------------------------------------
 0 -   -   -        -   RAID1 Dgrd  N  465.25 GB dflt N  N   dflt N      N
 0 0   -   -        -   RAID1 Dgrd  N  465.25 GB dflt N  N   dflt N      N
 0 0   0   -        -   DRIVE Msng  -  465.25 GB -    -  -   -    -      N
 0 0   1   252:1    0   DRIVE Onln  N  465.25 GB dflt N  N   dflt -      N
----------------------------------------------------------------------------


Missing Drives Count = 1

Missing Drives :
==============

--------------------
Array Row      Size
--------------------
    0   0 465.25 GB
--------------------

Virtual Drives = 1

VD LIST :
=======

--------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache Cac sCC      Size Name
--------------------------------------------------------------
0/0   RAID1 Dgrd  RW     No      RWTD  -   ON  465.25 GB
--------------------------------------------------------------


Physical Drives = 2

PD LIST :
=======

-------------------------------------------------------------------------------
EID:Slt DID State DG      Size Intf Med SED PI SeSz Model              Sp Type
-------------------------------------------------------------------------------
252:0     1 UBad  -  465.25 GB SATA HDD N   N  512B -                  U  -
252:1     0 Onln  0  465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
-------------------------------------------------------------------------------

 

PD List에 state가 UBad - unconfigured bad 상태가 되었다.

 

 

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 /e252/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 Type
-------------------------------------------------------------------------------
252:1     0 Onln   0 465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
-------------------------------------------------------------------------------



(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 /e252/s0 show
Controller = 0
Status = Failure
Description = Show Drive Information Failed.

Detailed Status :
===============

---------------------------------
Drive       Status  ErrCd ErrMsg
---------------------------------
/c0/e252/s0 Failure    46 -
---------------------------------



Drive Information :
=================

------------------------------------------------------------------
EID:Slt DID State DG      Size Intf Med SED PI SeSz Model Sp Type
------------------------------------------------------------------
252:0     1 UBad  -  465.25 GB SATA HDD N   N  512B -     U  -
------------------------------------------------------------------



(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 /e252/s0 set good
Controller = 0
Status = Success
Description = Set Drive Good Succeeded.

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 /e252/s0 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 Type
-------------------------------------------------------------------------------
252:0     1 UGood F  465.25 GB SATA HDD N   N  512B TOSHIBA DT01ACA050 U  -
-------------------------------------------------------------------------------

 

일단 slot 0 상태를 good으로 만들어 줘야 한다

 

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0 set autorebuild=on
Controller = 0
Status = Success
Description = None


Controller Properties :
=====================

------------------
Ctrl_Prop   Value
------------------
AutoRebuild ON
------------------

 

그 이후에 autrebuild on으로 해 두면 자동으로 rebuild가 된다. 

현재 test용 디스크가 좀 이상해서 하도 여러 가지를 눌렀더니 좀 애매하게 되긴 했는데.

./storcli64 help를 치면 할 수 있는 모든 옵션이 나온다.

 

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0/e252/s0 show rebuild
Controller = 0
Status = Success
Description = Show Drive Rebuild Status Succeeded.


------------------------------------------------------
Drive-ID    Progress% Status      Estimated Time Left
------------------------------------------------------
/c0/e252/s0         2 In progress 51 Minutes
------------------------------------------------------

(base) root@ubuntu:/opt/MegaRAID/storcli# ./storcli64 /c0/e252/s0 show rebuild
Controller = 0
Status = Success
Description = Show Drive Rebuild Status Succeeded.


------------------------------------------------------
Drive-ID    Progress% Status      Estimated Time Left
------------------------------------------------------
/c0/e252/s0         9 In progress 49 Minutes
------------------------------------------------------

 

현재 rebuild 상태도 확인이 가능하다~!

반응형

이 글을 공유합시다

facebook twitter kakaoTalk kakaostory naver band