mdadm --remove does not remove failed component

Bug #2026889 reported by Andrei Caraman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)
New
Undecided
Unassigned

Bug Description

mdadm 4.2-0ubuntu2 on jammy:

mdadm doesn't remove failed components from raid1 device and returns a 0 exit code. Using the actual device name instead of "failed" or "detached" doesn't make a difference.

root@server:~# cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md1 : active raid1 sdc2[2] sda2[3] sdb2[4](F)
      975581912 blocks super 1.2 [2/2] [UU]
      bitmap: 1/2 pages [4KB], 262144KB chunk

md9 : active raid1 sdc1[2] sda1[0] sdb1[1](F)
      1046528 blocks super 1.2 [2/2] [UU]

unused devices: <none>
root@server:~# mdadm /dev/md9 -r detached
root@server:~# mdadm /dev/md1 -r detached
root@server:~# mdadm /dev/md9 -r failed
root@server:~# mdadm /dev/md1 -r failed
root@server:~# $?
0: command not found
root@server:~# cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md1 : active raid1 sdc2[2] sda2[3] sdb2[4](F)
      975581912 blocks super 1.2 [2/2] [UU]
      bitmap: 1/2 pages [4KB], 262144KB chunk

md9 : active raid1 sdc1[2] sda1[0] sdb1[1](F)
      1046528 blocks super 1.2 [2/2] [UU]

unused devices: <none>
root@server:~#

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.