root@titan ~ umount /dev/md4
root@titan ~ mdadm --misc /dev/md4 --stop
root@titan ~ mdadm --manage /dev/md4 --remove /dev/sdb7
mdadm: hot remove failed for /dev/sdb7: Device or resource busy
If I remember well you have to first set the device as faulty with --fail before --remove could be accepted.
But if this is the last device you can erase the partition to remove RAID informations.
On Sat, 11 Jan 2025, Michel Verdier wrote:
If I remember well you have to first set the device as faulty with --fail before --remove could be accepted.
No luck :
root@titan ~ mdadm --fail /dev/md4 --remove /dev/sdb7
mdadm: hot remove failed for /dev/sdb7: Device or resource busy
On Sat, Jan 11, 2025 at 13:10:51 +0100, Roger Price wrote:
On Sat, 11 Jan 2025, Michel Verdier wrote:
If I remember well you have to first set the device as faulty with --fail before --remove could be accepted.
No luck :
root@titan ~ mdadm --fail /dev/md4 --remove /dev/sdb7
mdadm: hot remove failed for /dev/sdb7: Device or resource busy
Is it mounted? Is it being used as swap?
Sent: Saturday, January 11, 2025 at 9:51 AM
From: "Roger Price" <debian@rogerprice.org>
To: "debian-user Mailing List" <debian-user@lists.debian.org>
Subject: Re: Removing an unwanted RAID 1 array
On Sat, 11 Jan 2025, Greg Wooledge wrote:
On Sat, Jan 11, 2025 at 13:10:51 +0100, Roger Price wrote:
On Sat, 11 Jan 2025, Michel Verdier wrote:
If I remember well you have to first set the device as faulty with --fail
before --remove could be accepted.
No luck :
root@titan ~ mdadm --fail /dev/md4 --remove /dev/sdb7
mdadm: hot remove failed for /dev/sdb7: Device or resource busy
Is it mounted? Is it being used as swap?
No it's not mounted - I ran umount /dev/md4. It's not being used as swap.
rprice@titan ~ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
...
└─sdb7 8:23 0 20G 0 part
└─md124 9:124 0 20G 0 raid1
I tried commenting out the entry for md4 in /etc/mdadm/mdadm.conf . I then ran
update-initramfs -u as instructed in the mdadm.conf file.
I then rebooted, but md4 reappeared as /dev/md124.
I am unable to erase an unwanted RAID 1 array. Command cat /proc/mdstat reported
md4 : active raid1 sdb7[0]
20970368 blocks super 1.0 [2/1] [U_]
bitmap: 1/1 pages [4KB], 65536KB chunk
I understand that the array has to be inactive before it can be removed, so I >stopped it, but was not able to remove the array
root@titan ~ umount /dev/md4
root@titan ~ mdadm --misc /dev/md4 --stop
root@titan ~ mdadm --manage /dev/md4 --remove /dev/sdb7
mdadm: hot remove failed for /dev/sdb7: Device or resource busy
The command ps -ef | grep md4 reports
root 211 2 0 Jan09 ? 00:00:00 [md4_raid1]
I assume process 211 is keeping md4 busy. Do I have to kill process 211 or is >there some more elegant way? Or is it mdadm itself in process 663 which is >keeping md4 busy?
root@titan ~ mdadm --misc /dev/md4 --stop
This is incorrect syntax, and a no-op (so the array did not stop). You want `mdadm --misc --stop /dev/md4`. The --misc is implied so you can just use `mdadm --stop /dev/md4`
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 155:04:27 |
Calls: | 10,383 |
Files: | 14,054 |
Messages: | 6,417,848 |