How do I make a spare device active in a degraded mdadm RAID5
2
votes
2
answers
6241
views
A bit of history to start with. I had a 4 disk RAID5 and one disk failed. I removed it from the array and had it in a degraded state for a while:
mdadm --manage /dev/md127 --fail /dev/sde1 --remove /dev/sde1
My data requirement suddenly dropped so I decided to permanently reduce the array to 3 disks. I shrank the file system to much less than the new array size then:
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.
This has now completed:
cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md127 : active raid5 sdd1 sdc1(S) sdb1
35156183040 blocks super 1.2 level 5, 64k chunk, algorithm 2 [3/2] [_UU]
bitmap: 103/131 pages [412KB], 65536KB chunk
unused devices:
but has left me with a 3 disk degraded RAID5 with 2 active disks and one spare:
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
How do I make this spare disk active so the array can rebuild to a healthy state? cat /sys/block/md127/md/sync_action
shows idle
and echoing repair
into it does nothing.
As a follow up, where did I go wrong in the first place?
[edit]
Adding output to lsblk
as requested:
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
[/edit]
Asked by NickH
(23 rep)
Jan 20, 2023, 11:33 AM
Last activity: Nov 4, 2024, 06:44 AM
Last activity: Nov 4, 2024, 06:44 AM