给 RAID5 添加热备盘
创建 RAID5 时设置 1 块热备盘;
[root@zhpj ~]# mdadm -Cv /dev/md5 -n 3 -l 5 -x 1 /dev/sd{b..e}
mdadm: layout defaults to left-symmetric
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 512K
mdadm: size set to 10476544K
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md5 started.
[root@zhpj ~]#
[root@zhpj ~]# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid10] [raid6] [raid5] [raid4]
md5 : active raid5 sdd[4] sde[3](S) sdc[1] sdb[0]
20953088 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [UU_]
[=>...................] recovery = 9.4% (990556/10476544) finish=0.6min speed=247639K/sec
unused devices: <none>
[root@zhpj ~]#
[root@zhpj ~]# mdadm -D /dev/md5
/dev/md5:
Version : 1.2
Creation Time : Sun Aug 11 20:43:45 2024
Raid Level : raid5
Array Size : 20953088 (19.98 GiB 21.46 GB)
Used Dev Size : 10476544 (9.99 GiB 10.73 GB)
Raid Devices : 3
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Sun Aug 11 20:44:24 2024
State : clean, degraded, recovering
Active Devices : 2
Working Devices : 4
Failed Devices : 0
Spare Devices : 2
Layout : left-symmetric
Chunk Size : 512K
Consistency Policy : resync
Rebuild Status : 78% complete
Name : zhpj.com:5 (local to host zhpj.com)
UUID : 67b6c832:892ea5d8:975505f9:528f99e0
Events : 13
Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 8 32 1 active sync /dev/sdc
4 8 48 2 spare rebuilding /dev/sdd
3 8 64 - spare /dev/sde
[root@zhpj ~]#
/dev/sdb
模拟为故障,热备盘 /dev/sde
会自动替换上去;
RAID5允许坏一块磁盘,热备盘替换上去之后,还允许再坏一块磁盘:
移除两块坏掉的硬盘:
向 RAID5 添加磁盘:
向 RAID5 添加热备盘:
标签:热备,zhpj,dev,RAID5,添加,Devices,mdadm From: https://www.cnblogs.com/zhpj/p/18364034/add-heating-disk-to-raid5-zavvhj