附件链接: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:8 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磁盘恢复后查看挂载目录的文件是否存在,内容是否和原来一样