[root@localhost desktop]# mdadm -s /dev/md5 停止raid mdadm: stopped /dev/md5 [root@localhost desktop]# mdadm -a /dev/md5 激活raid mdadm: /dev/md5 has been started with 4 drives and 1 spare. [root@localhost desktop]# mkfs.ext4 /dev/md5
6.删除有问题的磁盘,添加一个好的磁盘作热备,要求磁盘>容量一致 mdadm /dev/md5 -r /dev/sde[de] -a /dev/sd【gh】
[root@localhost ~]# cat /proc/mdstat 查看raid的构建过程 personalities : [raid6] [raid5] [raid4] md5 : active raid5 sde[5] sdf[4](s) sdd[2] sdc[1] sdb[0] 3144192 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [uuu_] [=============>.......] recovery = 68.5% (719232/1048064) finish=0.0min speed=143846k/sec [root@localhost file]# mdadm -d /dev/md5 /dev/md5: version : 1.2 creation time : sun jul 21 01:19:25 2013 raid level : raid5 array size : 3144192 (3.00 gib 3.22 gb) used dev size : 1048064 (1023.67 mib 1073.22 mb) raid devices : 4 total devices : 5 persistence : superblock is persistent
update time : sun jul 21 01:44:49 2013 state : clean active devices : 4 working devices : 5 failed devices : 0 spare devices : 1
layout : left-symmetric chunk size : 512k
name : lvm:5 (local to host lvm) uuid : e433a3d5:94c67839:5e66cae5:e4976d17 events : 68
number major minor raiddevice state 0 8 16 0 active sync /dev/sdb 1 8 32 1 active sync /dev/sdc 4 8 80 2 active sync /dev/sdf 6 8 112 3 active sync /dev/sdh
number major minor raiddevice state 0 8 16 0 active sync /dev/sdb 1 8 32 1 active sync /dev/sdc 4 8 80 2 active sync /dev/sdf 5 8 96 3 active sync /dev/sdg
6 8 112 - faulty spare /dev/sdh
[root@localhost file]# mdadm /dev/md5 -f /dev/sdh [root@localhost file]# mdadm -d /dev/md5 /dev/md5: state : clean, degraded, recovering active devices : 3 working devices : 4 failed devices : 1 spare devices : 1 number major minor raiddevice state 0 8 16 0 active sync /dev/sdb 1 8 32 1 active sync /dev/sdc 4 8 80 2 active sync /dev/sdf 5 8 96 3 spare rebuilding /dev/sdg