Bug 2041837 - mdadm -r (short parameter) ignored
Summary: mdadm -r (short parameter) ignored
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: mdadm
Version: CentOS Stream
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nigel Croxon
QA Contact: Fine Fan
URL:
Whiteboard:
Depends On:
Blocks: 2083951
TreeView+ depends on / blocked
 
Reported: 2022-01-18 11:08 UTC by Jan ONDREJ
Modified: 2022-05-11 05:47 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2083951 (view as bug list)
Environment:
Last Closed: 2022-05-10 15:29:19 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-108439 0 None None None 2022-01-18 11:10:27 UTC
Red Hat Product Errata RHBA-2022:2087 0 None None None 2022-05-10 15:29:29 UTC

Description Jan ONDREJ 2022-01-18 11:08:45 UTC
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 ~]#

Comment 1 Nigel Croxon 2022-02-10 14:08:08 UTC
https://www.spinics.net/lists/raid/msg69409.html

Comment 4 Fine Fan 2022-02-25 17:53:10 UTC
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 ~]#

Comment 5 Jan ONDREJ 2022-04-12 07:51:55 UTC
Same problem on Fedora 35, mdadm-4.2-1.fc35.x86_64.

Comment 8 errata-xmlrpc 2022-05-10 15:29:19 UTC
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


Note You need to log in before you can comment on or make changes to this bug.