megacli02 - meetbill/op_practice_book GitHub Wiki
raid0 热插拔(开机状态下拔盘,开机状态下插入)
简介
将一块硬盘做成单盘raid0,服务器运行状态下拔掉硬盘,然后将硬盘插入
操作环境
raid卡:LSIMegaRAIDSAS9271-8i
操作步骤
首先用fdisk看看能否看到硬盘,看不到,然后用MegaCli64看物理盘是否存在
通过以下命令看到物理硬盘是在的,但状态是Foreign
执行状态检测命令:
[root@meetbill ~]# /opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall |grep 'Firmware state'
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Unconfigured(bad), Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
通过命令查看显示Unconfigured(bad)的硬盘
[root@meetbill ~]# /opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall
[...]
Enclosure Device ID: 14
Slot Number: 11
Enclosure position: 1
Device Id: 24
WWN: 500003960b88265c
Sequence Number: 6
Media Error Count: 0
Other Error Count: 0
Predictive Failure Count: 0
[...]
Firmware state: Unconfigured(bad)
[...]
确定是磁盘 ![14:11] ([enclosureid:slotnumber]) 为 'Unconfigured(bad)'状态。
需要将硬盘状态设置为Unconfigured(good)
#/opt/MegaRAID/MegaCli/MegaCli64 -PDMakeGood -PhysDrv[14:11] -a0
Adapter: 0: EnclId-14 SlotId-11 state changed to Unconfigured-Good.
进行下导入配置
[root@meetbill ~]# /opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Import -aall
Foreign configuration is imported on controller 0.
Exit Code: 0x00
再次执行状态检测命令:
[root@meetbill ~]# /opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall |grep 'Firmware state'
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up
Firmware state: Online, Spun Up