首先要了解一点历史。我有一个 4 磁盘 RAID5,其中一个磁盘发生故障。我将它从阵列中移除并使其处于降级状态一段时间:
mdadm --manage /dev/md127 --fail /dev/sde1 --remove /dev/sde1
我的数据需求突然下降,所以我决定将阵列永久减少到 3 个磁盘。然后我将文件系统缩小到比新数组大小小得多:
mdadm --grow /dev/md127 --array-size 35156183040 # reduces array size
mdadm --grow --raid-devices=3 /dev/md127 --backup-file /store/4TB_WD/md127.backup # reshape array removing 1 disk.
现在已经完成:
cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md127 : active raid5 sdd1[1] sdc1[3](S) sdb1[2]
35156183040 blocks super 1.2 level 5, 64k chunk, algorithm 2 [3/2] [_UU]
bitmap: 103/131 pages [412KB], 65536KB chunk
unused devices: <none>
但给我留下了一个 3 磁盘降级的 RAID5,其中有 2 个活动磁盘和一个备用磁盘:
mdadm -D /dev/md127
/dev/md127:
Version : 1.2
Creation Time : Fri Sep 9 22:39:53 2022
Raid Level : raid5
Array Size : 35156183040 (32.74 TiB 36.00 TB)
Used Dev Size : 17578091520 (16.37 TiB 18.00 TB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Fri Jan 20 11:12:10 2023
State : active, degraded
Active Devices : 2
Working Devices : 3
Failed Devices : 0
Spare Devices : 1
Layout : left-symmetric
Chunk Size : 64K
Consistency Policy : bitmap
Name : oldserver-h.oldserver.lan:127
UUID : 589dd683:d9945b24:768d9b2b:28441f90
Events : 555962
Number Major Minor RaidDevice State
- 0 0 0 removed
1 8 49 1 active sync /dev/sdd1
2 8 17 2 active sync /dev/sdb1
3 8 33 - spare /dev/sdc1
如何使这个备用磁盘处于活动状态,以便阵列可以重建到健康状态?cat /sys/block/md127/md/sync_action
显示idle
并回显repair
它什么都不做。
作为后续行动,我首先哪里出错了?
[编辑]lsblk
根据要求添加输出:
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 99G 0 part
├─clearos-root 253:0 0 91.1G 0 lvm /
└─clearos-swap 253:1 0 7.9G 0 lvm [SWAP]
sdb 8:16 0 16.4T 0 disk
└─sdb1 8:17 0 16.4T 0 part
└─md127 9:127 0 32.8T 0 raid5 /store/RAID_A
sdc 8:32 0 16.4T 0 disk
└─sdc1 8:33 0 16.4T 0 part
└─md127 9:127 0 32.8T 0 raid5 /store/RAID_A
sdd 8:48 0 16.4T 0 disk
└─sdd1 8:49 0 16.4T 0 part
└─md127 9:127 0 32.8T 0 raid5 /store/RAID_A
sde 8:64 0 3.7T 0 disk
└─sde1 8:65 0 3.7T 0 part /store/4TB_WD
sdf 8:80 0 931.5G 0 disk
└─sdf1 8:81 0 931.5G 0 part /store/1TB1
sdg 8:96 0 931.5G 0 disk
└─sdg1 8:97 0 931.5G 0 part /store/1TB2
sr0 11:0 1 1.2G 0 rom
[/编辑]