MegaCli命令
MegaCli -LDInfo -Lall -aall执行结果
[root@kylin ~]# MegaCli -LDInfo -Lall -aall Adapter 0 -- Virtual Drive Information: Virtual Drive: 0 (Target Id: 0) Name : RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3 Size : 1.089 TB Sector Size : 512 Is VD emulated : No Parity Size : 558.406 GB State : Optimal Strip Size : 256 KB Number Of Drives : 3 Span Depth : 1 Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU Default Access Policy: Read/Write Current Access Policy: Read/Write Disk Cache Policy : Enabled Encryption Type : None Bad Blocks Exist: No Is VD Cached: No Virtual Drive: 1 (Target Id: 1) Name : RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0 Size : 1.089 TB Sector Size : 512 Is VD emulated : No Mirror Data : 1.089 TB State : Optimal Strip Size : 256 KB Number Of Drives per span:2 Span Depth : 2 Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU Default Access Policy: Read/Write Current Access Policy: Read/Write Disk Cache Policy : Enabled Encryption Type : None Bad Blocks Exist: No Is VD Cached: No Virtual Drive: 2 (Target Id: 2) Name : RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3 Size : 1.089 TB Sector Size : 512 Is VD emulated : No Parity Size : 558.406 GB State : Optimal Strip Size : 256 KB Number Of Drives : 3 Span Depth : 1 Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU Current Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBU Default Access Policy: Read/Write Current Access Policy: Read/Write Disk Cache Policy : Enabled Encryption Type : None Bad Blocks Exist: No Is VD Cached: No Exit Code: 0x00storcli命令
storcli /call /vall show执行结果
[root@kylin ~]# storcli /call /vall show Controller = 0 Status = Success Description = None Virtual Drives : ============== -------------------------------------------------------------- DG/VD TYPE State Access Consist Cache Cac sCC Size Name -------------------------------------------------------------- 0/0 RAID5 Optl RW No RAWBC - ON 1.089 TB 2/1 RAID10 Optl RW No RAWBC - ON 1.089 TB 1/2 RAID5 Optl RW No RAWBC - ON 1.089 TB -------------------------------------------------------------- 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=ConsistentR=Read Ahead Always|NR=No Read Ahead|WB=WriteBack| AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled Check Consistency需要关注的是,storcli命令执行结果里的DG/VD。 1. DG编号对应的应该是硬RAID创建的先后顺序,这是一个关键信息,因为后面设置热备盘的时候需要用到。 2. VD编号是和硬RAID在操作系统里对应的盘符的关键信息。
MegaCli命令执行结果无法查看到DG,如”Virtual Drive: 2 (Target Id: 2)”中,对应的2为VD编号。
硬RAID设置热备盘分为两种: 1. 全局热备。 2. 针对某个VD的热备。
热备盘设置命令:
MegaCli -PDHSP {-Set [-Dedicated [-ArrayN|-Array0,1,2...]] [-EnclAffinity] [-nonRevertible]} |-Rmv -PhysDrv[E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL全局热备:GHSP 全局热备比较简单,将要设置热备的磁盘加到对应的adapter就可以,执行如下命令设置:
MegaCli -PDHSP -Set -PhysDrv[14:1] -a0局部热备:(Dedicated HSP)
MegaCli -PDHSP -Set -Dedicated -Array2 -PhysDrv[14:1] -a0局部热备里的Array计算比较麻烦,这里就要用到上面提到的DG,要按DG的排序累加,一直累加到要添加热备的VD(要添加热备的VD也要计算)。 1. 默认设Array为-1。 2. 如果是RAID0,1,5,6,则Array加1。 3. 如果是RAID10,50,则Array加2。 4. 如果是RAID0,1,5,6,则返回Array最后计算的值。 5. 如果是RAID10,50,则返回Array-1,Array。
[root@kylin ~]# ls -al /dev/disk/by-path/ 总用量 0 drwxr-xr-x 2 root root 100 4月 20 18:45 . drwxr-xr-x 5 root root 100 4月 20 18:41 .. lrwxrwxrwx 1 root root 9 4月 20 18:41 platform-40000000.pcie-controller-pci-0000:11:00.0-scsi-0:2:0:0 -> ../../sdb lrwxrwxrwx 1 root root 9 4月 20 18:45 platform-40000000.pcie-controller-pci-0000:11:00.0-scsi-0:2:1:0 -> ../../sdc lrwxrwxrwx 1 root root 9 4月 20 18:41 platform-40000000.pcie-controller-pci-0000:11:00.0-scsi-0:2:2:0 -> ../../sdd