LSI MegaCli 创建 Raid10
确认硬件环境
在真正开始工作前, 我们需要确定当前环境是否支持 MegaCli
, 使用 lspci
查看设备信息以及使用的驱动信息
# lspci -k |grep MegaRAID -A10
01:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS-3 3108 [Invader] (rev 02)
Subsystem: Super Micro Computer Inc Device 0809
Kernel driver in use: megaraid_sas
Kernel modules: megaraid_sas
可以看到内核使用的megaraid_sas驱动, 设备为 LSI Logic / Symbios Logic MegaRAID SAS-3 3108
查找到 Adapter 编号
# MegaCli Adpallinfo -aall | grep '^Adapter'
Adapter #0
这里Adapter的编号为0, 后续我们要使用该值, 用于定位使用哪个Adapter.
Enclosure Device ID
和 Slot Number
查找到物理硬盘的 # MegaCli64 -PDlist -aall | grep -e '^Enclosure Device ID:' -e '^Slot Number:'
Enclosure Device ID: 252
Slot Number: 0
Enclosure Device ID: 252
Slot Number: 1
Enclosure Device ID: 252
Slot Number: 2
Enclosure Device ID: 252
Slot Number: 3
这里的 Enclosure Device ID
为252, 可用的Slot Number
为 [0-3].
创建 Raid10
MegaCli创建Raid10的格式为:
MegaCli -CfgSpanAdd -r10 -Array0[E:S,E:S] -Array1[E:S,E:S] -aN
- N 为 Adapter ID
- E 为 Enclosure Device ID
- S 为 Slot Number
带入上面我们查询到的信息:
MegaCli -CfgSpanAdd -R10 -Array0[252:0,252:2] -Array1[252:1,252:3] -a0
-Array0[252:0,252:2]
构建一个Raid0-Array1[252:1,252:3]
构建一个Raid1
检查创建的逻辑卷设备
MegaCli64 -LDInfo -LALL -aAll