MD RAID supports Grow but not Shrink
Describe the bug
One of my RAID Mirror disks was dying so I replaced it. After an unrelated issue with thinking I could/should remove the drive offline, replace, reboot, and extend (md freaks out and refuses with a mdadm: add new device failed for /dev/sdd as 2: Invalid argument error until I put back in the old drive and grow the array into the new drive) I successfully extended the mirror to three disks, and removed the dying disk. However even after reboot the array says it's degraded because it's expecting three total disks (one being removed.) I solved this with mdadm --grow /dev/md0 --raid-devices=2 to shrink the array back down to 2 disks. This isn't apparently supported in the GUI however, complicating disaster recovery.
To Reproduce
Steps to reproduce the behavior:
- Extend a 2-disk RAID Mirror array to 3 disks.
- After rebuild, properly remove one of the original disks using the OMV GUI.
- Note that despite no obvious issues, the array is listed in the GUI as degraded.
- Note that to get a "clean" array, logging in via SSH and running something like
mdadm --grow /dev/md0 --raid-devices=2is required, outside the normal OMV GUI.
Expected behavior
All basic NAS operations, especially when recovering from failure/disaster, should be possible and intuitive from within OMV.
openmediavault Server (please complete the following information):
- OS version: Linux openmediavault 6.12.12+bpo-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.12-1~bpo12+1 (2025-02-23) x86_64 GNU/Linux
- openmediavault version: 7.7.4-1
Source: openmediavault/openmediavault