-1

I have two RAID5 arrays, 1 array for /boot and for /. The arrays both consist of three partitions:
MD0: /boot
MD1: /

My problem is, if I detached a disk (disappear) then mdadm prints that a drive went wrong. Okay no problem, but this message only from MD1. And the MD0 doesn't say anything. Look this:

md1 : active raid5 sda2[3](F) sdb2[2] sdc2[1]
      7383040 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [_UU]

md0 : active raid5 sda1[3] sdb1[2] sdc1[1]
      995328 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

The sda drive disappeared but only in MD1 array. I can detached the drive from MD1 with the following command: mdadm /dev/md1 -r detached. Because the drive not existing.

But I can't detached from MD0:

mdadm: hot remove failed for 8:1: Device or resource busy

Because, the mdadm didn't say the sda drive went wrong. But why?

Hennes
  • 4,842
  • 1
  • 19
  • 29
Chaze
  • 1

1 Answers1

1

Linux’s MD stack finds a device failed when it tries to read or write it and the operation fails. As long as it does not try to read or write in /boot, it may not figure out that sda1 failed.

You cannot detach it while it is not failed, but you can force it to fail manually with mdadm --manage /dev/md0 --fail /dev/sda1.

user2233709
  • 1,384
  • 1
  • 10
  • 16
  • > Linux’s MD stack finds a device failed when it tries to read or write > it and the operation fails. As long as it does not try to read or > write in /boot, it may not figure out that sda1 failed. Yes, it's true. Thanks. The `mdadm --manage /dev/md0 --fail /dev/sda1`command not working because the sda drive not exists. (No such file or directory) – Chraze Apr 17 '17 at 19:22
  • 1
    Try to copy some file to the `/boot` directory. – Mikhail Khirgiy Apr 18 '17 at 05:40
  • @Chraze Possibly the software responsible for creating inodes in `/dev` has noticed the drive is absent and removed the inodes. If that's the case you can create them again manually with `mknod`. – kasperd Apr 18 '17 at 07:27