[root@53 ~]# mkfs.ext4 /dev/md0 mke2fs 1.42.9 (28-Dec-2013) 文件系统标签= OS type: Linux 块大小=4096 (log=2) 分块大小=4096 (log=2) Stride=128 blocks, Stripe width=256 blocks 2621440 inodes, 10477056 blocks 523852 blocks (5.00%) reserved for the super user 第一个数据块=0 Maximum filesystem blocks=2157969408 320 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624
Allocating group tables: 完成 正在写入inode表: 完成 Creating journal (32768 blocks): 完成 Writing superblocks and filesystem accounting information: 完成
[root@53 ~]# mdadm -D /dev/md0 /dev/md0: Version : 1.2 Creation Time : Mon Jul 25 04:40:30 2022 Raid Level : raid10 Array Size : 41908224 (39.97 GiB 42.91 GB) Used Dev Size : 20954112 (19.98 GiB 21.46 GB) Raid Devices : 4 Total Devices : 4 Persistence : Superblock is persistent
Update Time : Wed Jul 27 01:54:59 2022 State : clean Active Devices : 4 Working Devices : 4 Failed Devices : 0 Spare Devices : 0
Layout : near=2 Chunk Size : 512K
Consistency Policy : resync
Name : 53:0 (local to host 53) UUID : 01af1583:0b79c2e7:ae64d91a:f68e8e39 Events : 17
Number Major Minor RaidDevice State 0 8 16 0 active sync set-A /dev/sdb 1 8 32 1 active sync set-B /dev/sdc 2 8 48 2 active sync set-A /dev/sdd 3 8 64 3 active sync set-B /dev/sde
[root@53 ~]# mdadm /dev/md0 -f /dev/sdb mdadm: set /dev/sdb faulty in /dev/md0 [root@53 ~]# mdadm -D /dev/md0 /dev/md0: Version : 1.2 Creation Time : Mon Jul 25 04:40:30 2022 Raid Level : raid10 Array Size : 41908224 (39.97 GiB 42.91 GB) Used Dev Size : 20954112 (19.98 GiB 21.46 GB) Raid Devices : 4 Total Devices : 4 Persistence : Superblock is persistent
Update Time : Wed Jul 27 02:07:03 2022 State : clean, degraded Active Devices : 3 Working Devices : 3 Failed Devices : 1 Spare Devices : 0
Layout : near=2 Chunk Size : 512K
Consistency Policy : resync
Name : 53:0 (local to host 53) UUID : 01af1583:0b79c2e7:ae64d91a:f68e8e39 Events : 19
Number Major Minor RaidDevice State - 0 0 0 removed 1 8 32 1 active sync set-B /dev/sdc 2 8 48 2 active sync set-A /dev/sdd 3 8 64 3 active sync set-B /dev/sde
0 8 16 - faulty /dev/sdb
刚刚使用的-f参数是让硬盘模拟损坏的效果。为了能够彻底地将故障盘移除,还要再执行一步操作:
1 2
[root@53 ~]# mdadm /dev/md0 -r /dev/sdb mdadm: hot removed /dev/sdb from /dev/md0