在Linux系统下进行raid操作:

Raid卡常用命令
在Linux系统下进行raid操作:
主要用于一台Linux服务器硬盘扩容,后插入几块新的硬盘来做raid1或raid5

  1. 常用命令

#查看硬盘信息
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL
#查坏盘
/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL | grep “Firmware state”
#查raid级别
/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL
#查看一个raid由哪些盘组成
/opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo -aALL|more

#闪亮3槽位灯:
/opt/MegaRAID/MegaCli/MegaCli64 -PDLocate -start -physdrv[32:3] -a0
#关闪3槽位灯:
/opt/MegaRAID/MegaCli/MegaCli64 -PDLocate -stop -physdrv[32:3] -a0

#查看系统里有哪些raid组
/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL

#删除raid组1,小心操作
/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L1 -A0
注:L1的1为RIAD组 Target Id 号,L0通常装的系统不能删

#检查新硬盘是否存在foreign key
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Scan -aALL
#清除foreign key
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Clear -aALL

查看和清除 raid的 cache ,重建raid时可能需要
/opt/MegaRAID/MegaCli/MegaCli64 -GetPreservedCacheList -aALL
/opt/MegaRAID/MegaCli/MegaCli64 -DiscardPreservedCache -L7 -aall

#创建raid5
/opt/MegaRAID/MegaCli/MegaCli64 CfgLDAdd -r5 [32:4,32:5,32:6,32:7] -strpsz256 -A0
注:-strpsz 条带大小,raid卡默认即可,DellR730默认是64。华为RH288v3默认是256
32是 Enclosure Device ID:

外来盘导入完整的raid信息
/opt/MegaRAID/MegaCli/MegaCli64 -CfgForeign -Import -aall

参考:
https://segmentfault.com/a/1190000008780600
https://zhuanlan.zhihu.com/p/358739776?utm_id=0
http://www.cnweed.com/archives/4303/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值