New to RAID and Linux. I grew my RAID5 array from 3 to 4 devices. For other reasons, I had to fail and remove one of the 4 drives - sda1
. I'd like to shrink it now back to 3 devices, but when trying to do so, I'm getting a new_offset
error:
# mdadm --grow --raid-devices=3 /dev/md127
mdadm: Cannot set new_offset for /dev/sdb1
Some notes:
The array is mounted at
/
, so I'd like to avoid having to unmount it.There is data on the array, so I'd like to preserve it.
RAID details:
/dev/md127:
Version : 1.1
Creation Time : Mon Oct 22 16:20:37 2012
Raid Level : raid5
Array Size : 1953518592 (1863.02 GiB 2000.40 GB)
Used Dev Size : 976759296 (931.51 GiB 1000.20 GB)
Raid Devices : 4
Total Devices : 3
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Tue Nov 8 17:09:28 2016
State : active, degraded
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Delta Devices : 1, (3->4)
Name : xxx
UUID : xxx
Events : 275192
Number Major Minor RaidDevice State
3 8 49 0 active sync /dev/sdd1
2 0 0 2 removed
4 8 33 2 active sync /dev/sdc1
6 8 17 3 active sync /dev/sdb1
Can I fail and remove /dev/sdb1
from the array? I imagine that would solve the error message, but I worry that in growing the array to 4 devices, failing 2 of them will render it irreparable. If that can't be done, what can be?
Update
Worked around the headache. rsync
ed the contents of the degraded array to a backup drive, replaced the RAID with fresh-baked drives, then rsync
ed back.