服务器不可不知的阵列卡常用操作

admin 技术文档 2024-10-09 38

摘要:一、各厂商服务器对应的阵列卡工具名称以及粗略使用方法Megacli64/storcli64LSI MegaRAID SAS 2208/LSI MegaRAID SAS-3 3108/LSI MegaRAID SAS-3 3508> 服...

一、各厂商服务器对应的阵列卡工具名称以及粗略使用方法

Megacli64/storcli64

LSI MegaRAID SAS 2208/LSI MegaRAID SAS-3 3108/LSI MegaRAID SAS-3 3508

> 服务器型号

> HUAWEI 2288H V2

> HUAWEI 2485 V2

> HUAWEI 5885 V3

> DELL R730xd

> Lenovo x3750 M4

> FiberHome R2200 V5

> ZTE 8500 G3,ZTE 5300 G3,ZTE 5300 G4

> IBM x3755 M3,IBM x3650 M3

> H3C R6700 G3

> HUAWEI 2288H V3

> HUAWEI G560

> NF5280 M5

> NF8460 M5

> HUAWEI 2488H V5

> HUAWEI 2288 V5

> 5288 V5

> taishan系列

HP专用hpssacli

> 服务器型号

> Hewlett-Packard Company Smart Array Gen系列 Controllers(rev 01)

Adaptec SAS/PCIe 3/4 系列阵列卡工具均为arrconf(最新版)

> 机型:

> H3C R4900 G3

> ZTE 5300 G4,ZTE 5500 G4

> NF5280 M4

LSI SAS 3008 阵列卡工具均为sas3ircu

> 机型:

> FiberHome R1200 V5

> FiberHome R2200 V5

> Sugon I620-G30

> HUAWEI RH2288 V3

名词解释

> Controller:

> IR:

> Volume: 卷,基于物理驱动器通过创建冗余磁盘阵列所生成的虚拟磁盘。概念上等同于RAID冗余磁盘阵列。

> Enclosure: 硬盘盒编号。

> Bay: 即slot,指代硬盘盒的某个插槽。

> HDD: Hard Disk Drive的缩写,即普通机械硬盘。

> SSD: Solid State Drive的缩写,即固态硬盘。

> SAS: 序列式SCSI(SAS:Serial Attached SCSI)是一种电脑集线的技术,其功能主要是作为周边零件的数据传输,例如:硬盘、CD-ROM等设备而设计的界面。

> SATA: 串行ATA(Serial ATA: Serial Advanced Technology Attachment)是一种电脑总线,负责主板和大容量存储设备(如硬盘及光盘驱动器)之间的数据传输,主要用于个人电脑。

二、阵列卡工具使用命令

命令 Megacli64

查询

# 查看阵列卡信息 /opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL # 查看所有阵列卡的所有阵列逻辑卷的所有信息 /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL # 查看物理磁盘信息 /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL|egrep "Slot Number|PD Type|Raw Size|Firmware state|Media Type"|sed s/Slot/\nSlot/g /opt/MegaRAID/MegaCli/MegaCli64 -pdlist -aall | egrep Enclosure Device ID|Slot Number|Firmware state|Raw | sed s/En/\n------\nEn/g # Adapter#0 -----raid卡控制器编号 # Enclosure Device ID: 64 -----外壳设备ID,也就是raid卡的ID号 # Slot Number: 6 ------磁盘槽位号 # PD Type: SAS ------磁盘类型 # Raw Size: 3.638 TB [0x1d1c0beb0 Sectors] -----大小 # Firmware state: Online, Spun Up ------磁盘状态 # 查看RAID组信息 /opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo -aALL|egrep "RAID Level|^Size|Slot Number|Virtual Drive"|sed s/Virtual/\nVirtual/g /opt/MegaRAID/MegaCli/MegaCli64 -ldinfo -lall -aall | egrep RAID Level|State|Number Of Drives|Size |sed s/RA/\n-------------\nRA/ # 查看RAID级别和对应的物理盘 /opt/MegaRAID/MegaCli/MegaCli64 -ldpdinfo -aall | egrep Virtual Drive|RAID Level|PD:|Enclosure Device ID|Slot Number|Firmware state|Raw | sed s/Virtual/\n--------\nVirtual/;s/PD:/\n===========\nPD:/ /opt/MegaRAID/MegaCli/MegaCli64 -ldpdinfo -aall | egrep Virtual Drive|RAID Level|PD:|Enclosure Device ID|Slot Number|Firmware state|Raw | sed s/Virtual/\n--------\nVirtual/;s/PD:/\n===========\nPD:/ | grep Virtual\|Slot\|Firmware # 查看物理磁盘个数 /opt/MegaRAID/MegaCli/MegaCli64 -PDGetNum -aALL # 查看磁盘温度 /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL | egrep "Drive Temperature" | awk -F ":" {print $2} # 查看磁盘错误 /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL|grep Error # Medai Error Count 表示磁盘可能错误,可能是磁盘有坏道, # 这个值不为0值得注意,数值越大,危险系数越高 # Other Error Count 表示磁盘可能存在松动,可能需要重新再插入 # 查看raid陈列中掉线的硬盘: /opt/MegaRAID/MegaCli/MegaCli64 -pdgetmissing -a0 # 查看,开启或关闭jbod模式(硬盘直通功能) 查看:MegaCli -AdpGetProp -enablejbod -aALL 打开:MegaCli -AdpSetProp -EnableJBOD -1 -aALL 关闭:MegaCli -AdpSetProp -EnableJBOD -0 -aALL # 查看第1张阵列卡上一共有多少个raid阵列组(默认从0开始计数) /opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -a0 | grep -i "Virtual Disk" # 阵列创建完后,会有一个初始化同步块的过程,可以看看其进度 /opt/MegaRAID/MegaCli/MegaCli64 -LDInit -ShowProg -LALL -aALL # 同上,但是以动态可视化文字界面显示进度信息 /opt/MegaRAID/MegaCli/MegaCli64 -LDInit -ProgDsply -LALL -aALL​ # 查看阵列后台初始化进度 /opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ShowProg -LALL -aALL # 同上,以动态可视化文字界面显示​ /opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ProgDsply -LALL -aALL # 查看同步进度 /opt/MegaRAID/MegaCli/MegaCli64 -pdrbld -showprog -physdrv[252:3] -a0 # 以动态可视化界面查看物理磁盘重建进度​ /opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ProgDsply -PhysDrv [32:2] -a0 # 查看raid卡日志,注意日志的输出量可能较大,阵列卡对应的组建阵列等操作的详细信息都可以在日志中查看​ /opt/MegaRAID/MegaCli/MegaCli64 -FwTermLog -Dsply -aALL # 显示Raid卡型号,Raid设置,Disk相关信息​ /opt/MegaRAID/MegaCli/MegaCli64 -cfgdsply -aALL # 显示适配器个数,只能查看机器上一共有多少张阵列卡,不能查看详细信息​ /opt/MegaRAID/MegaCli/MegaCli64 -adpCount # 显示适配器时间​ /opt/MegaRAID/MegaCli/MegaCli64 -AdpGetTime –aALL # 查看BBU的详细信息​ /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll # 查看BBU电池的充电状态​ /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus - aALL |grep Charger Status # 显示BBU状态信息​ /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL # 显示BBU容量信息​ /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuCapacityInfo -aALL # 显示BBU设计参数​ /opt/MegaRAID/MegaCli/ MegaCli64 -AdpBbuCmd -GetBbuDesignInfo -aALL # 显示当前BBU属性​ /opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuProperties -aALL

外来配置

# 扫描外来配置的个数: /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0 # 查看当前的磁盘在normal时的位置 /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -preview -a0 # 来导入配置,恢复虚拟磁盘组 /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -import -a0 /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -dsply -a0 # 删除外来配置 /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -clear -a0 # ** 此命令慎用 ** # 这里的a0表示第一个raid卡控制器上的外来配置 MegaCli64 -cfgforeign -clear -a0

磁盘上下线

# 将某块物理盘下线/上线 /opt/MegaRAID/MegaCli/MegaCli64 -PDOffline -PhysDrv [32:4] -a0 /opt/MegaRAID/MegaCli/MegaCli64 -PDOnline -PhysDrv [32:4] -a0

创建

# 用slot2号的盘创建raid0 /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0[32:2] WB Direct -a0 # 用slot3,4号盘创建raid1 /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r1 [32:3,32:4] -a0 # 用slot5,6,7号盘创建raid5 /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [32:5,32:6,32:7] -a0 # 用slot9,10,11,12号,创建一个raid10 /opt/MegaRAID/MegaCli/MegaCli64 -CfgSpanAdd -r10 -Array0[32:8,32:9] -Array1[32:10,32:11] -a0 # 如果创建报错 Exit Code: 0x26 #将磁盘格式转换一下 /opt/MegaRAID/MegaCli/MegaCli64 -PDMakeGOOD -Physdrv [32:8] -force -aALL # 在第1张阵列卡上创建一个 raid5 阵列,由物理盘 1,2,3 构成,该阵列的热备盘是物理盘 4 # 注意这里的32:2指的是使用eID和slot ID对一个阵列卡下的硬盘进行定位(默认从0开始计数) /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [32:2,32:3,32:4] WB Direct -Hsp[32:4] -a0 # 同上,创建一个 raid5 阵列,但是不指定热备盘​ /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [32:2,32:3,32:4] WB Direct -a0 # 在线添加物理硬盘到某个阵列中 /opt/MegaRAID/MegaCli/MegaCli64 -LDRecon -Start -r5 -Add -PhysDrv[32:5] -L1 -a0 # 指定第1张阵列卡的第8块盘作为全局热备 (默认从0开始计数) /opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[32:7] -a0​ # 同上,指定为某个阵列的专用热备 /opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[32:7] -a0

删除

# 删除raid组0的raid组 /opt/MegaRAID/MegaCli/MegaCli64 -cfglddel -L0 -a0 # 删除全局热备盘​ /opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Rmv -PhysDrv[32:7] -a0

换盘

# 查看磁盘健康状态 /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "slot number" | nl && /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "firmware state" | nl && /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "raw size" | nl # 查看RAID /opt/MegaRAID/MegaCli/MegaCli64 -LdPdInfo -aALL|egrep "Virtual Drive|RAID|^Size" # 查看磁盘中是哪一块的raid占用缓存导致无法创建新的raid /opt/MegaRAID/MegaCli/MegaCli64 -getpreservedcachelist -a0 # 清除占用缓存的raid (其中L4中的数字是来源于上一条命令的输出) /opt/MegaRAID/MegaCli/MegaCli64 -discardpreservedcache -L2 -a0 # 查看是否清除缓存完成 /opt/MegaRAID/MegaCli/MegaCli64 -getpreservedcachelist -a0 # 扫描Foreign磁盘配置 /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -scan -a0 # 清除Foreign磁盘配置 /opt/MegaRAID/MegaCli/MegaCli64 -cfgforeign -clear -a0 # raid0更换磁盘 # 1.查看磁盘报错状况, ll /dev/sd* lsblk # 2.查看磁盘位置 /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "slot number" | nl && /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "firmware state" | nl && /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "raw size" | nl # 3.卸载磁盘错误目录 (#备注:如自动挂载会自动卸载错误目录,这步可忽略直接在线更换) umount /srv/BigData/hapdoop/data5 # 4.现场更换磁盘 # 查看阵列卡卡号 /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | more # 创建阵列对应的磁盘位置阵列卡卡号252,slot4槽位 /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0[252:4] -a0 /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "slot number" | nl && /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "firmware state" | nl && /opt/MegaRAID/MegaCli/MegaCli64 -PDlist -a0 | grep -i "raw size" | nl #(1)在确认磁盘好的情况下如不能加入阵列卡,请查看Foreign磁盘配置和磁盘cache信息,及时去清除(2)查看raid以及磁盘相关信息 #查看是否有 preserved cache data /opt/MegaRAID/MegaCli/MegaCli64 -getpreservedcachelist -a0 #有missing就清除 /opt/MegaRAID/MegaCli/MegaCli64 -discardpreservedcache -L1 -a0 /opt/MegaRAID/MegaCli/MegaCli64 -getpreservedcachelist -a0 /opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r0[0:0] -a # 5.格式化相对应的盘 进行挂载 mkfs.ext4 /dev/sdf mount /srv/BigData/hapdoop/data5 # 备注:如果更换的新盘有数据会发现一直faild状态,可使用强制同步,改标识good然后重新加入raid # 1.标识改为good /opt/MegaRAID/MegaCli/MegaCli64 -PDMakeGood -PhysDrv[252:6] -a0 # 2.查看该磁盘 array和row位置 /opt/MegaRAID/MegaCli/MegaCli64 -PdGetMissing -a0 # 3加入阵列组 /opt/MegaRAID/MegaCli/MegaCli64 -PdReplaceMissing -Physdrv[252:6] -array3 -row0 -a0 # 4开始同步该磁盘 /opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -start -physDrv[252:6] -a0 # 5.查看该磁盘同步进度 /opt/MegaRAID/MegaCli/MegaCli64 -pdrbld -showprog -physDrv[252:6] -a0

sas3ircu

> 适用阵列卡型号

> LSISAS3008

> LSISAS3004

# 查看所有RAID控制器信息 ./sas3ircu list # 查看第一块RAID控制器、volume、物理磁盘等信息。这里数字0代表第一块RAID卡,依次类推。如果只有一块RAID卡,也是0。 ./sas3ircu 0 display # 查看第一块RAID控制器所有逻辑磁盘信息 ./sas3ircu 0 status # 删除第一块RAID控制器上所有RAID配置 ./sas3ircu 0 delete noprompt # 在第一块RAID控制器上将第一块与第二块物理磁盘配置为RAID1,分配最大使用空间。 ./sas3ircu 0 create raid 1 max 2:0 2:1 noprompt # 在第一块RAID控制器上将第三块到第十二块物理磁盘配置为RAID10,分配最大使用空间。(注意:LSI SAS3008最多支持2个RAID,单个RAID中最多支持10个硬盘。所有的RAID包含的硬盘总量最多14个,剩余硬盘只能以独立的“Physical drive”方式被LSI SAS3008管理。) ./sas3ircu 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 # 设置Volume ID号为286的RAID组为预先可引导模式 ./sas3ircu 0 bootir 286 # 配置第11块物理硬盘为热备 ./sas3ircu 0 hotspare 2:10 # 删除热备硬盘 ./sas3ircu 0 hotspare delete 2:10 # 上传或清除日志信息 ./sas3ircu 0 logir # raid0更换磁盘 # 1.查看磁盘报错状况, ll /dev/sd* lsblk ./sas3ircu 0 display # 2.卸载磁盘错误目录 umount /srv/BigData/hapdoop/data5 3.确认磁盘,这个不用加入阵列,在线换盘可直接识别 多阵列目前不涉及计费机器,其他可在线更换

storcli64

参数

/c 控制器号 输出结果中的Controller 值 /v RAID号 /e 背板号 输出结果EID值 /f 外部配置 /s 槽位号 输出结果的Slt值

查看

# 获取控制器号: storcli64 /call show all # 查看RAID控制器摘要信息 storcli64 show # 查看详细RAID控制器信息 storcli64 show all # 查看第一块RAID卡版本、功能、状态、以及raid卡下的物理磁、逻辑盘信息。c0代表第一块raid卡,如果有多块则命令以此类推。 storcli64 /c0 show all # 查看第一块RAID卡剩下的磁盘空间 storcli64 /c0 show freespace # 查看第一块RAID卡rebuildrate速度 storcli64 /c0 show rebuildrate # 查看第一块RAID卡上物理磁盘详细信息 storcli64 /c0 /eall /sall show all # 查看磁盘重建进度 storcli64 /c0 /e252 /sall show rebuild # 查看报警器信息 storcli64 /c0 show alarm # 显示第一块RAID卡上所有逻辑磁盘相关信息,也可指定某个逻辑磁盘v0,v1等等。 storcli64 /c0 /vall show all # 显示第一块RAID卡上第一个逻辑磁盘信息 storcli64 /c0 /v0 show # 显示bbu信息 storcli64 /c0 /bbu show all # 在线查看日志 storcli64 /c0 show termlog type=contents # 将日志存储为文件 storcli64 /c0 show events file=/home/eventreports

删 除

# 强制删除某个逻辑磁盘 storcli64 /c0 /v0 del force # 清除第一块RAID卡缓存 storcli64 /c0 flushcache # 删除热备磁盘 storcli64 /c0 /ex /sx delete hostsparedrive

升级

# 升级第一块RAID卡固件 storcli64 /c0 download file=mr3108fw.rom # 升级固件后重启RAID卡以便新固件及时生效 storcli64 /c0 restart

定位

# 定位第一块RAID上某块物理磁盘,物理磁盘的绿色的定位灯会闪烁。 e代表Enclosure,s代表Slot或PD storcli64 /c0 /e252 /s0 start locate # 停止定位,定位灯停止闪烁。 storcli64 /c0 /ex /sx stop locate

手动重建

# 开始重建 storcli64 /c0 /ex /sx start rebuild # 停止重建 storcli64 /c0 /ex /sx stop rebuild # 设置某块物理磁盘为磁盘组0的热备盘,如果不指定dgs,则为该RAID卡上全局热备盘。 storcli64 /c0 /ex /sx add hostsparedrive dgs=0 # 单独为每一块物理磁盘创建raid0 storcli64 /c0 add vd each type=raid0 drives=252:0,1,2,3 # 由第3、4、5块物理磁盘来构建RAID5,分配所有空间的逻辑磁盘命名tmp1。 storcli64 /c0 add vd type=raid5 size=all names=tmp1 drives=32:2-4 # 由前四块物理磁盘构建raid10,分配所有空间的逻辑磁盘命名为tmp1。(注意:LSI SAS3108最多支持64个RAID,创建10/50/60时,必须指定pdperarray参数。如果没有这个参数,是创建不成功的。这个参数的含义是:Specifies the number of physical drives per array. The default value is automatically chosen。) storcli64 /c0 add vd type=raid10 size=all names=tmp1 drives=32:0-3 pdperarray=2 # 由前四块物理磁盘构建raid10,分别分配多个逻辑磁盘。 storcli64 /c0 add vd type=raid10 size=100GB,200GB names=tmp1,tmp2 drives=32:0-3 pdperarray=2 # 剩下的所有空间分配给逻辑磁盘tmp3。 storcli64 /c0 add vd type=raid10 size=all names=tmp3 drives=32:0-3 pdperarray=2 # 设置写策略 storcli64 /c0 /vall set wrcache=wt/wb/awb # 暂时关闭报警器鸣叫 storcli64 /c0 set alarm=silence # 始终关闭报警器鸣叫 storcli64 /c0 set alarm=off # 改变插入的物理磁盘的状态 storcli64 /c0 /e252 /s3 set good # 初始化某个物理磁盘 storcli64 /c0 /e252 /s3 start initialization # 查看某个初始化的物理磁盘进度 storcli64 /c0 /e252 /s3 show initialization # 修改vd的写策略 storcli64 /c0 /v0 set wrcache=wt # 修改vd的读策略 storcli64 /c0 /v0 set rdcache=nora # 查看foreign信息 storcli64 /c0 /fall show # 导入foreign storcli64 /c0 /fall import # grep “rebuild” storcli64 /c0 show termlog type=contents

相关推荐

评论列表
关闭

用微信“扫一扫”