MegaCli和storcli设置热备盘

MegaCli和storcli设置热备盘

查看已创建的VD

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: 0x00

storcli命令

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 420 18:45 .
drwxr-xr-x 5 root root 100 420 18:41 ..
lrwxrwxrwx 1 root root   9 420 18:41 platform-40000000.pcie-controller-pci-0000:11:00.0-scsi-0:2:0:0 -> ../../sdb
lrwxrwxrwx 1 root root   9 420 18:45 platform-40000000.pcie-controller-pci-0000:11:00.0-scsi-0:2:1:0 -> ../../sdc
lrwxrwxrwx 1 root root   9 420 18:41 platform-40000000.pcie-controller-pci-0000:11:00.0-scsi-0:2:2:0 -> ../../sdd

在系统内查找和VD对应的磁盘

[root@kylin ~]# lspci
00:00.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01)
00:01.0 PCI bridge: Synopsys, Inc. Device abcd (rev 02)
00:02.0 PCI bridge: Synopsys, Inc. Device abcd (rev 01)
00:03.0 PCI bridge: Synopsys, Inc. Device abcd (rev 02)
01:00.0 PCI bridge: PLX Technology, Inc. Device 8725 (rev ca)
01:00.1 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.2 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.3 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
01:00.4 System peripheral: PLX Technology, Inc. Device 87d0 (rev ca)
02:01.0 PCI bridge: PLX Technology, Inc. Device 8725 (rev ca)
02:02.0 PCI bridge: PLX Technology, Inc. Device 8725 (rev ca)
02:08.0 PCI bridge: PLX Technology, Inc. Device 8725 (rev ca)
02:09.0 PCI bridge: PLX Technology, Inc. Device 8725 (rev ca)
02:0a.0 PCI bridge: PLX Technology, Inc. Device 8725 (rev ca)
02:0b.0 PCI bridge: PLX Technology, Inc. Device 8725 (rev ca)
02:0c.0 PCI bridge: PLX Technology, Inc. Device 8725 (rev ca)
03:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
03:00.1 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02)
04:00.0 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)
04:00.1 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)
04:00.2 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)
04:00.3 Ethernet controller: Intel Corporation 82580 Gigabit Network Connection (rev 01)
08:00.0 USB controller: Renesas Technology Corp. uPD720201 USB 3.0 Host Controller (rev 03)
09:00.0 SATA controller: Marvell Technology Group Ltd. Device 9215 (rev 11)
0a:00.0 Serial Attached SCSI controller: LSI Logic / Symbios Logic SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] (rev 03)
0c:00.0 PCI bridge: PLX Technology, Inc. Device 8748 (rev ca)
0d:01.0 PCI bridge: PLX Technology, Inc. Device 8748 (rev ca)
0d:08.0 PCI bridge: PLX Technology, Inc. Device 8748 (rev ca)
0d:09.0 PCI bridge: PLX Technology, Inc. Device 8748 (rev ca)
0d:10.0 PCI bridge: PLX Technology, Inc. Device 8748 (rev ca)
0d:11.0 PCI bridge: PLX Technology, Inc. Device 8748 (rev ca)
11:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 2108 [Liberator] (rev 05)
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值