zoukankan      html  css  js  c++  java
  • 浪潮MegaCli

    再总结:

    一般,清RAID再做RAID,安装完毕后:

    ./MegaCli64 -PDList -aALL | egrep 'Slot|Enclosure Device'                       查看背板和硬盘位置

    ./MegaCli64 -ldinfo -lall -a0 | egrep 'Virtual|RAID'                                      查看RAID状态

    ./MegaCli64  -cfglddel -l0 -a0 或者 ./MegaCli64  -cfglddel -l1 -a0             删除RAID,此处要注意,因为有个RAID应该是系统盘,一般不删。

     ./MegaCli64  -CfgLdadd -r5[252:0,252:1,252:2, 252:3] -a0                      创建RAID,此处给的例子是用四块硬盘创建RAID5

    安装megacli:

    现将rpm包上传到节点上,

    然后安装:[root@localhost ~]# rpm -ivh MegaCli-8.07.07-1.noarch.rpm megacli程序自动安装到/opt/MegaRAID/MegaCli目录下。

    注:开机自检时,使用ctrl+y也可直接进入命令行配置界面。ctrl+y进入命令行后需要区分大小写,系统下megacli不需要区分大小写。

    1、使用./MegaCli64 –help或者./Megacli64 –h查看命令帮助

    2、查看硬盘列表

    [root@localhost MegaCli]# ./MegaCli64 -PDList -aALL

    其中:Enclosure Device ID: 252----背板

            Slot Number: 0-----硬盘位置

            Firmware state: Unconfigured(good), Spun Up---显示硬盘状态,单独硬盘还是raid中,Firmware state: Online, Spun Up(raid中)

    3、查看raid状态

    [root@node-23 MegaCli]# ./MegaCli64 -ldinfo -lall -a0 | more

    Adapter 0 -- Virtual Drive Information:
    Virtual Drive: 0 (Target Id: 0)
    Name :
    RAID Level : Primary-1, Secondary-0, RAID Level Qualifier-0
    Size : 2.728 TB
    Sector Size : 512
    Is VD emulated : No
    Mirror Data : 2.728 TB
    State : Optimal
    Strip Size : 256 KB
    Number Of Drives : 2
    Span Depth : 1
    Default Cache Policy: WriteThrough, ReadAhead, Direct, No Write Cache if Bad BBU
    Current Cache Policy: WriteThrough, ReadAhead, Direct, No Write Cache if Bad BBU
    Default Access Policy: Read/Write
    Current Access Policy: Read/Write
    Disk Cache Policy : Disk's Default
    Encryption Type : None
    PI type: No PI

    Is VD Cached: No


    Virtual Drive: 1 (Target Id: 1)
    Name :
    RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3
    Size : 24.556 TB
    Sector Size : 512
    Is VD emulated : No
    Parity Size : 2.728 TB
    State : Optimal
    Strip Size : 256 KB
    Number Of Drives : 10
    Span Depth : 1
    Default Cache Policy: WriteThrough, ReadAhead, Direct, No Write Cache if Bad BBU
    Current Cache Policy: WriteThrough, ReadAhead, Direct, No Write Cache if Bad BBU
    Default Access Policy: Read/Write
    Current Access Policy: Read/Write
    Disk Cache Policy : Disk's Default
    Encryption Type : None
    PI type: No PI

    Is VD Cached: No

    Exit Code: 0x00
    分别查看:[root@node-23 MegaCli]# ./MegaCli64 -ldinfo -l0 -a0

                  [root@node-23 MegaCli]# ./MegaCli64 -ldinfo -l1 -a0

    查看Raid状态以及raid中包含哪些硬盘:

    [root@node-23 MegaCli]# ./MegaCli64 -ldpdinfo -a0

    Adapter #0

    Number of Virtual Disks: 2
    Virtual Drive: 0 (Target Id: 0)
    ……………………………………………………#第一块Virtual Drive

    Is VD Cached: No
    Number of Spans: 1
    Span: 0 - Number of PDs: 2

    PD: 0 Information
    ………………………………

    PD: 1 Information

    ……………………………

    Virtual Drive: 1 (Target Id: 1)

    ………………………………………………#第二块Virtual Drive

    Is VD Cached: No
    Number of Spans: 1
    Span: 0 - Number of PDs: 10

    PD: 0 Information
    ………………………………

    ~

    PD: 9 Information

    ……………………………

    Exit Code: 0x00

    4、显示Raid卡型号,Raid设置,Disk相关信息   #/opt/MegaRAID/MegaCli/MegaCli64 -cfgdsply -aALL

    5、查看raid卡日志   #/opt/MegaRAID/MegaCli/MegaCli64 -FwTermLog -Dsply -aALL

    6、查看RAID阵列中掉线的盘   /opt/MegaRAID/MegaCli/MegaCli64 -pdgetmissing -a0

    7、删除raid

    [root@localhost MegaCli]# ./MegaCli64  -cfglddel -l0 -a0

    [root@localhost MegaCli]# ./MegaCli64  -cfglddel -l1 -a0

     8、创建raid

     [root@localhost MegaCli]# ./MegaCli -CfgLdAdd -rX[E0:S0,E1:S1,...] [WT|WB] [NORA|RA|ADRA] [Direct|Cached] [CachedBadBBU|NoCachedBadBBU] [-szXXX [-szYYY ...]] [-strpszM] [-Hsp[E0:S0,...]] [-AfterLdX] [-Force]|[FDE|CtrlBased] –aN

    非红色部分,如果不填写则使用默认配置,如背板显示不出来,则使用空格代替即可。

    e.g. 使用四块硬盘创建一个raid5

    [root@localhost MegaCli]# ./MegaCli64  -CfgLdadd -r5[252:0,252:1,252:2, 252:3] -a0

    查看背板和硬盘位置可用命令:./MegaCli64 -PDList -aALL | egrep 'Slot|Enclosure Device'

    【其它】

    1、 做热备

    【root@localhost MegaCli]# ./MegaCli64  -pdhsp -set -physdrv[252:3] -a0

                                        

    Adapter: 0: Set Physical Drive at EnclId-252 SlotId-3 as Hot Spare Success.

    Exit Code: 0x00

    查看热备盘状态:Firmware state: Hotspare, Spun Up

    热备盘删除

    ./MegaCli64 -PDHSP -Rmv  -PhysDrv[Ex:Sx] –aALL

    5、uncfgure bad硬盘改成uncfgure good硬盘

    MegaCli -PDMakeGood -PhysDrv[E0:S0,E1:S1,...] | [-Force] -aN|-a0,1,2|-aALL

    Uncfgure bad状态硬盘,无法对其进行操作。

    6、删除foreign信息

    MegaCli -CfgForeign -Scan | [-SecurityKey sssssssssss] -aN|-a0,1,2|-aALL   

    MegaCli -CfgForeign -Clear [x]|[-SecurityKey sssssssssss] -aN|-a0,1,2|-aALL   

            x - index of foreign configurations. Optional. All by default.

    7、如何做rebuild

    如有热备盘,硬盘掉线后,热备盘会自动rebuild。

    热备盘自动rebuid

    Enclosure Device ID: 252

    Slot Number: 2

    Device Id: 178

    Sequence Number: 6

    Media Error Count: 0

    Other Error Count: 0

    Predictive Failure Count: 0

    Last Predictive Failure Event Seq Number: 0

    PD Type: SATA

    Raw Size: 931.512 GB [0x74706db0 Sectors]

    Non Coerced Size: 931.012 GB [0x74606db0 Sectors]

    Coerced Size: 930.390 GB [0x744c8000 Sectors]

    Firmware state: Rebuild

    SAS Address(0): 0x9281c0667817c71

    Connected Port Number: 2(path0)

    Inquiry Data:             9WK0BXZLST31000524NS                            SN11   

    FDE Capable: Not Capable

    FDE Enable: Disable

    Secured: Unsecured

    Locked: Unlocked

    Needs EKM Attention: No

    Foreign State: None

    Device Speed: 3.0Gb/s

    Link Speed: 3.0Gb/s

    Media Type: Hard Disk Device

    使用MegaCli -PDRbld -ShowProg -PhysDrv [E0:S0,E1:S1,...] -aN|-a0,1,2|-aALL来查看硬盘rebuild进程。

    Rebuid结束后,掉线槽位硬盘更换后,自动从热备拷回数据,原热备盘再次变成热备盘,

    Enclosure Device ID: 252

    Slot Number: 1

    Device Id: 179

    Sequence Number: 2

    Media Error Count: 0

    Other Error Count: 0

    Predictive Failure Count: 0

    Last Predictive Failure Event Seq Number: 0

    PD Type: SATA

    Raw Size: 931.512 GB [0x74706db0 Sectors]

    Non Coerced Size: 931.012 GB [0x74606db0 Sectors]

    Coerced Size: 930.390 GB [0x744c8000 Sectors]

    Firmware state: Copyback

    SAS Address(0): 0x9281c06595f6f7c

    Connected Port Number: 1(path0)

    Inquiry Data:             9WK046MWST31000524NS                            SN11    

    FDE Capable: Not Capable

    FDE Enable: Disable

    Secured: Unsecured

    Locked: Unlocked

    Needs EKM Attention: No

    Foreign State: None

    Device Speed: 3.0Gb/s

    Link Speed: 3.0Gb/s

    Media Type: Hard Disk Device

    热备盘在rebuid过程中,更换掉线槽位硬盘,查看该硬盘是否有media error即可,确认硬盘为uncfgure good状态,一般RAID卡都可以copyback,后续硬盘会自动从原热备盘拷回数据。

    但是考虑到存在无法copyback的情况,在热备盘rebuild完成后再更换硬盘。

    无热备盘情况,更换新硬盘,如果自动rebuild,则正常结束即可,如不自动rebuild,可以配置成热备盘。

  • 相关阅读:
    面向对象静态语言的模型
    语言的静态分析技术
    面向对象的核心元素与机制
    Lua 笔记
    Linux配置系统
    Linux文件类型
    Wijmo 日历插件
    窗外大雨,心里小雨
    一次胆战心惊的服务器经历
    一次胆战心惊的服务器经历
  • 原文地址:https://www.cnblogs.com/cmss/p/4800392.html
Copyright © 2011-2022 走看看