mdadm: hot remove failed for…
Try:
echo "idle" > /sys/block/md0/md/sync_action
mdadm /dev/md0 --remove /dev/sdb1
worked for me.
Related videos on Youtube
![tamasgal](https://i.stack.imgur.com/76Iiz.jpg?s=256&g=1)
tamasgal
My name is Tamás Gál, I am an astroparticle physicist and working at Erlangen Centre for Astroparticle Physics (ECAP). I currently develop online monitoring and live reconstruction algorithms for the KM3NeT neutrino telescopes and maintain the IT services of KM3NeT and ECAP. My DevOps engineering skills include Docker (+Swarm), GitLab CI/CD, Jenkins, Xen, OpenVZ, Ansible and more than two decades of experience with Linux and BSD as system administrator. I spend most of my time with science (astroparticle physics), coding (Julia, Python, …) and electronics (both analog/digital); the rest preferably off the road with one of my motorbikes. I have an obsession to repair things and keep them alive as long as possible, no matter if it requires a gearbox restoration of my BMW R1100 GS or replacing a dead 0201 SMD capacitor on a MacBook logicboard. Furthermore, I love making music and spend a lot of time on my DIY modular synthesizer. #SOreadytohelp
Updated on September 18, 2022Comments
-
tamasgal almost 2 years
My RAID1 is degraded and I need to replace /dev/sdb. However, I could mark /dev/sdb5 (in /dev/md1) as failed and removed it, but I can't do the same with /dev/sdb1 (/dev/md0 which is mounted on /):
root@kes:~# mdadm /dev/md0 --fail /dev/sdb1 mdadm: set /dev/sdb1 faulty in /dev/md0 root@kes:~# mdadm --detail /dev/md0 /dev/md0: Version : 00.90 Creation Time : Wed Apr 7 03:00:39 2010 Raid Level : raid1 Array Size : 975185536 (930.01 GiB 998.59 GB) Used Dev Size : 975185536 (930.01 GiB 998.59 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Mon Feb 13 12:27:41 2012 State : active, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 1 Spare Devices : 0 UUID : cdc01e79:774eba08:ade2cb46:d0df0469 (local to host kes) Events : 0.67569047 Number Major Minor RaidDevice State 0 8 1 0 active sync /dev/sda1 2 8 17 1 faulty spare rebuilding /dev/sdb1 root@kes:~# mdadm /dev/md0 --remove /dev/sdb1 mdadm: hot remove failed for /dev/sdb1: Device or resource busy
So what am I doing wrong?
-
Admin over 12 yearsI suspect it's because it still thinks it's rebuilding - is it really? (check
/proc/mdstat
) -
Admin over 12 yearsProbably, but how would I stop it? (I had to do a restart, after that the problem was solved)
-
-
Paul Gear about 6 yearsWorth checking the current contents with
cat /sys/block/md0/md/sync_action
before you overwrite them, too.