慢慢赚钱博客

6月 3 2019

dell和hp服务器磁盘检测命令

DELL检测工具
#/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -Lall -aALL 查raid级别
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL 查raid卡信息
#/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL 查看硬盘信息
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -aAll 查看电池信息
#/opt/MegaRAID/MegaCli/MegaCli64 -FwTermLog -Dsply -aALL 查看raid卡日志
#/opt/MegaRAID/MegaCli/MegaCli64 -adpCount 【显示适配器个数】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpGetTime -aALL 【显示适配器时间】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aAll 【显示所有适配器信息】
#/opt/MegaRAID/MegaCli/MegaCli64 -LDInfo -LALL -aAll 【显示所有逻辑磁盘组信息】
#/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aAll 【显示所有的物理信息】
#/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL |grep ‘Charger Status’ 【查看充电状态】
#/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 【显示当前BBU属性】
#/opt/MegaRAID/MegaCli/MegaCli64 -cfgdsply -aALL 【显示Raid卡型号,Raid设置,Disk相关信息】
3.磁带状态的变化,从拔盘,到插盘的过程中。
Device |Normal|Damage|Rebuild|Normal
Virtual Drive |Optimal|Degraded|Degraded|Optimal
Physical Drive |Online|Failed -> Unconfigured|Rebuild|Online
4.查看磁盘缓存策略
#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -L0 -a0
or
#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -L1 -a0
or
#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -LALL -a0
ro
#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -Cache -LALL -aALL
ro
#/opt/MegaRAID/MegaCli/MegaCli64 -LDGetProp -DskCache -LALL -aALL
5.设置磁盘缓存策略
缓存策略解释:

WT (Write through
WB (Write back)
NORA (No read ahead)
RA (Read ahead)
ADRA (Adaptive read ahead)
Cached
Direct
例子:
#/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0
or
#/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -Cached|-Direct -L0 -a0
or
enable / disable disk cache
#/opt/MegaRAID/MegaCli/MegaCli64 -LDSetProp -EnDskCache|-DisDskCache -L0 -a0
6.创建一个 raid5 阵列,由物理盘 2,3,4 构成,该阵列的热备盘是物理盘 5
#/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0
7.创建阵列,不指定热备
#/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -a0
8.删除阵列
#/opt/MegaRAID/MegaCli/MegaCli64 -CfgLdDel -L1 -a0
9.在线添加磁盘
#/opt/MegaRAID/MegaCli/MegaCli64 -LDRecon -Start -r5 -Add -PhysDrv[1:4] -L1 -a0
10.阵列创建完后,会有一个初始化同步块的过程,可以看看其进度。
#/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -ShowProg -LALL -aALL
或者以动态可视化文字界面显示
#/opt/MegaRAID/MegaCli/MegaCli64 -LDInit -ProgDsply -LALL -aALL
11.查看阵列后台初始化进度
#/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ShowProg -LALL -aALL
或者以动态可视化文字界面显示
#/opt/MegaRAID/MegaCli/MegaCli64 -LDBI -ProgDsply -LALL -aALL
12.指定第 5 块盘作为全局热备
#/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
13.指定为某个阵列的专用热备
#/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
14.删除全局热备
#/opt/MegaRAID/MegaCli/MegaCli64 -PDHSP -Rmv -PhysDrv[1:5] -a0
15.将某块物理盘下线/上线
#/opt/MegaRAID/MegaCli/MegaCli64 -PDOffline -PhysDrv [1:4] -a0
#/opt/MegaRAID/MegaCli/MegaCli64 -PDOnline -PhysDrv [1:4] -a0
16.查看物理磁盘重建进度
#/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ShowProg -PhysDrv [1:5] -a0
或者以动态可视化文字界面显示
#/opt/MegaRAID/MegaCli/MegaCli64 -PDRbld -ProgDsply -PhysDrv [1:5] -a0

磁带状态的变化,从拔盘,到插盘的过程中:
Device |Normal|Damage|Rebuild|Normal
Virtual Drive |Optimal|Degraded|Degraded|Optimal
Physical Drive |Online|Failed -> Unconfigured|Rebuild|Online

HP检测工具
[root@local /root]# hpacucli ctrl slot=0 show config detail #查看slot 0阵列信息详细状态

[root@local /root]# hpacucli ctrl all show #查看所有控制器状态

Smart Array 5i in Slot 0 ()

[root@local /root]# hpacucli ctrl slot=0 array all show #查看slot 0 所有阵列信息

Smart Array 5i in Slot 0

array A (Parallel SCSI, Unused Space: 0 MB)

array B (Parallel SCSI, Unused Space: ??? MB)

array C (Parallel SCSI, Unused Space: 0 MB)

[root@local /root]# hpacucli ctrl slot=0 array B ld all show #查看slot 0 阵列B 所有逻辑驱动器信息

Smart Array 5i in Slot 0

array B (Failed)

logicaldrive 2 (135 GB, RAID 0, Failed)

[root@local /root]# hpacucli ctrl slot=0 array B pd all show #查看slot 0 阵列B 所有物理驱动器信息

Smart Array 5i in Slot 0

array B (Failed)

physicaldrive 2:1 (port 2:id 1 , Parallel SCSI, 72.8 GB, OK)

physicaldrive 2:6 (port 2:id 6 , Parallel SCSI, 0 Byte, Failed)

[root@local /root]# hpacucli ctrl slot=0 array B pd all show status #查看slot 0 阵列B 所有物理驱动器状态

physicaldrive 2:1 (port 2:id 1, 72.8 GB): OK
physicaldrive 2:6 (port 2:id 6, 0 Byte): Failed

[root@local /root]# hpacucli ctrl slot=0 array C pd all show #查看slot 0 阵列C 所有物理驱动器信息

Smart Array 5i in Slot 0

array C
physicaldrive 2:3 (port 2:id 3 , Parallel SCSI, 72.8 GB, OK)

physicaldrive 2:4 (port 2:id 4 , Parallel SCSI, 72.8 GB, OK)

2、如何查看RAID信息?

[root@local /root]# hpacucli ctrl slot=0 ld all show #查看slot 0所有逻辑驱动器信息 (可以检查raid信息和raid重建过程百分比)
Smart Array 5i in Slot 0

array A
logicaldrive 1 (33.9 GB, RAID 0, OK)

array B
logicaldrive 2 (203.5 GB, RAID 5, Recovering 45.0% complete)

[root@local /root]# hpacucli ctrl slot=0 pd all show #查看slot 0所有物理驱动器信息 (可以检查物理磁盘信息和raid重建信息)
Smart Array 5i in Slot 0

array A
physicaldrive 2:0 (port 2:id 0 , Parallel SCSI, 36.4 GB, OK)

array B
physicaldrive 2:1 (port 2:id 1 , Parallel SCSI, 72.8 GB, OK)
physicaldrive 2:2 (port 2:id 2 , Parallel SCSI, 72.8 GB, Rebuilding)
physicaldrive 2:3 (port 2:id 3 , Parallel SCSI, 72.8 GB, OK)
physicaldrive 2:4 (port 2:id 4 , Parallel SCSI, 72.8 GB, OK)

3、查看条带大小

# hpacucli ctrl slot=5 array B ld 2 show

Smart Array P800 in Slot 5

array B

Logical Drive: 2
Size: 4.1 TB
Fault Tolerance: RAID 5
Heads: 255
Sectors Per Track: 32
Cylinders: 65535
Stripe Size: 256 KB
Status: OK
Array Accelerator: Enabled
Parity Initialization Status: In Progress
Unique Identifier: 600508B100104D3953574F30474B0008
Disk Name: c0d1
Mount Points: None

4、在线修改阵列卡读写缓存比例

hpacucli controller slot=0 modify cacheratio=25/75
注:更改盘柜控制器使用chassisserialnumber=控制器SN 来替换slot=0; 30/70为读写比例,可以多种选择具体看阵列卡的种类而定。

5、在线修改阵列热备盘

hpacucli ctrl slot=0 array A modify spares=2I:1:6

6、在线删除阵列热备盘

hpacucli ctrl slot=0 Array A remove spares=2I:1:6

7、在线删除/创建raid阵列

删除阵列

# 强制删除阵列 B
/usr/sbin/hpacucli ctrl slot=0 array B delete forced

#or 强制删除逻辑磁盘2
/usr/sbin/hpacucli ctrl slot=0 logicaldrive 2 delete forced

在线更改条带大小

ctrl slot=5 ld 2 modify raid=5 stripesize=128

创建阵列

#用3,4,5,6号盘创建一个raid1+0阵列
/usr/sbin/hpacucli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:5,2I:1:6 raid=1+0

#or 用3,4,5号盘创建一个raid5阵列
/usr/sbin/hpacucli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4,2I:1:5 raid=5

Written by moneyslow.com

moneyslow.com真棒!