摘要: 通过hp提供的工具hpacucli可以在CentOS 6.x x64中管理HP 服务器的RAID卡. # which hpacucli /usr/sbin/hpacucli # rpm -qf /usr/sbin/hpacucli hpacucli-8.
通过hp提供的工具hpacucli可以在CentOS 6.x x64中管理HP 服务器的RAID卡.
# which hpacucli
/usr/sbin/hpacucli
# rpm -qf /usr/sbin/hpacucli
hpacucli-8.75-12.0.i386
例如我们在服务器上新插入了两块硬盘, 还没有配置RAID.
首先要列出RAID卡控制器的信息 :
# hpacucli ctrl all show detail config Smart Array P410i in Slot 0 (Embedded) Bus Interface: PCI Slot: 0 Serial Number: 5001438006EC4FF0 Cache Serial Number: PACCQ9SYB5GI RAID 6 (ADG) Status: Disabled Controller Status: OK Hardware Revision: Rev C Firmware Version: 2.00 Rebuild Priority: Medium Expand Priority: Medium Surface Scan Delay: 15 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: 0 secs Cache Board Present: True Cache Status: Permanently Disabled Accelerator Ratio: 100% Read / 0% Write Drive Write Cache: Disabled Total Cache Size: 256 MB No-Battery Write Cache: Disabled Battery/Capacitor Count: 0 SATA NCQ Supported: True Array: A Interface Type: SAS Unused Space: 0 MB Status: OK Logical Drive: 1 Size: 136.7 GB Fault Tolerance: RAID 1 Heads: 255 Sectors Per Track: 32 Cylinders: 35132 Strip Size: 128 KB Status: OK Array Accelerator: Permanently Disabled Unique Identifier: 600508B1001030364543344646300700 Disk Name: /dev/sda Mount Points: / 32.0 GB Logical Drive Label: A007D0B35001438006EC4FF07327 Mirror Group 0: physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) Mirror Group 1: physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK) physicaldrive 1I:1:1 Port: 1I Box: 1 Bay: 1 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 10000 Firmware Revision: HPD5 Serial Number: D0A1P9C0AHBC0950 Model: HP EG0146FARTR Current Temperature (C): 31 Maximum Temperature (C): 36 PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 1I:1:2 Port: 1I Box: 1 Bay: 2 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 10000 Firmware Revision: HPD5 Serial Number: D0A1P9B09VWD0948 Model: HP EG0146FARTR Current Temperature (C): 31 Maximum Temperature (C): 35 PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown unassigned physicaldrive 1I:1:3 Port: 1I Box: 1 Bay: 3 Status: OK Drive Type: Unassigned Drive Interface Type: SATA Size: 1 TB Firmware Revision: AA0D Serial Number: 9XG79JC3 Model: ATA ST91000640NS SATA NCQ Capable: True SATA NCQ Enabled: True Current Temperature (C): 31 Maximum Temperature (C): 54 PHY Count: 1 PHY Transfer Rate: 3.0GBPS physicaldrive 1I:1:4 Port: 1I Box: 1 Bay: 4 Status: OK Drive Type: Unassigned Drive Interface Type: SATA Size: 1 TB Firmware Revision: AA0D Serial Number: 9XG79GF7 Model: ATA ST91000640NS SATA NCQ Capable: True SATA NCQ Enabled: True Current Temperature (C): 31 Maximum Temperature (C): 53 PHY Count: 1 PHY Transfer Rate: 3.0GBPS SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 Device Number: 250 Firmware Version: RevC WWID: 5001438006EC4FFF Vendor ID: PMCSIERA Model: SRC 8x6G
从上面的信息可以看到两块盘还没有被指派给RAID, 使用下面的命令, 创建一个RAID1
# hpacucli ctrl slot=0 create type=ld drives=1I:1:3,1I:1:4 raid=1
在dmesg中可以看到, 执行完上面的命令后, 添加了一个盘 :
hpsa 0000:03:00.0: Direct-Access device c0b0t0l1 added. scsi 0:0:0:1: Direct-Access HP LOGICAL VOLUME 2.00 PQ: 0 ANSI: 5 sd 0:0:0:1: Attached scsi generic sg2 type 0 sd 0:0:0:1: [sdb] 1953459632 512-byte logical blocks: (1.00 TB/931 GiB) sd 0:0:0:1: [sdb] Write Protect is off sd 0:0:0:1: [sdb] Mode Sense: 6b 00 00 08 sd 0:0:0:1: [sdb] Write cache: disabled, read cache: disabled, doesn't support DPO or FUA sdb: unknown partition table sd 0:0:0:1: [sdb] Attached SCSI disk
这时, 使用fdisk也可以看到盘了 :
# fdisk -l Disk /dev/sda: 146.8 GB, 146778685440 bytes 255 heads, 63 sectors/track, 17844 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x020a0000 Device Boot Start End Blocks Id System /dev/sda1 * 1 4178 33554432 83 Linux /dev/sda2 4178 5222 8388608 82 Linux swap / Solaris Disk /dev/sdb: 1000.2 GB, 1000171331584 bytes 255 heads, 63 sectors/track, 121597 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0xd24b3da5
再次查看RAID卡的信息 :
# hpacucli ctrl all show detail config Smart Array P410i in Slot 0 (Embedded) Bus Interface: PCI Slot: 0 Serial Number: 5001438006EC4FF0 Cache Serial Number: PACCQ9SYB5GI RAID 6 (ADG) Status: Disabled Controller Status: OK Hardware Revision: Rev C Firmware Version: 2.00 Rebuild Priority: Medium Expand Priority: Medium Surface Scan Delay: 15 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: 0 secs Cache Board Present: True Cache Status: Permanently Disabled Accelerator Ratio: 100% Read / 0% Write Drive Write Cache: Disabled Total Cache Size: 256 MB No-Battery Write Cache: Disabled Battery/Capacitor Count: 0 SATA NCQ Supported: True Array: A Interface Type: SAS Unused Space: 0 MB Status: OK Logical Drive: 1 Size: 136.7 GB Fault Tolerance: RAID 1 Heads: 255 Sectors Per Track: 32 Cylinders: 35132 Strip Size: 128 KB Status: OK Array Accelerator: Permanently Disabled Unique Identifier: 600508B1001030364543344646300700 Disk Name: /dev/sda Mount Points: / 32.0 GB Logical Drive Label: A007D0B35001438006EC4FF07327 Mirror Group 0: physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK) Mirror Group 1: physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, OK) physicaldrive 1I:1:1 Port: 1I Box: 1 Bay: 1 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 10000 Firmware Revision: HPD5 Serial Number: D0A1P9C0AHBC0950 Model: HP EG0146FARTR Current Temperature (C): 31 Maximum Temperature (C): 36 PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown physicaldrive 1I:1:2 Port: 1I Box: 1 Bay: 2 Status: OK Drive Type: Data Drive Interface Type: SAS Size: 146 GB Rotational Speed: 10000 Firmware Revision: HPD5 Serial Number: D0A1P9B09VWD0948 Model: HP EG0146FARTR Current Temperature (C): 31 Maximum Temperature (C): 35 PHY Count: 2 PHY Transfer Rate: 6.0GBPS, Unknown Array: B Interface Type: SATA Unused Space: 0 MB Status: OK Logical Drive: 2 Size: 931.5 GB Fault Tolerance: RAID 1 Heads: 255 Sectors Per Track: 32 Cylinders: 65535 Strip Size: 256 KB Status: OK Array Accelerator: Permanently Disabled Unique Identifier: 600508B1001030364543344646300800 Disk Name: /dev/sdb Mount Points: None Logical Drive Label: A53D4BD25001438006EC4FF0381B Mirror Group 0: physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SATA, 1 TB, OK) Mirror Group 1: physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SATA, 1 TB, OK) physicaldrive 1I:1:3 Port: 1I Box: 1 Bay: 3 Status: OK Drive Type: Data Drive Interface Type: SATA Size: 1 TB Firmware Revision: AA0D Serial Number: 9XG79JC3 Model: ATA ST91000640NS SATA NCQ Capable: True SATA NCQ Enabled: True Current Temperature (C): 31 Maximum Temperature (C): 54 PHY Count: 1 PHY Transfer Rate: 3.0GBPS physicaldrive 1I:1:4 Port: 1I Box: 1 Bay: 4 Status: OK Drive Type: Data Drive Interface Type: SATA Size: 1 TB Firmware Revision: AA0D Serial Number: 9XG79GF7 Model: ATA ST91000640NS SATA NCQ Capable: True SATA NCQ Enabled: True Current Temperature (C): 31 Maximum Temperature (C): 53 PHY Count: 1 PHY Transfer Rate: 3.0GBPS SEP (Vendor ID PMCSIERA, Model SRC 8x6G) 250 Device Number: 250 Firmware Version: RevC WWID: 5001438006EC4FFF Vendor ID: PMCSIERA Model: SRC 8x6G
[参考]
1. man hpacucli
HPACUCLI(8) User Manuals HPACUCLI(8) NAME hpacucli - HP Command Line Array Configuration Utility SYNOPSIS hpacucli [-option] DESCRIPTION hpacucli is the command line disk configuration utility for HP array controllers. Please refer to /opt/compaq/hpacucli/bld/hpacucli-VERSION.noarch.txt for detailed documentation. OPTIONS Please use hpacucli --help for the up-to-date options supported by this version of hpacucli. FILES /opt/compaq/hpacucli/bld/hpacucli-VERSION.noarch.txt /usr/sbin/hpacucli Linux Sep 2002 HPACUCLI(8)
2.
# hpacucli help CLI Syntax A typical ACU CLI command line consists of three parts: a target device, a command, and a parameter with values if necessary. Using angle brackets to denote a required variable and plain brackets to denote an optional variable, the structure of a typical ACU CLI command line is as follows:[parameter=value] is of format: [controller all|slot=#|wwn=#|chassisname="AAA"| serialnumber=#|chassisserialnumber=#|ctrlpath=#:# ] [array all| ] [physicaldrive all|allunassigned|[#:]#:#|[#:]#:#-[#:]#:#] [ssdphysicaldrive all|allunassigned|[#:]#:#|[#:]#:#-[#:]#:#] [logicaldrive all|#] [enclosure all|#:#|serialnumber=#|chassisname=#] [licensekey all| ] [ssdinfo] Note 1: The #:#:# syntax is only needed for systems that specify port:box:bay. Other physical drive targeting schemes are box:bay and port:id. Note 2: The chassisserialnumber is known in ACU as the RAID Array Serial Number. The chassisname is known in ACU as the RAID Array ID. Note 3: ctrlpath=#:# maps to "smart enclosure hooked up to host bus adapter slot:host bus adapter port" Example targets: controller slot=5 controller chassisname="Lab C" controller serialnumber=P21DA2322S controller chassisserialnumber=9J3CJN71XDCH controller wwn=500308B300701011 controller slot=7 array A controller slot=5 logicaldrive 5 controller slot=5 physicaldrive 1:5 controller slot=5 physicaldrive 1E:2:3 controller slot=5 ssdphysicaldrive all controller slot=5 enclosure 4E:1 show controller slot=5 licensekey XXXXX-XXXXX-XXXXX-XXXXX-XXXXX For detailed command information type any of the following: help add help create help delete help diag help modify help remove help shorthand help show help target help rescan help version Help also accepts commonly used CLI parameters and ACU keywords. Adding additional keywords will further filter the help output. Examples: help ssp (shows all ssp help including show and modify commands) help ssp modify (restricts ssp help to only modify commands) help migrate help expand help extend help ... Please note that beginning with ACU/ACUCLI version 8.55, the term "stripe size" has been replaced by "strip size." This is a change of labeling and does not signify a change in functionality. When distributing data across multiple physical drives (striping) the "strip size" is the amount of data that is written to each physical drive. The "full stripe size" refers to the combined size of all the strips across all physical drives, excluding parity-only drives.