hotspare raidz

hotspare raidz实用命令1.显示Rebuid进度/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -physdrv[20:2] -aALL2.查看E S/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll -NoLog

实用命令

1.显示Rebuid进度

/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -physdrv[20:2] -aALL

2.查看E S

/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll -NoLog | grep -Ei “(enclosure|slot)”

3.查看所有硬盘的状态

/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll -NoLog

4.查看所有Virtual Disk的状态

/opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo -aAll -NoLog

RAID Level对应关系:

RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0 RAID 1

RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0 RAID 0

RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3 RAID 5

RAID Level : Primary-1, Secondary-3, RAID Level Qualifier-0 RAID 10

5.在线做Raid

/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0[0:11] WB NORA Direct CachedBadBBU -strpsz64 -a0 -NoLog/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [12:2,12:3,12:4,12:5,12:6,12:7] WB Direct -a0

6.点亮指定硬盘(定位)

/opt/MegaRAID/MegaCli/MegaCli64 -PdLocate -start -physdrv[252:2] -a0

7.清除Foreign状态

/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Clear -a0

8.查看RAID阵列中掉线的盘

/opt/MegaRAID/MegaCli/MegaCli64 -pdgetmissing -a0

9.替换坏掉的模块

/opt/MegaRAID/MegaCli/MegaCli64 -pdreplacemissing -physdrv[12:10] -Array5 -row0 -a0

10.手动开启rebuid

/opt/MegaRAID/MegaCli/MegaCli64 -pdrbld -start -physdrv[12:10] -a0

11.查看Megacli的log

/opt/MegaRAID/MegaCli/MegaCli64 -FwTermLog dsply -a0 > adp2.log

12.设置HotSpare

/opt/MegaRAID/MegaCli/MegaCli64 -pdhsp -set [-Dedicated [-Array2]] [-EnclAffinity] [-nonRevertible] -PhysDrv[4:11] -a0/opt/MegaRAID/MegaCli/MegaCli64 -pdhsp -set [-EnclAffinity] [-nonRevertible] -PhysDrv[32:1}] -a0

13.关闭Rebuild

/opt/MegaRAID/MegaCli/MegaCli64 -AdpAutoRbld -Dsbl -a0

14.设置rebuild的速率

/opt/MegaRAID/MegaCli/MegaCli64 -AdpSetProp RebuildRate -30 -a0

实用脚本

1.用于查看各个磁盘的状态,并高亮的megacli脚本

/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll -NoLog| grep -Ei ‘(enclosure|slot|error|firmware|pre|Foreign|^PD type|^Raw Size)’ | awk ‘{if($0 ~ /Slot Number/ || $0 ~ /Enclosure/){printf(“\033[32m%s “,$0);if($0 ~/Slot Number/) printf(“\033[0m \n”)}else if($0 ~ /bad/||$0 ~/Failed/||$0 ~ /Foreign State: Foreign/){print “\033[31m”$0″\033[0m”}else{print “\033[33m”$0″\033[0m”}}’

2.用于查看各个RAID Logical Disk的Megacli脚本

/opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo -aAll -NoLog|grep -Ei ‘(^Virtual Disk|^RAID Level|^PD type|^Raw Size|^Enclosure|^Slot|error|firmware)’ | awk ‘{if($0~/^Virtual/||$0~/^RAID/){printf(“\033[35m%s\033[0m\n”,$0)}else if($0 ~ /^Enclosure/){printf(“\033[31m%s: %s\033[0m “,$1,$4)}else if($0 ~ /^Slot/){printf(“\033[31m%s\033[0m\n”,$0)}else if($0~/^Other/||$0~/Firmware/){printf(“\033[33m%s\033[0m\n”,$0)}else if($0~/^Raw/){printf(“\033[33m%s%s\033[0m\n”,$2,$3)}else{printf(“\033[33m%s\033[0m “,$0)}}’

对于RAID Level的输出,参考下表,以对应相关的RAID级别

RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0 RAID 1

RAID Level : Primary-0, Secondary-0, RAID Level Qualifier-0 RAID 0

RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3 RAID 5

RAID Level : Primary-1, Secondary-3, RAID Level Qualifier-0 RAID 10

2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/15661.html

(0)
上一篇 2024年 5月 19日
下一篇 2024年 5月 19日

相关推荐

关注微信