{"title": "\u4f7f\u7528hpacucli\u64cd\u4f5c\u548c\u67e5\u770bHP\u78c1\u76d8\u63a7\u5236\u5668\u7684raid", "update_time": "2014-02-10 09:37:12", "tags": "hpacucli", "pid": "200", "icon": "linux.png"}
HP提供了hpacucli工具,见 [链接](http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?swItem=MTX-66b08e49c28f4bd49f4641ed80) ## 查看磁盘PD和VD的状态 ``` #!/bin/bash slotid=`hpacucli ctrl all show status | grep 'Smart Array'|awk '{ print $6 }'` hpacucli ctrl slot=$slotid pd all show status hpacucli ctrl slot=$slotid ld all show status ``` ## 删除一个逻辑卷 ``` #!/bin/bash #LDID 是要删除的逻辑卷ID LDID='3' slotid=`hpacucli ctrl all show status | grep 'Smart Array'|awk '{ print $6 }'` hpacucli ctrl slot=$slotid ld $LDID delete ``` ## 创建一个逻辑卷 ``` #!/bin/bash slotid=`hpacucli ctrl all show status | grep 'Smart Array'|awk '{ print $6 }'` #以下命令的drivers根据情况修改,这里1I:1:3和1I:1:4分别标识了2块磁盘。以下这条命令用于将他们组建成RAID1 hpacucli ctrl slot=$slotid create type=ld drives=1I:1:3,1I:1:4 raid=1 ```