附件鏈接:https://files.cnblogs.com/files/lilin-77/storcli64.tar

 

1、上傳storcli64文件到服務器  

 

  1.1 沒有操作系統情況

      在自己的Llinux系統中安裝tftp服務

      安裝tftp服務

      # yum -y install tftp tftp-server xinetd

      修改tftp配置文件

# service tftp

# vim /etc/xinetd.d/tftp

~~~~~~~~~~~~~~~~~~~

# default: off

# description: The tftp server serves files using the trivial file transfer \

#       protocol.  The tftp protocol is often used to boot diskless \

#       workstations, download configuration files to network-aware printers, \

#       and to start the installation process for some operating systems.

service tftp

{

        socket_type             = dgram

        protocol                = udp

        wait                    = yes

        user                    = root

        server                  = /usr/sbin/in.tftpd

        server_args             = -s /tftpboot -c

        disable                 = no

        per_source              = 11

        cps                     = 100 2

        flags                   = IPv4

}

~

 

       重啟xinetd服務

# service xinetd restart

# systemctl restart xinetd.service

停止 xinetd:                                              [確定]

正在啟動 xinetd:                                         [確定]

 

      新建/tftpboot目錄

      # mkdir /tftpboot

      復制storcli64文件到/tftpboot

      # cp storcli64 /tftpboot/

      將設備開機進入BIOS 

      配置BIOS靜態IP(由于要從tftp服務器下載文件,所以需配置IP與tftp服務端連通)

      方法:BIOS界面System configuration 選項內,選靜態,添加與tftp服務端同網段IP掩碼,網關即可

 

 Network:       ( ) Default interfaces

                      ( ) DHCP on a specific interface

                         (*) Static IP configuration

 

  Device:        (*) enP1p3s0 [00:08:d2:ee:04:b7, link up]        

                    (  ) tunl0 [00:00:00:00:08:00, link down]         

 

  IP/mask:       192.168.169.201  / 24          (eg. 192.168.0.10 / 24)

  Gateway:       192.168.169.1                      (eg. 192.168.0.1)

  URL:                                                        (eg. tftp://)

  DNS Server(s):                                          (eg. 192.168.0.2)

 

  Disk R/W:      ( ) Prevent all writes to disk

                      (*) Allow bootloader scripts to modify disks

 

                 [    OK    ]  [  Cancel  ]  [ Security ][ ClearPW  ]

 

      進shell界面 Exit to shell

      從BIOS shell中執行下載192.168.10.19tftp服務器中的storcli64

      # tftp -g 192.168.169.200 -r storcli64

      將storcli64文件授予可執行權限

      # chmod +x storcli64

 

  1.2 有操作系統情況

      進入并登錄操作系統

      將storcli64文件 傳入系統中 可用多種方法(SCP 或用WinSCP.exe軟件)

      # scp root@192.168.10.19:/root/storcli64 .   上傳

      # chmod +x storcli64   授權

 

2、查看磁盤狀態   

# ./storcli64 /c0 show 

Generating detailed summary of the adapter, it may take a while to complete.

 

Controller = 0

Status = Success

Description = None

 

Product Name = LSI MegaRAID 9361-8i

Serial Number = SV52977539

SAS Address =  500605b00a965090

PCI Address = 00:01:00:00

System Time = 05/16/2016 11:37:26

Mfg. Date = 07/17/15

FW Package Build = 24.3.0-0050

BIOS Version = 6.17.04.0_4.16.08.00_0x06060A01

FW Version = 4.230.20-3532

Driver Name = megaraid_sas

Driver Version = 06.807.10.00-rh1

Vendor Id = 0x1000

Device Id = 0x5D

SubVendor Id = 0x1000

SubDevice Id = 0x9361

Host Interface = PCI-E

Device Interface = SAS-12G

Bus Number = 1

Device Number = 0

Function Number = 0

Physical Drives = 4

 

PD LIST :

=======

 

-----------------------------------------------------------------------------

EID:Slt DID State DG     Size Intf Med SED PI SeSz Model                  Sp

-----------------------------------------------------------------------------

13:8      27  UGood -  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:9      28  UGood -  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:10    29  UGood -  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:11    30  UGood -  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

-----------------------------------------------------------------------------

 

      注:現在磁盤狀態為UGood狀態,表示可以直接制作raid

      若磁盤狀態為JBOD,則制作raid時會出錯,必須將JBOD狀態修改為UGood狀態,才能正常制作raid

      制作raid失敗信息

      Controller = 0

      Status = Failure

      Description = physical disk does not have appropriate attributes

      修改磁盤狀態(將JBOG關閉)./storcli64 /c0 set jbod=off  (on為開啟)

[root@localhost ~]# ./storcli64 /c0 set jbod=off

Controller = 0

Status = Success

Description = None

 

 

Controller Properties :

=====================

 

----------------

Ctrl_Prop Value

----------------

JBOD      OFF  

----------------

 

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|T-Transition|F-Foreign

UGUnsp-Unsupported|UGShld-UnConfigured shielded|HSPShld-Hotspare shielded

CFShld-Configured shielded|Cpybck-CopyBack|CBShld-Copyback Shielded

 

Cachevault_Info :

===============

------------------------------------

Model  State   Temp Mode MfgDate   

------------------------------------

CVPM03 Optimal 42C  -    2015/09/06

------------------------------------

 

3、制作RAID  

    注:EID:Slt為磁盤號,在做RAID時需要依據此來區分磁盤

-----------------------------------------------------------------------------

EID:Slt DID State DG     Size Intf Med SED PI SeSz Model                  Sp

-----------------------------------------------------------------------------

13:8      27 UGood -  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:9      28 UGood -  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:10    29 UGood -  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:11    30 UGood -  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

-----------------------------------------------------------------------------

 

  3.1制作RAID0

# ./storcli64 /c0 add vd type=raid0 size=all name=zoomtech drives=13:8-9 wb ra   

Controller = 0

Status = Success

Description = Add VD Succeeded

 

RAID0創建成功 v0表示RAID號 name為RAID名稱,可隨意設置

13:8-9 表示上圖中前兩塊磁盤

 

    3.1.1查看RAID狀態

# ./storcli64 /c0 /v0 show

Controller = 0

Status = Success

Description = None

 

 

Virtual Drives :

==============

 

-------------------------------------------------------------

DG/VD TYPE  State Access Consist Cache sCC     Size Name    

-------------------------------------------------------------

0/0   RAID0  Optl  RW     Yes     RWTD  -   3.637 TB zoomtech

-------------------------------------------------------------

 

 

    3.1.2查看磁盤狀態

      可看到13:8  13:9這兩塊磁盤的狀態變為Onln狀態,而且可看到RAID0狀態(標注部分)DG的數字變為0

 

[root@localhost ~]# ./storcli64 /c0 show

Drive Groups = 1

TOPOLOGY :

========

------------------------------------------------------------------------

DG Arr Row EID:Slot DID Type  State BT     Size PDC  PI SED DS3  FSpace

------------------------------------------------------------------------

 0 -   -   -        -   RAID0 Optl  N  3.637 TB dflt N  N   dflt N     

 0 0   -   -        -   RAID0 Optl  N  3.637 TB dflt N  N   dflt N     

 0 0   0   13:8     27  DRIVE Onln  N  1.818 TB dflt N  N   dflt -     

 0 0   1   13:9     28  DRIVE Onln  N  1.818 TB dflt N  N   dflt -     

------------------------------------------------------------------------

DG=Disk Group Index|Arr=Array Index|Row=Row Index|EID=Enclosure Device ID

DID=Device ID|Type=Drive Type|Onln=Online|Rbld=Rebuild|Dgrd=Degraded

Pdgd=Partially degraded|Offln=Offline|BT=Background Task Active

PDC=PD Cache|PI=Protection Info|SED=Self Encrypting Drive|Frgn=Foreign

DS3=Dimmer Switch 3|dflt=Default|Msng=Missing|FSpace=Free Space Present

Virtual Drives = 1

VD LIST :

=======

-------------------------------------------------------------

DG/VD TYPE  State Access Consist Cache sCC     Size Name    

-------------------------------------------------------------

0/0   RAID0 Optl  RW     Yes     RWTD  -   3.637 TB zoomtech

-------------------------------------------------------------

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded

Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|B=Blocked|Consist=Consistent|

R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|

AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled

Check Consistency

Physical Drives = 4

PD LIST :

=======

-----------------------------------------------------------------------------

EID:Slt DID State DG     Size Intf Med SED PI SeSz Model                  Sp

-----------------------------------------------------------------------------

13:8     27 Onln   0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:9     28 Onln   0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:10    29 UGood  - 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 D 

13:11    30 UGood  - 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 D

 

    3.1.3fdisk -l查看

# fdisk -l

磁盤 /dev/sda:500.0 GB, 500023951360 字節,976609280 個扇區

Units = 扇區 of 1 * 512 = 512 bytes

扇區大小(邏輯/物理):512 字節 / 512 字節

I/O 大小(最小/最佳):512 字節 / 512 字節

磁盤標簽類型:dos

磁盤標識符:0x000a213d

 

   設備 Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048       10239        4096   41  PPC PReP Boot

/dev/sda2           10240     1034239      512000   83  Linux

/dev/sda3         1034240   863358975   431162368   83  Linux

/dev/sda4       863358976   976609279    56625152    5  Extended

/dev/sda5       863363072   968220671    52428800   83  Linux

/dev/sda6       968222720   976609279     4193280   82  Linux swap / Solaris

 

磁盤 /dev/sde:3999.7 GB, 3999688294400 字節,7811891200 個扇區

Units = 扇區 of 1 * 512 = 512 bytes

扇區大小(邏輯/物理):512 字節 / 512 字節

I/O 大小(最小/最佳):512 字節 / 512 字節

 

  3.2制作RAID1

#  ./storcli64 /c0 add vd type=raid1 size=all name=zoomtech drives=13:10-11 wb ra

Controller = 0

Status = Success

Description = Add VD Succeeded

 

    3.2.1查看RAID狀態

# ./storcli64 /c0 /v1 show (因為之后將8  9 兩塊磁盤做了RAID0 所以這里是v1)

Controller = 0

Status = Success

Description = None

Virtual Drives :

==============

-------------------------------------------------------------

DG/VD TYPE  State Access Consist Cache sCC     Size Name    

-------------------------------------------------------------

1/1   RAID1 Optl  RW     No      RWTD  -   1.818 TB zoomtech

-------------------------------------------------------------

 

    3.2.2查看磁盤狀態

# ./storcli64 /c0 show

Virtual Drives = 2

VD LIST :

=======

-------------------------------------------------------------

DG/VD TYPE  State Access Consist Cache sCC     Size Name    

-------------------------------------------------------------

0/0   RAID0 Optl  RW     Yes     RWTD  -   3.637 TB zoomtech

1/1   RAID1 Optl  RW     No      RWTD  -   1.818 TB zoomtech

-------------------------------------------------------------

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded

Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|B=Blocked|Consist=Consistent|

R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|

AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled

Check Consistency

Physical Drives = 4

PD LIST :

=======

-----------------------------------------------------------------------------

EID:Slt DID State DG     Size Intf Med SED PI SeSz Model                  Sp

-----------------------------------------------------------------------------

13:8      27 Onln   0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:9      28 Onln   0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:10    29 Onln   1 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:11    30 Onln   1 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

-----------------------------------------------------------------------------

 

    3.2.3 fdisk -l查看

# fdisk -l

磁盤 /dev/sda:500.0 GB, 500023951360 字節,976609280 個扇區

Units = 扇區 of 1 * 512 = 512 bytes

扇區大小(邏輯/物理):512 字節 / 512 字節

I/O 大小(最小/最佳):512 字節 / 512 字節

磁盤標簽類型:dos

磁盤標識符:0x000a213d

 

   設備 Boot      Start         End      Blocks   Id  System

/dev/sda1   *        2048       10239        4096   41  PPC PReP Boot

/dev/sda2           10240     1034239      512000   83  Linux

/dev/sda3         1034240   863358975   431162368   83  Linux

/dev/sda4       863358976   976609279    56625152    5  Extended

/dev/sda5       863363072   968220671    52428800   83  Linux

/dev/sda6       968222720   976609279     4193280   82  Linux swap / Solaris

 

磁盤 /dev/sde:3999.7 GB, 3999688294400 字節,7811891200 個扇區

Units = 扇區 of 1 * 512 = 512 bytes

扇區大小(邏輯/物理):512 字節 / 512 字節

I/O 大小(最小/最佳):512 字節 / 512 字節

磁盤 /dev/sdf:1999.8 GB, 1999844147200 字節,3905945600 個扇區

Units = 扇區 of 1 * 512 = 512 bytes

扇區大小(邏輯/物理):512 字節 / 512 字節

I/O 大小(最小/最佳):512 字節 / 512 字節

 

  3.3制作RAID5/10

制作raid5:

 ./storcli64 /c0 add vd type=raid5 size=all name=zoomtech drives=14:2-6 wb ra

制作raid10:

storcli64 /c0 add vd type=raid10 size=all name=spider drives=14:8-11 cached wb ra  pdperarray=2

打印信息參考以上內容

 

4、刪除RAID  

 

RAID是根據VD來標識的,刪除時根據VD刪除即可

# ./storcli64 /c0 /v0 del

Controller = 0

Status = Success

Description = Delete VD succeeded

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# ./storcli64 /c0 /v1 del

Controller = 0

Status = Success

Description = Delete VD succeeded

 

5、RAID磁盤恢復  

      RAID10特性

      將相鄰的兩塊磁盤先做RAID1 (8和9 做RAID1 10和11做RAID1),然后在RAID1的基礎上做RAID0

      對做好的RAID10磁盤進行分區

      [root@localhost ~]# parted /dev/sde

      GNU Parted 3.1

      使用 /dev/sde

      Welcome to GNU Parted! Type 'help' to view a list of commands.

      (parted) mktable gpt

      (parted) mkpart sde1 0G 800G

      (parted) quit

      對新建的分區進行格式化

      [root@localhost ~]# mkfs.ext4 /dev/sde1

      將新分區進行掛載

      mount /dev/sde1 /raid/

      新建文件

      [root@localhost raid]# ls

      lost+found

      將其中兩塊塊磁盤拔出,查看磁盤狀態

[root@localhost ~]# ./storcli64 /c0 show

Virtual Drives = 1

 

VD LIST :

=======

 

--------------------------------------------------------------

DG/VD TYPE   State Access Consist Cache sCC     Size Name    

--------------------------------------------------------------

0/0   RAID10 Dgrd  RW     No      RWTD  -   3.637 TB zoomtech

--------------------------------------------------------------

 

Cac=CacheCade|Rec=Recovery|OfLn=OffLine|Pdgd=Partially Degraded|dgrd=Degraded

Optl=Optimal|RO=Read Only|RW=Read Write|HD=Hidden|B=Blocked|Consist=Consistent|

R=Read Ahead Always|NR=No Read Ahead|WB=WriteBack|

AWB=Always WriteBack|WT=WriteThrough|C=Cached IO|D=Direct IO|sCC=Scheduled

Check Consistency

 

Physical Drives = 2

 

PD LIST :

=======

 

-----------------------------------------------------------------------------

EID:Slt DID State DG     Size Intf Med SED PI SeSz Model                  Sp

-----------------------------------------------------------------------------

13:10    29 Onln   0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:11    30 Onln   0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U

 

      若換新盤,查看磁盤狀態直接會顯示rebuild狀態,不需做任何操作,若插入原盤,狀態改變為UBad狀態,

      則需要進行一些操作

  5.1放入原盤后變為UBad狀態

      查看磁盤信息后顯示:

 

[root@localhost ~]# storcli64 /c0 show 

-----------------------------------------------------------------------------

EID:Slt DID State DG     Size Intf Med SED PI SeSz                Model                                Sp

-----------------------------------------------------------------------------

13:     29 UBad   0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:9      29 UBad   0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:10    29 Onln    0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U 

13:11    30 Onln    0 1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U

 

  5.2改變磁盤狀態

      將磁盤狀態修改為UGood狀態

      命令格式:【./storcli64 /c0 /e13 /s8 set good force】

      /e13 這里的13 對應磁盤信息中的EID

      /s8    這里的  8 對應磁盤信息中的Slt

[root@localhost ~]# ./storcli64 /c0 /e13 /s8 set good force

Controller = 0

Status = Success

Description = Set Drive Good Succeeded.

 

      注:一般情況下參數后面不需要加force ,

      若執行失敗時,需要將force加上才能修改成功

      查看磁盤修改后的狀態

 

[root@localhost ~]# ./storcli64 /c0 /e13 /s8 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

-----------------------------------------------------------------------------

13:8     27 UGood F  1.818 TB SATA HDD N   N  512B WDC WD2000FYYZ-01UL1B2 U

 

  5.3 初始化磁盤

 

[root@localhost ~]# ./storcli64 /c0 /e13 /s8 start initialization

Controller = 0

Status = Success

Description = Start Drive Initialization Succeeded.

 

  5.4 查看初始化進度剛到30%,要等到100%才能繼續操作,

 

[root@localhost ~]# ./storcli64 /c0 /e13 /s8 show initialization

Controller = 0

Status = Success

Description = Show Drive Initialization Status Succeeded.

 

-----------------------------------------------------

Drive-ID   Progress% Status      Estimated Time Left

-----------------------------------------------------

/c0/e13/s4        30 In progress 18 Minutes         

-----------------------------------------------------

 

 

  5.5查看rebuild進度

 

[root@localhost ~]# ./storcli64 /c0 /e13 /sall show rebuild    

Controller = 0

Status = Success

Description = Show Drive Rebuild Status Succeeded.

 

----------------------------------------------------------

Drive-ID    Progress% Status          Estimated Time Left

----------------------------------------------------------

/c0/e13/s8         78 In progress     1 Hours 7 Minutes  

/c0/e13/s9          - Not in progress -                  

/c0/e13/s10         - Not in progress -                  

/c0/e13/s11         - Not in progress -     

 

  5.6磁盤恢復后查看掛載目錄的文件是否存在,內容是否和原來一樣