1、簡介 MegaCli 是LSI公司官方提供的SCSI卡管理工具,由於LSI被收購變成了現在的Broadcom,所以現在想下載MegaCli, 需要去Broadcom官網查找Legacy產品支持,搜索MegaRAID即可。 現在官方有storcli,storcli已經基本代替了megacli,整合 ...
1、簡介 MegaCli 是LSI公司官方提供的SCSI卡管理工具,由於LSI被收購變成了現在的Broadcom,所以現在想下載MegaCli, 需要去Broadcom官網查找Legacy產品支持,搜索MegaRAID即可。 現在官方有storcli,storcli已經基本代替了megacli,整合了LSI和3ware所有產品。 安裝方面比較簡單,megacli還要Lib_Utils的支持,而storcli只用一個rpm包就可以下載, 去Broadcom官網去找就行了:https://www.broadcom.com/site-search?q=storcli storcli支持json格式輸出,信息解析更加方便。 我個人推薦使用這個軟體,因為megacli 工具需要安裝額外的軟體包,有些伺服器客戶不允許安裝其他的軟體包,所以比較麻煩。 這個工具直接安裝了之後就可以用。 1.1伺服器信息: 1.2系統信息: [root@localhost storcli]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.4 (Santiago) 1.3 安裝storcli rpm -ivh storcli-1.03.11-1.noarch.rpm 目錄: /opt/Mega/storcli 註意版本問題 我這台伺服器是DELL R720xd,2012年上線的,所以我用的是storcli.1.03.11版本。 我用的新版本安裝之後,執行命令沒有輸出,所以這一點需要註意。 1.4一些參數定義: /cx = Controller ID /vx = Virtual Drive Number. /ex = Enclosure ID /sx = Slot ID 1.5為了管理方便,建立軟連接 ln -s /opt/MegaRAID/storcli/storcli64 /bin/storcli ln -s /opt/MegaRAID/storcli/storcli64 /sbin/storcli 如果不想建立軟連接,就在/opt/MegaRAID/storcli 目錄下 執行./storcli64 指令 2、查看當前設備raid控制器相關信息 [root@localhost storcli]# ./storcli64 show all 可以看到只有一個控制器 Status Code = 0 Status = Success Description = None Number of Controllers = 1 Host Name = localhost.localdomain Operating System = Linux2.6.32-358.el6.x86_64 System Overview : =============== ------------------------------------------------------------ Ctl Model Ports PDs DGs DNOpt VDs VNOpt BBU sPR DS EHS ASOs ------------------------------------------------------------ 0 Mini 8 14 3 0 3 0 Opt On 3 N 0 【只看到一個控制器】 ------------------------------------------------------------ Ctl=Controller Index|DGs=Drive groups|VDs=Virtual drives|Fld=Failed PDs=Physical drives|DNOpt=DG NotOptimal|VNOpt=VD NotOptimal|Opt=Optimal Msng=Missing|Dgd=Degraded|NdAtn=Need Attention|Unkwn=Unknown sPR=Scheduled Patrol Read|DS=DimmerSwitch|EHS=Emergency Hot Spare Y=Yes|N=No|ASOs=Advanced Software Options|BBU=Battery backup unit ASO : === ---- Ctl ---- 0 ---- Cl=Cluster|MD=Max Disks|WC=Wide Cache|SS=Safe Store|FP=Fast Path|Re=Recovery CR=CacheCade(Read)|RF=Reduced Feature Set|CO=Cache Offload CW=CacheCade(Read/Write)|X=Not Available/Not Installed|U=Unlimited|T=Trial 3、查看控制器c0的相關信息 [root@localhost storcli]# ./storcli64 /c0 show Controller = 0 Status = Success Description = None Product Name = PERC H710P Mini【控制器型號】 Serial Number = 26300UP SAS Address = 5d4ae520a6bcbc00 Mfg. Date = 06/04/12 System Time = 05/22/2019 16:22:28 Controller Time = 05/22/2019 08:22:28 FW Package Build = 21.0.2-0001 BIOS Version = 5.30.00_4.12.05.00_0x05110000 FW Version = 3.130.05-1587 Driver Name = megaraid_sas Driver Version = 06.504.01.00-rh1 Controller Bus Type = N/A PCI Slot = N/A PCI Bus Number = 2 PCI Device Number = 0 PCI Function Number = 0 Drive Groups = 3 TOPOLOGY : ======== -------------------------------------------------------------------------- DG Arr Row EID:Slot DID Type State BT Size PDC PI SED DS3 FSpace -------------------------------------------------------------------------- 0 - - - - RAID1 Optl N 278.875 GB dflt N N dflt N 0 0 - - - RAID1 Optl N 278.875 GB dflt N N dflt N 0 0 0 32:24 24 DRIVE Onln N 278.875 GB dflt N N dflt - 0 0 1 32:25 25 DRIVE Onln N 278.875 GB dflt N N dflt - 1 - - - - RAID5 Optl N 4.089 TB dflt N N dflt N 1 0 - - - RAID5 Optl N 4.089 TB dflt N N dflt N 1 0 0 32:0 0 DRIVE Onln N 837.75 GB dflt N N dflt - 1 0 1 32:1 1 DRIVE Onln N 837.75 GB dflt N N dflt - 1 0 2 32:2 2 DRIVE Onln N 837.75 GB dflt N N dflt - 1 0 3 32:3 3 DRIVE Onln N 837.75 GB dflt N N dflt - 1 0 4 32:4 4 DRIVE Onln N 837.75 GB dflt N N dflt - 1 0 5 32:5 5 DRIVE Onln N 837.75 GB dflt N N dflt - 2 - - - - RAID5 Optl N 4.089 TB dflt N N dflt N 2 0 - - - RAID5 Optl N 4.089 TB dflt N N dflt N 2 0 0 32:6 6 DRIVE Onln N 837.75 GB dflt N N dflt - 2 0 1 32:7 7 DRIVE Onln N 837.75 GB dflt N N dflt - 2 0 2 32:8 8 DRIVE Onln N 837.75 GB dflt N N dflt - 2 0 3 32:9 9 DRIVE Onln N 837.75 GB dflt N N dflt - 2 0 4 32:10 10 DRIVE Onln N 837.75 GB dflt N N dflt - 2 0 5 32:11 11 DRIVE Onln N 837.75 GB dflt N N dflt - 【可以看到伺服器有幾個RAID,每個RAID的級別和成員盤】 -------------------------------------------------------------------------- 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 Virtual Drives = 3【伺服器有三個RAID,兩個RAID5一個RAID1】 VD LIST : ======= --------------------------------------------------------------- DG/VD TYPE State Access Consist Cache Cac sCC Size Name --------------------------------------------------------------- 0/0 RAID1 Optl RW Yes RaWBD R OFF 278.875 GB 1/1 RAID5 Optl RW Yes RaWBD R OFF 4.089 TB 2/2 RAID5 Optl RW Yes RaWBD R OFF 4.089 TB --------------------------------------------------------------- Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded Optl=Optimal|RO=Read Only|RW=Read Write|B=Blocked|Consist=Consistent| Ra=Read Ahead Adaptive|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 = 14【十四個物理磁碟】 PD LIST : ======= ------------------------------------------------------------------------- EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp ------------------------------------------------------------------------- 32:0 0 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:1 1 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:2 2 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:3 3 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:4 4 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:5 5 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:6 6 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:7 7 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:8 8 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:9 9 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:10 10 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:11 11 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:24 24 Onln 0 278.875 GB SAS HDD N N 512B ST9300603SS U 32:25 25 Onln 0 278.875 GB SAS HDD N N 512B ST9300605SS 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 BBU_Info : ======== ------------------------------------------------------------ Model State RetentionTime Temp Mode MfgDate Next Learn ------------------------------------------------------------ BBU Optimal 0 hour(s) 30C 0 2011/07/18 None ------------------------------------------------------------ 4、獲取enclosure信息 硬碟大多是附在enclosure上不是直接附在controller上。 顯示所有的enclosure信息,但是系統中只有一個enclosure ,EID:32. [root@localhost storcli]# ./storcli64 /c0/eall show Controller = 0 Status = Success Description = None Properties : ========== ----------------------------------------------------------------------------- EID State Slots PD PS Fans TSs Alms SIM Port# ProdID VendorSpecific ----------------------------------------------------------------------------- 32 OK 26 14 0 0 0 0 0 Unavailable BP12G+EXP ----------------------------------------------------------------------------- EID-Enclosure Device ID |PD-Physical drive count |PS-Power Supply count| TSs-Temperature sensor count |Alms-Alarm count |SIM-SIM Count 獲取單個enclosure ,e32詳細信息 [root@localhost storcli]# ./storcli64 /c0/e32 show all Controller = 0 Status = Success Description = None Enclosure /c0/e32 : ================== Information : =========== Device ID = 32 Position = 1 Connector Name = Unavailable Enclosure Type = SES Status = OK FRU Part Number = N/A Enclosure Serial Number = N/A ESM Serial Number = N/A Enclosure Zoning Mode = N/A Partner Device ID = 65535 Inquiry Data : ============ Vendor Identification = DP Product Identification = BP12G+EXP Product Revision Level = 1.07 Properties : ========== ----------------------------------------------------------------------------- EID State Slots PD PS Fans TSs Alms SIM Port# ProdID VendorSpecific ----------------------------------------------------------------------------- 32 OK 26 14 0 0 0 0 0 Unavailable BP12G+EXP ----------------------------------------------------------------------------- EID-Enclosure Device ID |PD-Physical drive count |PS-Power Supply count| TSs-Temperature sensor count |Alms-Alarm count |SIM-SIM Count 5、顯示物理磁碟信息 語法:storcli64 /cx/eall/sall show 顯示所有物理磁碟信息 [root@localhost storcli]# ./storcli64 /c0/e32/sall show 【顯示e32上的所有物理硬碟】 [root@localhost storcli]# ./storcli64 /c0/eall/sall show【顯示所有enclosure下的所有物理硬碟】 Controller = 0 Status = Success Description = Show Drive Information Succeeded. Drive Information : ================= ------------------------------------------------------------------------- EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp ------------------------------------------------------------------------- 32:0 0 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:1 1 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:2 2 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:3 3 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:4 4 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:5 5 Onln 1 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:6 6 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:7 7 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:8 8 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:9 9 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:10 10 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:11 11 Onln 2 837.75 GB SAS HDD N N 512B WD9001BKHG U 32:24 24 Onln 0 278.875 GB SAS HDD N N 512B ST9300603SS U 32:25 25 Onln 0 278.875 GB SAS HDD N N 512B ST9300605SS U ------------------------------------------------------------------------- EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare【表示有熱備盤,DHS專有熱備,GHS全局熱備】 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 從上面信息,可以看出:
- 只有一個控制器,id 為 0
- EID,Enclosure Device ID :32
- Slot Number,能看到 0,1,2,3,4,5,6,7,8,9,10,11,24,25
- DG:disk group,0,1,2
- size:容量,磁碟容量
- intf:介面,SAS
- Med:介質,ssd 或 hdd