Bug 2083951

Summary: mdadm -r (short parameter) ignored
Product: [Fedora] Fedora Reporter: Jan ONDREJ <ondrejj>
Component: mdadmAssignee: XiaoNi <xni>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 36CC: agk, bstinson, dledford, ffan, jes.sorensen, jwboyer, ncroxon, xni
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2041837 Environment:
Last Closed: 2023-05-25 19:32:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2041837    
Bug Blocks:    

Description Jan ONDREJ 2022-05-11 05:47:23 UTC
+++ This bug was initially created as a clone of Bug #2041837 +++

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-1.fc36.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 ~]#

--- Additional comment from Nigel Croxon on 2022-02-10 15:08:08 CET ---

https://www.spinics.net/lists/raid/msg69409.html

--- Additional comment from Fine Fan on 2022-02-25 18:53:10 CET ---

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 ~]#

--- Additional comment from Jan ONDREJ on 2022-04-12 09:51:55 CEST ---

Same problem on Fedora 35, mdadm-4.2-1.fc35.x86_64.

--- Additional comment from errata-xmlrpc on 2022-05-10 17:29:19 CEST ---

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

Comment 1 Ben Cotton 2023-04-25 18:24:07 UTC
This message is a reminder that Fedora Linux 36 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '36'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 36 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 2 Ludek Smid 2023-05-25 19:32:23 UTC
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16.

Fedora Linux 36 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.