管理ubuntu服务器上的阵列

一台DELL R710服务器,ubuntu server系统,基于自身6块硬盘,做了一个RAID5,但最近有一块硬盘坏掉了,让服务商换了一块上来。今天想远程看看这块硬盘是否起作用了,没有找到合适的方法,于是一通搜索开始学习。

1. 确认服务器上的阵列卡

lspci -v | grep LSI

 

如果能看到对应的输出,说明采用的是主板上的LSI RAID卡,需要megacli命令来控制。

2. 安装megacli命令

从LSI官网找到对应的下载链接,在本机下载后,再scp到服务器上(不能直接在服务器上wget获取),然后解压,进入Linux目录,有一个rpm安装文件。因为服务器是ubuntu,所以使用一个命令来进行处理:

apt-get install rpm2cpio

rpm2cpio MegaCli-*.rpm | cpio -idmv

 

 

即将rpm安装包的内容直接提取出来。进入提取后的目录,可以发现有一个opt/MegaRAID/MegaCli目录,将这个目录的MegaCli64命令拷贝到/usr/loca/sbin/目录下(服务器是64位系统)。

sudo cp MegaCli64 /usr/local/sbin/

 

然后还可以从参考1中添加一个lsi.sh脚本来更容易的和RAID交互(注意脚本中的参数需要和机器上的实际进行修改,即:

# The identifying number of the enclosure. Default for our systems is "8". Use
# "MegaCli64 -PDlist -a0 | grep "Enclosure Device"" to see what your number
# is and set this variable.
ENCLOSURE="8"

 

参考1中的默认值是8,服务器上的是32。

3. 使用和问题处理

sudo lsi.sh drives

 

发现有一个问题:

Slot Number: 0 - Online, Spun Up
Slot Number: 1 - Online, Spun Up
Slot Number: 2 - Online, Spun Up
Slot Number: 3 - Online, Spun Up
Slot Number: 4 - Online, Spun Up
Slot Number: 5 - Unconfigured(good), Spun Up

 

第6块硬盘,即slot5,是新加的,虽然识别了,但未配置。

sudo lsi.sh status

结果如下:

 

Adapter 0 -- Virtual Drive Information:
Virtual Drive: 0 (Target Id: 0)
Name :disk1
RAID Level : Primary-5, Secondary-0, RAID Level Qualifier-3
Size : 4.545 TB
Sector Size : 512
Parity Size : 931.0 GB
State : Degraded

 

注意,State这行的状态是degraded,说明raid5状态没有起来,新加的这块盘没有发挥作用。

于是继续搜索,寻找让其能rebuild的方法,从参考2中找到了一个对应的方法:

MegaCli64 -PdReplaceMissing -PhysDrv[32:5] -array0 -row5 -a0

MegaCli64 -PDRbld -Start -PhysDrv[32:5] -a0

 

 

这样就开始rebuild了。

参考:

1. MegaCLI Scripts and Commands

2. RAID: Rebuilding a Foreign disk by hand


已发布

分类

来自

标签:

评论

《 “管理ubuntu服务器上的阵列” 》 有 14 条评论

  1. wlx 的头像
    wlx

    用同样的方法检查了另外一台服务器,2个硬盘,RAID1,已经坏掉1块了。

  2. online order enclomiphene generic online pharmacy

    how to order enclomiphene purchase prescription

  3. sans ordonnance kamagra buy online en ligne a bon compte

    fedex kamagra sans ordonnance

  4. online order androxal cheap from usa

    cheap androxal generic in usa

  5. cheapest buy flexeril cyclobenzaprine united kingdom

    buy flexeril cyclobenzaprine generic in usa

  6. how can i order dutasteride without a perscrption

    discount dutasteride no perscription

  7. how to get womens fildena ad whas the cost

    buy fildena toronto canada

  8. buying gabapentin cheap from india

    purchase gabapentin purchase uk

  9. cheapest buy itraconazole generic how effective

    how to buy itraconazole buy online canada

  10. get staxyn generic health

    how to order staxyn cheap to buy online

  11. over the counter sales of avodart in ireland

    order avodart uk buy online

  12. get rifaximin generic tablets

    Generic rifaximin tablets

  13. ordering xifaxan without recipe

    Next day fedex shipping for xifaxan

  14. kamagra prodeje v usa

    kanadská lékárna kamagra pilulky

回复 get avodart united kingdom 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注