6

I'm trying to stop a RAID disk in order to replace it by a new one, as this one is not working properly.

I'm typing mdadm --stop /dev/md1, and I'm getting an error message:

mdadm: fail to stop array /dev/md1: Device or resource busy

I'm getting this message even if I reboot the server, and I can't see a process that could cause this.

The server is working under a Debian with a 2.6.18-4-amd64 kernel. Could you help?

Edit: More details about what my colleague tried out.

After unmounting sda1, the command mdadm --remove /dev/md0 /dev/sda1 worked. But now, we still have an error message after mdadm --remove /dev/md1 /dev/sda5:

mdadm: hot remove failed for /dev/sda5: Device or resource busy

I still don't understand completly how the different partitions are mounted, so I suppose there is something I don't understand in the currenct situation...

Alexis Dufrenoy
  • 235
  • 1
  • 3
  • 11

5 Answers5

7

/dev/md1 is the RAID array itself. You need to stop a particular participant in that array. Try:

mdadm --fail /dev/md0 /dev/sda1
mdadm --remove /dev/md0 /dev/sda1

This is a good resource: http://www.excaliburtech.net/archives/19

If you need to move all the participating devices, then you need to do this one by one, waiting for the array to rebuild after each device swap.

Sunny
  • 5,834
  • 3
  • 22
  • 24
1

I delete partition table:

dd if=/dev/zero of=/dev/md0 bs=512 count=1024

then reboot then it works.

slm
  • 7,615
  • 16
  • 56
  • 76
1

In my case i have to do some more tricks for XEN Server

Step # 1 dd if=/dev/zero of=/dev/md0 bs=512 count=1024

Step # 2 -- Reboot the server

Step # 3

[root@localhost ~]# mdadm --stop /dev/md0 --force

and then

[root@localhost ~]# mdadm --remove /dev/md0 --force
Mansur Ul Hasan
  • 262
  • 3
  • 9
0

In my case the problem solved with the above commands.

mdadm --manage --fail /dev/md0
mdadm --manage --remove /dev/md0

Before executing them I wipe the /dev/md0 area using the dd command,

dd if=/dev/zero of=/dev/md0
-1

I had the same problem and after trying zillion things, this worked for me:

mdadm --manage --stop /dev/md0

That totally removed md0 from the array.

slm
  • 7,615
  • 16
  • 56
  • 76