Description of problem: Using short parameter for mdadm -r (remove device) doesn't work. It's silently ignored. Tested on multiple centos8 stream servers. Version-Release number of selected component (if applicable): mdadm-4.2-rc3.el8.x86_64 How reproducible: always Steps to Reproduce: 1. create/assemble /dev/md0 device 2. mdadm --manage /dev/md0 -r /dev/vdxxxx Actual results: Nothing, empty output, nothing happens, device is still contents of the array. Expected results: Should write at least an error, that device doesn't exist or display success. mdadm: stat failed for /dev/vdxxx: No such file or directory Additional info: Using --remove instead of -r works, but according to documentation -r should work too and some script are already using it. Some examples: [root@srv ~]# mdadm /dev/md1 -r /dev/vdxxx [root@srv ~]# mdadm --manage /dev/md1 -r /dev/vdxxx [root@srv ~]# mdadm --manage /dev/md1 --remove /dev/vdxxx mdadm: stat failed for /dev/vdxxx: No such file or directory [root@srv ~]#
https://www.spinics.net/lists/raid/msg69409.html
I think this issue is fixed on mdadm-4.2-2.el9.x86_64 [root@localhost ~]# mdadm /dev/md0 -r /dev/vdb2 mdadm: hot removed /dev/vdb2 from /dev/md0 [root@localhost ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sr0 11:0 1 1024M 0 rom vda 252:0 0 10G 0 disk ├─vda1 252:1 0 1G 0 part /boot └─vda2 252:2 0 9G 0 part ├─cs-root 253:0 0 8G 0 lvm / └─cs-swap 253:1 0 1G 0 lvm [SWAP] vdb 252:16 0 10G 0 disk ├─vdb1 252:17 0 953M 0 part │ └─md0 9:0 0 952M 0 raid1 └─vdb2 252:18 0 953M 0 part [root@localhost ~]# rpm -q mdadm mdadm-4.2-2.el9.x86_64 [root@localhost ~]#
Same problem on Fedora 35, mdadm-4.2-1.fc35.x86_64.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (mdadm bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:2087