|
本帖最后由 yonlee 于 2018-6-22 10:57 编辑
官方指导 https://wiki.hetzner.de/index.php/LSI_RAID_Controller/en
在Rescue模式下
连接ssh
查看已有raid信息
[ol]megacli -LDInfo -Lall -Aall[/ol]复制代码
示例 RAID 1:
[ol]Adapter 0 -- Virtual Drive Information:Virtual Disk: 0 (Target Id: 0)Name:RAID Level: Primary-1, Secondary-0, RAID Level Qualifier-0Size:697.560 GBState: OptimalStripe Size: 64 KBNumber Of Drives:2Span Depth:1Default Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBUCurrent Cache Policy: WriteBack, ReadAhead, Cached, Write Cache OK if Bad BBUAccess Policy: Read/WriteDisk Cache Policy: EnabledEncryption Type: NoneExit Code: 0x00[/ol]复制代码
设置raid
查看 Enclosure Number 和 Slot Number
[ol]megacli -PDList -aAll | egrep "Enclosure Device ID:|Slot Number:|Inquiry Data:|Error Count:|state"[/ol]复制代码
注意,如果你的status是"Unconfigured (bad)",请使用以下命令(我没用过)
[ol]megacli -PDMakeGood -PhysDrv[:] -a0[/ol]复制代码
清除已有设置
删除逻辑分区
[ol]megacli -CfgLdDel -Lall -aAll[/ol]复制代码
或,删除所有(我用的这个)
[ol]megacli -CfgClr -aAll[/ol]复制代码
设置raid0
[ol]megacli -CfgLdAdd -r0 [:,:] WB RA Direct CachedBadBBU -a0[/ol]复制代码
磁盘1的 Enclosure Number
磁盘1的 Slot Number
设置raid1
[ol]megacli -CfgLdAdd -r1 [:,:] WB RA Direct CachedBadBBU -a0[/ol]复制代码
我买的是一块300gSAS,两块3T盘,我的设置是这样的
[ol]megacli -CfgLdAdd -r0 [252:2] WB RA Direct CachedBadBBU -a0[/ol]复制代码[ol]megacli -CfgLdAdd -r0 [252:0,252:1] WB RA Direct CachedBadBBU -a1[/ol]复制代码
设置可启动阵列
我不确定这个是做什么的,反正我设置了,dd正常
查看可启动阵列,可启动阵列不存在
[ol]root@rescue ~ # megacli -AdpBootDrive -get -a0Adapter 0: No Virtual drive or Physical Drive is configured as boot drive.Exit Code: 0x00[/ol]复制代码
设置a0位为可启动阵列
[ol]root@rescue ~ # megacli -AdpBootDrive -set -L0 -a0Boot Virtual Drive is set to #0 (target id #0) on Adapter 0Exit Code: 0x00[/ol]复制代码 |
|