• Megacli 常用


    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[321}]-a0

     

    MegaCli -PDHSP   -Set   -Dedicated  -Array0  -physdrv[E:S] -a0   添加局部热备盘,其中array0表示第0个raid 

    MegaCli  -pdhsp  -set   -physdrv[E:S]  -a0                                       添加全局热备盘

    MegaCli  -pdhsp  -rmv  -physdrv[E:S]  -a0                                      移除全局和热备局部热备

    13.关闭Rebuild

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

    14.设置rebuild的速率

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

     

     

    附其他详细命令:

    1. 常用命令:

    #/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相关信息】
    #/opt/MegaRAID/MegaCli/MegaCli64 -adpallinfo -aall|grep -i temp  查看温度
     
    2.  磁带状态的变化,从拔盘,到插盘的过程中
    Device |Normal|Damage|Rebuild|Normal
    Virtual Drive |Optimal|Degraded|Degraded|Optimal
    Physical Drive |Online|Failed –> Unconfigured|Rebuild|Online
     
    3. 查看磁盘缓存策略
    #/opt/MegaCli -LDGetProp -Cache -L0 -a0
    or
    #/opt/MegaCli -LDGetProp -Cache -L1 -a0
    or
    #/opt/MegaCli -LDGetProp -Cache -LALL -a0
    or
    #/opt/MegaCli -LDGetProp -Cache -LALL -aALL
    or
    #/opt/MegaCli -LDGetProp -DskCache -LALL -aALL
     
    4.设置磁盘缓存策略
    缓存策略解释:
    WT (Write through
    WB (Write back)
    NORA (No read ahead)
    RA (Read ahead)
    ADRA (Adaptive read ahead)
    Cached
    Direct
    例子:
    #/opt/MegaCli -LDSetProp WT|WB|NORA|RA|ADRA -L0 -a0
    or
    #/opt/MegaCli -LDSetProp -Cached|-Direct -L0 -a0
    or
    enable / disable disk cache
    #/opt/MegaCli -LDSetProp -EnDskCache|-DisDskCache -L0 -a0
     
    /opt/MegaRAID/MegaCli/MegaCli64 -DiscardPreservedCache -Lall -a0 -NoLOG    【清空缓存】
     
    5. 创建一个 raid5 阵列,由物理盘 2,3,4 构成,该阵列的热备盘是物理盘 5
    #/opt/MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -Hsp[1:5] -a0
    6. 创建阵列,不指定热备
    #/opt/MegaCli -CfgLdAdd -r5 [1:2,1:3,1:4] WB Direct -a0
    7. 删除阵列
    #/opt/MegaCli -CfgLdDel -L1 -a0
    8. 在线添加磁盘
    #/opt/MegaCli -LDRecon -Start -r5 -Add -PhysDrv[1:4] -L1 -a0
    9. 阵列创建完后,会有一个初始化同步块的过程,可以看看其进度。
    #/opt/MegaCli -LDInit -ShowProg -LALL -aALL
    或者以动态可视化文字界面显示
    #/opt/MegaCli -LDInit -ProgDsply -LALL -aALL
    10. 查看阵列后台初始化进度
    #/opt/MegaCli -LDBI -ShowProg -LALL -aALL
    或者以动态可视化文字界面显示
    #/opt/MegaCli -LDBI -ProgDsply -LALL -aALL
    11. 指定第 5 块盘作为全局热备
    #/opt/MegaCli -PDHSP -Set [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
    12. 指定为某个阵列的专用热备
    #/opt/MegaCli -PDHSP -Set [-Dedicated [-Array1]] [-EnclAffinity] [-nonRevertible] -PhysDrv[1:5] -a0
    13. 删除全局热备
    #/opt/MegaCli -PDHSP -Rmv -PhysDrv[1:5] -a0
    14. 将某块物理盘下线/上线
    #/opt/MegaCli -PDOffline -PhysDrv [1:4] -a0
     
    15. 查看物理磁盘重建进度
    #/opt/MegaCli -PDRbld -ShowProg -PhysDrv [1:5] -a0
    或者以动态可视化文字界面显示
    #/opt/MegaCli -PDRbld -ProgDsply -PhysDrv [1:5] -a0
     



    将来的你,一定会感谢现在拼命努力的你。
  • 相关阅读:
    [原]Google的小Bug
    [原]安装Oracle 11g R2 遇到的两个小问题及解决方法
    [原]关于数据库是否使用索引的讨论,我想说的
    [原]在新服务器中找到了上个世纪的产物
    Oracle db_block_checking和db_block_checksum 两个参数区别
    [原]16路的PC服务器
    [原]第一次遭遇Oracle的Bug,纪念一下 |ORA00600 kmgs_pre_process_request_6|
    Oracle 隐含参数的查询
    [原]nginx折腾记(HTTP性能能测试,与Apache对比)
    [原]Oracle Control File 意外情况研究
  • 原文地址:https://www.cnblogs.com/51runsky/p/4572840.html
Copyright © 2020-2023  润新知