有时候新接手维护服务器,或者在考虑当前服务器容灾备份机制时,首先得知道服务器到底是否存在RAID卡,是否已经配置RAID。最简单的方式就是重启服务器,然后根据提示查看相关信息。但很多情况下不能随便重启机器,那么我们可以通过特定的操作系统命令,或者查看相关日志得到该信息。注:此处讨论的是硬件RAID,不包括软件RAID
# lspci | grep RAID
02:00.0 RAID bus controller: Hewlett-Packard Company Smart Array Gen8 Controllers (rev 01)
该命令查看了当前服务器是否存在RAID控制器,如果输出类似上面的信息,则表示硬件支持RAID,但实际是否配置以及如何配置还得进一步确定。
# dmesg |grep -i raid
dracut: rd_NO_DM: removing DM RAID activation
dracut: rd_NO_MD: removing MD RAID activation
hpsa 0000:02:00.0: RAID device c2b3t0l0 added.
scsi 2:3:0:0: RAID HP P420i 3.42 PQ: 0 ANSI: 5
如上所示,在系统日志中可以看到存在RAID设备,以及设备型号等信息。或者通过以下命令查看:
# cat /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: hp Model: DVDRAM GT80N Rev: EA02
Type: CD-ROM ANSI SCSI revision: 05
Host: scsi2 Channel: 03 Id: 00 Lun: 00
Vendor: HP Model: P420i Rev: 3.42
Type: RAID ANSI SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 00
Vendor: HP Model: LOGICAL VOLUME Rev: 3.42
Type: Direct-Access ANSI SCSI revision: 05
Host: scsi2 Channel: 00 Id: 00 Lun: 01
Vendor: HP Model: LOGICAL VOLUME Rev: 3.42
Type: Direct-Access ANSI SCSI revision: 05
该命令显示了当前系统做完RAID后的磁盘个数,其中第二项显示为RAID磁盘,但没有显示RAID级别。
该部分内容通常无法通过系统自带命令或日志进行查询,需要使用RAID设备厂商提供的专用软件查看,此处以HP(惠普)服务器为例,进行演示。
下载工具
可通过官方网站下载工具 hpacucli-9.40-12.0.x86_64.rpm 点击此处
安装工具
# rpm -ivh hpacucli-9.40-12.0.x86_64.rpm
工具使用
# hpacucli ctrl all show config
Smart Array P420i in Slot 0 (Embedded) (sn: 50014380263D1E40)
array A (SAS, Unused Space: 0 MB)
logicaldrive 1 (279.4 GB, RAID 1, OK)
physicaldrive 1I:2:1 (port 1I:box 2:bay 1, SAS, 300 GB, OK)
physicaldrive 2I:2:5 (port 2I:box 2:bay 5, SAS, 300 GB, OK)
array B (SAS, Unused Space: 0 MB)
logicaldrive 2 (1.1 TB, RAID 0, OK)
physicaldrive 1I:2:2 (port 1I:box 2:bay 2, SAS, 300 GB, OK)
physicaldrive 1I:2:3 (port 1I:box 2:bay 3, SAS, 300 GB, OK)
physicaldrive 2I:2:6 (port 2I:box 2:bay 6, SAS, 300 GB, OK)
physicaldrive 2I:2:7 (port 2I:box 2:bay 7, SAS, 300 GB, OK)
SEP (Vendor ID PMCSIERA, Model SRCv8x6G) 380 (WWID: 50014380263D1E4F)
# hpacucli ctrl all show config detail
Smart Array P420i in Slot 0 (Embedded)
Bus Interface: PCI
Slot: 0
Serial Number: 50014380263D1E40
Cache Serial Number: PBKUC0BRH4J3G6
RAID 6 (ADG) Status: Disabled
Controller Status: OK
Hardware Revision: B
Firmware Version: 3.42
Rebuild Priority: Medium
Expand Priority: Medium
Surface Scan Delay: 3 secs
Surface Scan Mode: Idle
Queue Depth: Automatic
Monitor and Performance Delay: 60 min
Elevator Sort: Enabled
Degraded Performance Optimization: Disabled
Inconsistency Repair Policy: Disabled
Wait for Cache Room: Disabled
Surface Analysis Inconsistency Notification: Disabled
Post Prompt Timeout: 15 secs
Cache Board Present: True
Cache Status: OK
Cache Ratio: 10% Read / 90% Write
Drive Write Cache: Disabled
Total Cache Size: 1024 MB
Total Cache Memory Available: 816 MB
No-Battery Write Cache: Disabled
Cache Backup Power Source: Capacitors
Battery/Capacitor Count: 1
Battery/Capacitor Status: OK
SATA NCQ Supported: True
Spare Activation Mode: Activate on drive failure
Controller Temperature (C): 68
Cache Module Temperature (C): 36
Capacitor Temperature (C): 28
Array: A
Interface Type: SAS
Unused Space: 0 MB
Status: OK
Array Type: Data
Logical Drive: 1
Size: 279.4 GB
Fault Tolerance: 1
Heads: 255
Sectors Per Track: 32
Cylinders: 65535
Strip Size: 256 KB
Full Stripe Size: 256 KB
Status: OK
Caching: Enabled
Unique Identifier: 600508B1001C66AE8BFFC07021D139D8
Disk Name: /dev/sda
Mount Points: /boot 200 MB, / 279.2 GB
OS Status: LOCKED
Logical Drive Label: A84609D850014380263D1E4034C5
Mirror Group 0:
physicaldrive 1I:2:1 (port 1I:box 2:bay 1, SAS, 300 GB, OK)
Mirror Group 1:
physicaldrive 2I:2:5 (port 2I:box 2:bay 5, SAS, 300 GB, OK)
Drive Type: Data
Caching Association: None
physicaldrive 1I:2:1
Port: 1I
Box: 2
Bay: 1
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 10000
Firmware Revision: HPD6
Serial Number: EB01PD21MUW01306
Model: HP EG0300FBDSP
Current Temperature (C): 35
Maximum Temperature (C): 42
PHY Count: 2
PHY Transfer Rate: 6.0Gbps, Unknown
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
physicaldrive 2I:2:5
Port: 2I
Box: 2
Bay: 5
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 10000
Firmware Revision: HPD6
Serial Number: EB01PCC1L8861251
Model: HP EG0300FBDSP
Current Temperature (C): 34
Maximum Temperature (C): 41
PHY Count: 2
PHY Transfer Rate: 6.0Gbps, Unknown
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
Array: B
Interface Type: SAS
Unused Space: 0 MB
Status: OK
Array Type: Data
Logical Drive: 2
Size: 1.1 TB
Fault Tolerance: 0
Heads: 255
Sectors Per Track: 32
Cylinders: 65535
Strip Size: 256 KB
Full Stripe Size: 256 KB
Status: OK
Caching: Enabled
Unique Identifier: 600508B1001CD6F301652A600B3E372A
Disk Name: /dev/sdb
Mount Points: /mnt/u01 1.1 TB
OS Status: LOCKED
Logical Drive Label: A846B29850014380263D1E403EF7
Drive Type: Data
Caching Association: None
physicaldrive 1I:2:2
Port: 1I
Box: 2
Bay: 2
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 10000
Firmware Revision: HPD1
Serial Number: ECA1PAC00GH11050
Model: HP EG0300FBDSP
Current Temperature (C): 34
Maximum Temperature (C): 44
PHY Count: 2
PHY Transfer Rate: 6.0Gbps, Unknown
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
physicaldrive 1I:2:3
Port: 1I
Box: 2
Bay: 3
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 10000
Firmware Revision: HPD6
Serial Number: EB01PD21MUYN1306
Model: HP EG0300FBDSP
Current Temperature (C): 33
Maximum Temperature (C): 45
PHY Count: 2
PHY Transfer Rate: 6.0Gbps, Unknown
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
physicaldrive 2I:2:6
Port: 2I
Box: 2
Bay: 6
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 10000
Firmware Revision: HPD6
Serial Number: EB01PD21MVFN1306
Model: HP EG0300FBDSP
Current Temperature (C): 32
Maximum Temperature (C): 43
PHY Count: 2
PHY Transfer Rate: 6.0Gbps, Unknown
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
physicaldrive 2I:2:7
Port: 2I
Box: 2
Bay: 7
Status: OK
Drive Type: Data Drive
Interface Type: SAS
Size: 300 GB
Rotational Speed: 10000
Firmware Revision: HPD6
Serial Number: EB01PD21MVF51306
Model: HP EG0300FBDSP
Current Temperature (C): 31
Maximum Temperature (C): 44
PHY Count: 2
PHY Transfer Rate: 6.0Gbps, Unknown
Drive Authentication Status: OK
Carrier Application Version: 11
Carrier Bootloader Version: 6
SEP (Vendor ID PMCSIERA, Model SRCv8x6G) 380
Device Number: 380
Firmware Version: RevB
WWID: 50014380263D1E4F
Vendor ID: PMCSIERA
Model: SRCv8x6G
上图所示,服务器做了两个RAID,分别是Array A 和 Array B,前者由两块硬盘组建了RAID 1,后者由四块硬盘组建了RAID 0。