再总结:

一般,清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,可以配置成热备盘。

浪潮MegaCli的更多相关文章

  1. 使用MegaCli工具,在线调整raid配置

    公司hadoop平台采购了一批浪潮服务器,2个系统盘,12个数据盘.先想的用直通的raid卡免得再做单盘raid0麻烦,结果这批机器配的卡也不支持裸盘使用,咨询浪潮客服,说可以使用JBOD的模式进行, ...

  2. 使用MegaCli工具查看Raid磁盘阵列状态

    转载自:http://home.51.com/chenjianghui1987/diary/item/10051836.html 文章本身我不做过多修改了,在这里我就把自己在安装时候碰到的难点跟大家提 ...

  3. 微信封号浪潮再起 A货假代购还能在朋友圈泛滥多久?

    你的微信朋友圈是不是很活跃?是不是被很多所谓的名品所包围?没错,这些很多都是A货或假代购的伎俩.如果xmyanke的微信朋友圈出现这些东东,我就会直接屏蔽他的朋友圈权限.具体方法是:打开他的微信详细资 ...

  4. 浪潮之巅——IT那点事之二—蓝色巨人IBM

    蓝色巨人IBM的全称是国际商用机器公司(International Business Machines Corporation),纵观IBM的发展历史,可以看出IBM与机器结缘,以商用为主的发展策略. ...

  5. 浪潮之巅IT那点事之一——AT&T的兴衰

    首次接触到<浪潮之巅>这本书,几乎是熬了一个通宵把上下两册全部看完,感慨颇多.从事计算机基础教育多年,每次在讲计算机导论课程时,总是在重复同样的内容,讲一些计算机结构.操作系统.算法.软件 ...

  6. 使用MegaCli和Smartctl获取普通磁盘

    设备名称: [root@DB232 shell]# cat /proc/scsi/scsi Attached devices:Host: scsi0 Channel: 02 Id: 00 Lun: 0 ...

  7. Megacli查看raid磁盘信息

    准备: 新版本的 MegaCli-1.01.24-0.i386.rpm (下载地址:http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Fi ...

  8. VR就是下一个浪潮_2016 (GMGC) 全球移动游戏大会观后感

    "VR就是下一个浪潮"  --2016 (GMGC) 全球移动游戏大会观后感   早在2014年参会Unity举办的一年一度的金立方盛典大会,就初次体验了VR头盔设备,于是印象深刻 ...

  9. 安装linux操作系统--浪潮服务器

    一直都是在虚拟机上进行安装linux操作系统,在服务器上安装的很少,也没有碰到过没找到驱动的情况,例如什么raid卡驱动,网卡驱动等异常情况的发生. 这次安装了两台服务器,浪潮的提供的服务器,硬盘是两 ...

随机推荐

  1. Python安装、配置

    1.Python简介:Python在Linux.windows.Mac os等操作系统下都有相应的版本,不管在什么操作系统下,它都能够正常工作.除非使用平台相关功能,或特定平台的程序库,否则可以跨平台 ...

  2. 用 ggplot2 在同一个图上画多条颜色不同的线

    假如数据格式是这样: day    邓文迪    微博    城管0    0.0    9.262970888519191E-4    0.01    0.0    0.00144775855013 ...

  3. spring注入Properties

    最近项目中向将某个Properties注入到Bean中,经百度知以下代码. <bean id="settings" class="org.springframewo ...

  4. glusterfs 术语

    Access Control Lists Access Control Lists (ACLs) allows you to assign different permissions for diff ...

  5. unexpected error ConnectionError object has no attribute

    unexpected error ConnectionError object has no attribute

  6. 【设计模式】单例设计模式的N中Java实现方法

    转载请注明出处:http://blog.csdn.net/ns_code/article/details/17359719 特点 单例模式的特点: 1.只能有一个实例: 2.必须自己创建自己的一个实例 ...

  7. 一步一步学android控件(之十六)—— CheckBox

    根据使用场景不同,有时候使用系统默认的CheckBox样式就可以了,但是有时候就需要自定义CheckBox的样式.今天主要学习如何自定义CheckBox样式.在CheckBox状态改变时有时需要做一些 ...

  8. 实现GetHashCode时要遵循的规则

    博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:实现GetHashCode时要遵循的规则.

  9. 安装J2EE的SDK报错:could not find the required version of the Java(TM)2 Runtime Environment in '(null)'的解决办法。

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  10. Struts2学习笔记1

     一.下载struts2.0.1 http://struts.apache.org/downloads.html,下载struts-2.0.1-all.zip,这个压缩包中包括了开发struts2所需 ...