Jul 072017
 

一直以来都希望解决一个问题,就是开机的情况下,对新增加的硬盘进行raid的设置。现在Ceph已经很流行,对于SATA磁盘来说,一般都是需要通过Raid卡设置成Raid0,这样可以利用Raid卡的Cache,性能更好。那么其实这个时候就带来一个问题,如果磁盘坏了,更换磁盘,那么就必须重启机器。

不同厂商的配置raid的工具不太一样,目前了解到的情况是

  1. Dell的产品 用PERC Cli
  2. 其他的厂商,浪潮啥,基本就用storcli

以前大家都是用Megacli,后来应该都改成Storcli,大家可以理解成是一个版本的更新把。都是一个厂商的东西。

访问 https://www.broadcom.com/

搜索 storcli

Snap13

 

下载回来,传到linux服务器上。

# rpm -ivh storcli-007.0205.0000.0000-1.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:storcli-007.0205.0000.0000-1     ################################# [100%]

为了管理方便,建立软连接

ln -s /opt/MegaRAID/storcli/storcli64 /bin/storcli
ln -s /opt/MegaRAID/storcli/storcli64 /sbin/storcli

 

基本命令

大家可以通过下面命令熟悉一下

storcli show
storcli show all
storcli show ctrlcount
storcli show help

通过help,你能看到一堆的命令

    /cx = Controller ID
    /vx = Virtual Drive Number.
    /ex = Enclosure ID
    /sx = Slot ID
# storcli /call /eall /sall show 
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.


Drive Information :
=================

----------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model               Sp 
----------------------------------------------------------------------------
252:0     4 Onln   0 446.625 GB SATA SSD N   N  512B INTEL SSDSC2BB480G4 U  
252:1     7 Onln   1 446.625 GB SATA SSD N   N  512B INTEL SSDSC2BB480G4 U  
252:2     5 Onln   2   931.0 GB SATA HDD N   N  512B ST91000640NS        U  
----------------------------------------------------------------------------

EID-Enclosure Device ID|Slt-Slot No.|DID-Device ID|DG-DriveGroup
DHS-Dedicated Hot Spare|UGood-Unconfigured Good|GHS-Global Hotspare
UBad-Unconfigured Bad|Onln-Online|Offln-Offline|Intf-Interface
Med-Media Type|SED-Self Encryptive Drive|PI-Protection Info
SeSz-Sector Size|Sp-Spun|U-Up|D-Down/PowerSave|T-Transition|F-Foreign
UGUnsp-Unsupported|UGShld-UnConfigured shielded|HSPShld-Hotspare shielded
CFShld-Configured shielded|Cpybck-CopyBack|CBShld-Copyback Shielded

call,eall,sall的含义,就是显示所有controller id,Enclousure ID, Slot ID

从上面信息,可以看出

  1. 只有一个控制器,id 为 0
  2. EID,Enclosure Device ID :252
  3. Slot Number,能看到 0,1,2
  4. DG:disk group,0,1,2
  5. size:容量,磁盘容量
  6. intf:接口,SATA
  7. Med:介质,ssd 或 hdd

理解完上面参数,就可以验证一下

# storcli /c0 /e252 /s0 show        
Controller = 0
Status = Success
Description = Show Drive Information Succeeded.


Drive Information :
=================

----------------------------------------------------------------------------
EID:Slt DID State DG       Size Intf Med SED PI SeSz Model               Sp 
----------------------------------------------------------------------------
252:0     4 Onln   0 446.625 GB SATA SSD N   N  512B INTEL SSDSC2BB480G4 U  

DID Device ID,能看到磁盘的id

# storcli /c0 /vall show
Controller = 0
Status = Success
Description = None


Virtual Drives :
==============

---------------------------------------------------------------
DG/VD TYPE  State Access Consist Cache Cac sCC       Size Name 
---------------------------------------------------------------
0/0   RAID0 Optl  RW     Yes     RWTD  -   ON  446.625 GB      
1/1   RAID0 Optl  RW     Yes     RWTD  -   ON  446.625 GB      
2/2   RAID0 Optl  RW     Yes     RWTD  -   ON    931.0 GB      
---------------------------------------------------------------

在控制器0下的vd情况。

 

参考文章

https://blog.hostonnet.com/megaraid

https://wiki.nikhef.nl/grid/Managing_RAID_Controllers

http://www.dell.com/support/article/us/en/19/SLN295890/13g-poweredge-servers—raid-controller-log-export-using-perccli-tool-on-windows-and-linux-hosts?lang=EN

http://www.dell.com/support/manuals/us/en/19/poweredge-rc-h330/perc_cli_rg_pub-v2/PERC-CLI-command-examples?guid=GUID-6ACDA18B-0685-4E71-82FF-1019EC7AAB5A&lang=en-us

  3 Responses to “storcli学习”

  1. 拜读了一下,可以做到 不重启了吗?

 Leave a Reply

(required)

(required)