sas2ircu、sas3ircu、MegaCli64、hpssacli 阵列卡工具使用

sas2ircu/sas3ircu 工具,适用于HUAWEI、Quanta、Inpur等品牌

sas2ircu -h    查看帮助信息
sas2ircu list    查看所有RAID控制器信息
sas2ircu 0 display    查看第一块RAID控制器、物理磁盘、逻辑磁盘等详细信息,0代表RAID卡编号,如果有多块RAID卡,那么从0开始编号,以此类推;如果只有一块RAID卡,那么就是0。
sas2ircu 0 status    查看第一块RAID控制器所有逻辑磁盘信息
sas2ircu 0 delete noprompt    删除第一块RAID控制器上所有RAID配置
sas2ircu 0 create raid 1 max 2:0 2:1 noprompt    在第一块RAID控制器上将第一块与第二块物理磁盘配置为RAID1,分配最大使用空间。
sas2ircu 0 create raid10 max 2:2 2:3 2:4 2:5 2:6 2:7 2:8 2:9 2:10 2:11 noprompt    在第一块RAID控制器上将第三块到第十二块物理磁盘配置为RAID10,分配最大使用空间。
sas2ircu 0 bootir 286    设置Volume ID号为286的RAID组为预先可引导模式
sas2ircu 0 hotspare 2:10    配置第11块物理硬盘为热备
sas2ircu 0 hotspare delete 2:10    删除热备硬盘
sas2ircu 0 logir    上传或清除日志信息

MegaCli64工具,适用于DELL 、LENOVO品牌

#查看对应的逻辑卷编号
/opt/MegaRAID/MegaCli/MegaCli64 -ldpdinfo -aall | egrep "(Virtual Drive|Inquiry Data)"
#删raid
for i in {1..7};do /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L"$i" -a0;done
#确认一下物理盘的槽位slot number以及对应磁盘的型号
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0|egrep "(Slot Number|Inquiry Data)"
#Enclosure Device ID
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0 | grep 'Enclosure Device ID' 
#查看raid信息
/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -LALL -aAll | grep RAID
MegaCli64 raid对应关系
[‘Primary-0, Secondary-0, RAID Level Qualifier-0’] = RAID-0
[‘Primary-1, Secondary-0, RAID Level Qualifier-0’] = RAID-1
[‘Primary-5, Secondary-0, RAID Level Qualifier-3’] = RAID-5
[‘Primary-6, Secondary-0, RAID Level Qualifier-3’] = RAID-6
[‘Primary-1, Secondary-3, RAID Level Qualifier-0’] = RAID-10

#重新识别新替换硬盘(硬盘为foreign状态)å
dmidecode -t 1    #查看机器型号
查看硬盘状态
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0|egrep 'Slot Number|Firmware state'
/opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0|grep "Enclosure Device"
/opt/MegaRAID/MegaCli/MegaCli64 -pdmakegood -physdrv [32:3] -force -a0 (处于JBOD状态的硬盘)
#raid0-单盘
/opt/MegaRAID/MegaCli/MegaCli64 -Cfgldadd -r0[32:8] -wb -a0(处于unconfigured good状态的硬盘需要执行此命令)
/opt/MegaRAID/MegaCli/MegaCli64 -Cfgldadd -r0[0:8,0:9,0:10,0:11] -wb -cached -a0  #多盘

下线指定硬盘的命令格式
/opt/MegaRAID/MegaCli/MegaCli64 -pdoffline -phys[enc:slot] -a0
#做raid10
/opt/MegaRAID/MegaCli/MegaCli64 -cfgldadd -r10[117:0,117:1,117:2,117:3] -wb -ra -cached -cachedbadbbu -force -a0
#查看sn号
smartctl -a /dev/sdi|grep Serial     #SN号
#确认slot
/opt/MegaRAID/MegaCli/MegaCli64 -pdlist -a0 |grep "SN号" -A4 -B30      


报错
The specified physical disk does not have the appropriate attributes to complete 
the requested command

# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0      
There are 1 foreign configuration(s) on controller 0.
清除外来配置:
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -clear -a0
Foreign configuration 0 is cleared on controller 0.
# /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0 
There is no foreign configuration on controller 0.

hpssacli工具,适用于HP品牌

hpssacli ctrl all show config detail 查看物理盘详细信息
hpssacli ctrl all show status 查看raid卡信息(包括控制器状态、Cache状态、电池状态)
hpssacli ctrl slot=0 show config detail 查看raid详细信息
hpssacli ctrl slot=0 ld all show  查看raid状态
hpssacli ctrl slot=0 pd all show status  查看物理硬盘状态
hpssacli ctrl slot=0 pd all show  查看物理硬盘
hpssacli ctrl slot=0 array A ld all show  查看slot 0 阵列A 所有逻辑驱动器信息
hpssacli ctrl slot=0 array A pd all show 查看slot 0 阵列A 所有物理驱动器信息
hpssacli ctrl slot=0 create type=ld drives=all raid=0    所有磁盘创建raid0
hpssacli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:5,2I:1:6 raid=1+0 创建raid10
hpssacli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:5 raid=5 用3,4,5号盘创建一个raid5阵列
hpssacli ctrl slot=1 create type=ld drives=1I:1:1-1I:1:2 raid=1 创建raid1
hpssacli ctrl slot=1 array B delete forced 删除raid
hpssacli ctrl slot=0 ld all delete    删除所有配置
hpacucli ctrl all show config detail  查看阵列详细信息、配置
hpacucli ctrl all show 查看所有控制器状态 
hpacucli ctrl slot=0 show config detail 查看slot 0阵列信息详细状态
hpacucli ctrl slot=0 logicaldrive 2 show 逻辑磁盘信息
hpacucli ctrl slot=0 physicaldrive 1I:2:1 show(物理磁盘信息)
hpacucli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:5,2I:1:6 raid=1+0 用3,4,5,6号盘创建一个raid1+0阵列
hpacucli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:5 raid=5 用3,4,5号盘创建一个raid5阵列
hpacucli ctrl slot=0 create type=ld drives=1I:1:3 raid=0 用3号盘创建一个raid0阵列
hpacucli ctrl slot=0 array B delete forced 强制删除阵列 B
hpacucli ctrl slot=0 logicaldrive 2 delete forced 强制删除逻辑磁盘2
hpacucli ctrl slot=0 logicaldrive 2 modify caching=enable 打开逻辑磁盘缓存

示例,新盘重做raid:
1.确认坏盘信息
hpssacli ctrl all show status
hpssacli ctrl slot=0 ld all show
Smart HBA H240ar in Slot 0 (Embedded)
   array A
      logicaldrive 1 (894.2 GB, RAID 0, OK)
   array B
      logicaldrive 2 (894.2 GB, RAID 0, OK)
   array C
      logicaldrive 3 (894.2 GB, RAID 0, OK)
   array D
      logicaldrive 4 (894.2 GB, RAID 0, Failed)
2.删除坏盘
hpssacli ctrl slot=0 logicaldrive 4 delete forced
#hpssacli ctrl slot=0 array D delete forced
3.创建raid
hpssacli ctrl slot=0 show config detail
hpssacli ctrl slot=0 create type=ld drives=2I:1:8 raid=0

  • 3
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值