首页 > 代码库 > RAID1创建

RAID1创建

实验环境

wKiom1PtXQmCiKg0AAC6DSRnV44259.gif

wKioL1PtXs2B9VJUAAEqpEL7_lc616.gif

操作

wKioL1PtXviQ-SU-AAHHJNdwDp8847.gif

wKiom1PtXYGAxMc_AACeeqUHbKw330.gif

同样,对/dev/sdc进行两样的操作


简历RAID1

wKioL1PtX3vDUjKmAABcVqreSyo767.gif

创建文件系统

格式化该磁盘阵列


wKiom1PtXsaxh-lZAADM1eQr_wk806.gif

wKioL1PtYAaj0L_rAAAM9pfUUc0356.gif

在最后添加如下内容

/dev/md0        /data         ext4    defaults        0 0

wKiom1PtXxCjuUakAAEWM7Hh3tE914.gif

wKioL1PtYIOy_NuoAAAzT6ncCH4923.gif

模拟故障

30G删除, 只保留RAID1中另外一个成员。

wKioL1PtYNOjSErdAACd5h08r7E969.gif

demsg日志

sd 2:0:1:0: [sdb] Unhandled  error code

sd 2:0:1:0: [sdb] Result:  hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

sd 2:0:1:0: [sdb] CDB:  Write(10): 2a 00 00 00 00 47 00 00 01 00

md: super_written gets  error=-5, uptodate=0

md/raid1:md0: Disk failure on  sdb1, disabling device.

md/raid1:md0: Operation  continuing on 1 devices.

RAID1 conf printout:

--- wd:1 rd:2

disk 0, wo:1, o:0, dev:sdb1

disk 1, wo:0, o:1, dev:sdc1

RAID1 conf printout:

--- wd:1 rd:2

disk 1, wo:0, o:1, dev:sdc1

 

 

日志

sd 2:0:1:0: [sdb] Unhandled  error code

sd 2:0:1:0: [sdb] Result:  hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

sd 2:0:1:0: [sdb] CDB:  Write(10): 2a 00 00 00 00 47 00 00 01 00

md: super_written gets  error=-5, uptodate=0

md/raid1:md0: Disk failure on  sdb1, disabling device.

md/raid1:md0: Operation  continuing on 1 devices.

wKioL1PtYQjwzKGoAAAj6ID754Y908.gif

RAID1重建   

模拟恢复,还是30GB的硬盘,添加新的磁盘文件将30GB

wKioL1PtYSygRnWtAACSkTMKxxE588.gif

wKiom1PtYCCDNs1hAABTqOhxlXc671.gif

在线加入新组成单元

wKiom1PtYGjDmXiiAAAzbaYDca4054.gif


在日志中看到重建的过程

md: bind<sdb1>

md: recovery of RAID array  md0

md: minimum _guaranteed_  speed: 1000 KB/sec/disk.

md: using maximum available  idle IO bandwidth (but not more than 200000KB/sec) for recovery.

md: using 128k window, over a  total of 31438720k.

md: md0: recovery done..