[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