Raid卡操作与介绍

Raid卡型号与操作

Raid卡市场主要是LSI、Adaptec、Highpoint、Promise等厂商提供。Adaptac被PMC收购后,提供的Raid卡即为PMC,简称为P卡。LSI公司提供的Raid卡,即为L卡。

Raid卡配置操作方式

Raid配置可以通过BIOS启动后进入Raid的配置页面进行配置,也可以进入系统后通过对应的操作工具进行配置。

PMC配置操作工具为: arcconf

LSI配置操作工具为:storcli

Arcconf介绍

下载:

https://storage.microsemi.com/en-us/speed/raid/storage_manager/arcconf_v3_03_23668_zip.php

使用:
  • arcconf list controller_id 查询RAID卡的基本信息, controller_id 硬盘所在RAID卡的ID

[root@localhost ~]# arcconf list 1
Controllers found: 1


Controller information

Controller ID : Status, Slot, Mode, Name, SerialNumber, WWN

Controller 1: : Optimal, Slot 1, RAID (Hide RAW), MSCC Adaptec SmartHBA 2100-8i, 7A4563EDE26, 50000D1703F07180


Array Information

Array ID : Status (Interface, TotalSize MB, FreeSpace MB)

Array 0 : Has Failed Logical Drive (SATA, 19077120 MB, 0 MB)
Array 1 : Ok (SATA, 9538560 MB, 5343744 MB)


Logical device information

Logical ID : Status (RAID, Interface, Size MB) Name

Logical 0 : Failed (10, Data, 4194304 MB) A
Logical 1 : Optimal (10, Data, 5344246 MB) B
Logical 2 : Optimal (1, Data, 2097152 MB) Logical Drive 3


Physical Device information

Physical ID : State (Interface, BlockSize, SizeMB, Vendor, Model, Type) WWN, [Location]

Physical 0,8 : Online (SATA, 512 Bytes, 4769307MB, ATA , HUS726050ALE610 , Hard Drive) 500E004AAAAAAA00, [Enclosure 1, Slot 0(Connector 0:CN0)]
Physical 0,9 : Online (SATA, 512 Bytes, 4769307MB, ATA , HGST HUS726050AL, Hard Drive) 500E004AAAAAAA01, [Enclosure 1, Slot 1(Connector 0:CN0)]
Physical 0,10 : Online (SATA, 512 Bytes, 4769307MB, ATA , HGST HUS726050AL, Hard Drive) 500E004AAAAAAA02, [Enclosure 1, Slot 2(Connector 0:CN0)]
Physical 0,11 : Online (SATA, 512 Bytes, 4769307MB, ATA , HGST HUS726050AL, Hard Drive) 500E004AAAAAAA03, [Enclosure 1, Slot 3(Connector 0:CN0)]
Physical 0,12 : Online (SATA, 512 Bytes, 4769307MB, ATA , HGST HUS726050AL, Hard Drive) 500E004AAAAAAA04, [Enclosure 1, Slot 4(Connector 0:CN0)]
Physical 0,13 : Online (SATA, 512 Bytes, 4769307MB, ATA , HGST HUS726050AL, Hard Drive) 500E004AAAAAAA05, [Enclosure 1, Slot 5(Connector 0:CN0)]
Physical 2,0 : Ready (SES2, Not Applicable, Not Applicable, 12G SAS, Expander, Enclosure Services Device) 500E004AAAAAAA1F, [Connector 0:CN0, Enclosure 1]
Physical 2,3 : Ready (SES2, Not Applicable, Not Applicable, MSCC , Virtual SGPIO, Enclosure Services Device) 50000D1703F07180, [Not Applicable]

Command completed successfully.</pre>

  • arcconf getconfig controller_id AD 查询RAID卡的基本信息
命令格式 功能
arcconf getconfig controller_id AD 查询适配器信息
arcconf getconfig controller_id LD 查询所有LD的信息
arcconf getconfig controller_id LD LD_id 查询特定LD的信息
arcconf getconfig controller_id PD 查询所有物理硬盘的信息
arcconf getconfig controller_id PD physical_id 查询特定物理硬盘的信息
arcconf getconfig controller_id AR 查询所有Array的信息
arcconf getconfig controller_id AR AR_id 查询特定Array的信息
  • arcconf setcontrollermode controller_id mode 设置RAID卡工作模式 , 默认为“Mixed” 。 mode = 2: HBA 3: RAID 5: Mixed

./arcconf setcontrollermode 1 3
Controllers found: 1

Command completed successfully.</pre>

  • arcconf getconfig 1 查询raid卡工作模式
  • arcconf list 查询所有适用arcconf工具的RAID卡

[root@localhost ~]# arcconf list
Controllers found: 1


Controller information

Controller ID : Status, Slot, Mode, Name, SerialNumber, WWN

Controller 1: : Optimal, Slot 1, Mixed, MSCC Adaptec SmartHBA 2100-8i, 7A4563EDE26, 50000D1703F07180

Command completed successfully.</pre>

  • arcconf setboot controller_id logicaldrive LD_id type boot_type 设置启动盘, LD_id 为 LD的ID , boot_type 为 启动项的类型 , Primary : 将LD或PD设置为第一启动设备, Secondary :将LD或PD设置为第二启动设备。
  • arcconf setboot controller_id device physical_id type boot_type 设置启动盘, physical_id 为 硬盘的physical ID ,boot_type 为 启动项的类型,Primary : 将LD或PD设置为第一启动设备, Secondary :将LD或PD设置为第二启动设备。

[root@localhost ~]# arcconf setboot 1 logicaldrive 1 type primary
Controllers found: 1
Do you wish to change the boot type of the selected device.
Press y, then ENTER to continue or press ENTER to abort: y

Command completed successfully.</pre>

  • arcconf setarrayparam controller_id array_id sparetype mode 设置磁盘为热备模式,mode 热备盘的类型 , 1:Dedicated 2:Autoreplace

[root@localhost ~]# arcconf setarrayparam 1 0 sparetype 1
Controllers found: 1

Command completed successfully.
[root@localhost ~]#</pre>

磁盘电灯:
命令 功能
arcconf identify controller_id device physical_id time time 对特定的物理硬盘进行点灯,time为可选项表示点灯持续的时间,单位为秒。
arcconf identify controller_id device physical_id 对特定的物理硬盘持续点灯,按任意键会停止点灯。
arcconf identify controller_id all time time 对所有的物理硬盘进行点灯,time为可选项表示点灯持续的时间,单位为秒。
arcconf identify controller_id all stop 对所有的物理硬盘停止点灯
arcconf identify controller_id logicaldrive LD_id time time 对特定的LD进行点灯,time为可选项表示点灯持续的时间,单位为秒。
arcconf identify controller_id logicaldrive LD_id 对特定的LD停止点灯
arcconf identify controller_id array array_id time time 对特定的Array进行点灯,time为可选项表示点灯持续的时间,单位为秒。
arcconf identify controller_id array array_id 对特定的Array停止点灯

[root@localhost ~]# ./arcconf identify 1 device 0 0
Controllers found: 1
Only devices managed by an enclosure processor may be identified
The specified device(s) is/are blinking.
Press any key to stop the blinking.</pre>

创建和删除raid
  • arcconf create controller_id logicaldrive option size level physical_id physical_id...... 创建raid, option为可以设置的选项: Stripesize 条带大小,取值为 16/32/64/128/256/512/1024 ; Name LD的名称; LDcache Controller Cache ; SSDOverProvisioningOptimization SSD的特性,取值为 enable / disable 只有当RAID组由SSD组成时,才能设置该属性。 该选项设置为“Enabled”后,会在数据写入SSD之前重新分配所有使用的块来优化SSD,可以加快初始化的速度。 DataLD 被加速的LD的ID
  • arcconf delete controller_id logicaldrive ld_id noprompt 删除raid

[root@localhost ~]# ./arcconf create 1 logicaldrive max 0 0 7
Controllers found: 1

Do you want to add a logical device to the configuration?
Press y, then ENTER to continue or press ENTER to abort: y

Creating logical device: LogicalDrv 1

Command completed successfully.

[root@localhost ~]# ./arcconf delete 1 logicaldrive 1 noprompt
Controllers found: 1

WARNING: Deleting this logical device will automatically delete array 1 because it is the only logical device present on that array.
All data in logical device 1 will be lost.
Deleting: logical device 1 ("LogicalDrv 1")

Command completed successfully.</pre>

磁盘cache:
  • arcconf getconfig controller_id ad 查询cache详情
  • arcconf setcache controller_id drivewritecachepolicy drivetype cachepolicy drivetype cachepolicy... 设置cache, drivetype : 要设置写Cache策略的硬盘类型 , Configured:设置RAID/Mixed模式下RAID组成员盘的写Cache策略。 Unconfigured:设置RAID/Mixed模式下非RAID组成员盘的写Cache策略 。 HBA:设置HBA模式下硬盘的写Cache策略; cachepolicy : 硬盘写Cache策略 , 0:Default(将硬盘的写Cache保持为默认状态) 。 1:Enabled(打开硬盘的写Cache功能) 。 2:Disabled(关闭硬盘的写Cache功能)

设置Configured状态的硬盘Cache写策略为Enabled,设置Unconfigured状态的硬盘Cache写策略为Disabled

[root@localhost ~]# ./arcconf setcache 1 drivewritecachepolicy Configured 1 Unconfigured 2
Controllers found: 1
Enabling controller drive write cache can increase write performance but risks losing the data in the cache on sudden loss.

Command completed successfully.

查询当前的硬盘写Cache策略

[root@localhost ~]# ./arcconf getconfig 1 ad
Controllers found: 1


Controller information

Controller Statue : Optimal
Controller Mode :Mixed
Channle description :SCSI

...

Physical Drive Write Cache Policy Information

Configured Drives :Enabled
Unconfigured Drives :Disabled
HBA Drives :Default


...</pre>

storcli介绍

安装:

官网下载https://www.broadcom.com/site-search?q=storcli rpm包安装

使用:

  • storcli64 -h 获取帮助信息
  • storcli64 show[all] 显示某一块raid卡的版本、功能、状态、以及raid卡下的物理磁、逻辑盘信息
  • storcli64 /cx show 显示控制器0的信息
  • storcli64 /cx show freespace 显示剩下的磁盘空间
  • storcli64 /cx set rebuildrate=x1 设置rebuildrate速度
  • storcli64 /cx show rebuildrate 显示重建速率
  • storcli64 /cx set patrolread=on or off 开启或关闭patrolread
  • storcli64 /cx set cc=on or off 开启或关闭rate
  • storcli64 /cx download file=filepath 升级raid卡固件,需要重启
  • storcli64 /cx flushcache 清除raid卡、物理磁盘cache
  • storcli64 /cx/eall/sall show 显示物理磁盘信息
  • storcli64 /cx/eall/sall show all 显示详细物理磁盘信息
  • storcli64 /cx/ex/sx set good/offline/online/missing 设置某块磁盘的状态
  • storcli64 /cx/ex/sx start locate 开启定位某块磁盘
  • storcli64 /cx/ex/sx stop locate 关闭磁盘定位
  • storcli64 /cx/ex/sx show rebuild 显示rebuild
  • storcli64 /cx/ex/sx start rebuild 开始rebuild
  • storcli64 /cx/ex/sx stop rebuild 停止rebuild
  • storcli64 /cx/ex/sx add hostsparedrive dgs=x 设置模块磁盘为diskgroup x 的热备盘
  • storcli64 /cx/ex/sx delete hostsparedrive 删除磁盘热备盘
磁盘JBOD:
  • storcli64 /cx[/ex]/sx set jbod 设置单盘jbod
  • storcli64 /cx[/ex]/sx show jbod 显示单盘jbod

[root@localhost ~]# /opt/MegaRAID/storcli/storcli64 /c0/e0/s1 show jbod
CLI Version = 007.1017.0000.0000 May 10, 2019
Operating system = Linux 3.10.0-957.el7.x86_64
Controller = 0
Status = Failure
Description = No JBODs have been configured

Detailed Status :


Drive Status ErrCd ErrMsg

/c0/e0/s1 Failure 255 Drive is not a JBOD
--------------------------------------------</pre>

  • storcli64 /cx[/ex]/sx del jbod [force] 删除磁盘jbod模式
  • storcli64 /cx show jbod 显示JBOD配置

[root@localhost ~]# /opt/MegaRAID/storcli/storcli64 /c0 show jbod
CLI Version = 007.1017.0000.0000 May 10, 2019
Operating system = Linux 3.10.0-957.el7.x86_64
Controller = 0
Status = Success
Description = None

Controller Properties :


Ctrl_Prop Value

JBOD OFF
----------------</pre>

  • storcli64 /cx set jbod=<on|off> [force] 设置raid控制器为JBOD模式
  • storcli64 /cx show jbodwritecache 显示raid控制器JBOD写cache配置
  • storcli64 /cx set jbodwritecache=on|off|default 设置磁盘写cache
磁盘CACHE:
  • storcli64 /c0/vall show all 显示raid虚拟设备的详细信息,Write Cache(initial setting)代表为raid卡的写cache,WriteThrough为关闭模式,WriteBack为开启cache,;Disk Cache Policy代表物理磁盘的cache

[root@localhost ~]# /opt/MegaRAID/storcli/storcli64 /c0/v12 show all
VD12 Properties :
===============
Strip Size = 256 KB
Number of Blocks = 7812499456
VD has Emulated PD = No
Span Depth = 1
Number of Drives Per Span = 1
Write Cache(initial setting) = WriteBack
Disk Cache Policy = Enabled
Encryption = None
Data Protection = Disabled
Active Operations = None
Exposed to OS = Yes
OS Drive Name = /dev/sdm
Creation Date = 27-04-2018
Creation Time = 03:20:44 AM
Emulation type = default
Cachebypass size = Cachebypass-64k
Cachebypass Mode = Cachebypass Intelligent
Is LD Ready for OS Requests = Yes
SCSI NAA Id = 6101b5442bcc70002275538c1c79b826
Unmap Enabled = N/A</pre>

  • storcli64 /c0/vall set pdcache=Off/On/Default 配置物理磁盘的cache,Off为关闭,On为开启,Default为默认值,当为Default时,cache取决于物理磁盘的cache,磁盘cache开启,则raid cache是开启的,否则为关闭。SATA磁盘cache默认为开启,SAS磁盘cache默认为关闭状态。
  • storcli64 /c0/vall set wrcache=wt/wb/awb 设置raid卡cache,wt为WriteThrough,wb为WiteBack,awb为AlwaysWriteBack。当cache为WriteBack时,如果raid卡存在电池,则cache为开启状态,如果没有电池则为WriteThrough状态;当cache为AlwaysWriteBack时,raid卡cache为总是开启状态
  • storcli64 /c0/bbu show 查看电容状态

[root@localhost ~]# /opt/MegaRAID/storcli/storcli64 /c0/bbu show
CLI Version = 007.1017.0000.0000 May 10, 2019
Operating system = Linux 3.10.0-957.el7.x86_64
Controller = 0
Status = Failure
Description = None

Detailed Status :


Ctrl Status Property ErrMsg ErrCd

0 Failed - use /cx/cv 255
--------------------------------------</pre>

  • storcli64 /c0 flushcache  刷新raid卡、物理磁盘cache
磁盘信息 :
  • storcli64 /c0/e0 show status  获取enclosure下磁盘风扇等设备的状态
  • storcli64 /cx/ex/sx set good/offline/online/missing  设置磁盘的状态
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 212,657评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,662评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 158,143评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,732评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,837评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,036评论 1 291
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,126评论 3 410
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,868评论 0 268
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,315评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,641评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,773评论 1 341
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,470评论 4 333
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,126评论 3 317
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,859评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,095评论 1 267
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,584评论 2 362
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,676评论 2 351

推荐阅读更多精彩内容