# Readding a stale drive to mdadm RAID5 ?

## Goverp

While plugging new memory into my box, I inadvertantly disconnected a disk power lead,  When it booted, mdadm successfully started the RAID array with 3 out of 4 disks.  So I stopped the box, reconnected the cable, and restarted.  mdadm didn't like the stale drive, and used only the same 3 disks as before.

IIUC,  I just need to restart the machine, and mdadm --add the stale drive back into the array, and wait while mdadm repopulates it.

Please can anyone confirm this?  (I do have backups, but I don't think I need them in this case.)

----------

## szatox

You could try mdadm --remove and then --re-add that drive. If you have write intent bitmap, it should only synchronize outdated areas.

Otherwise --remove it from raid, --zero-superblock and then --add it again for a full resync, just in case.

Reboot is not necessary as long as your system can detect that drive and use it. SATA even supports hotplug.

----------

## Goverp

Thanks szatox.  In the end, 

```
mdadm /dev/md127 --re-add /dev/sdb3
```

 seems to have done the job in almost no time.  Syslog shows

```
Jul 27 07:26:01 acer kernel: md: recovery of RAID array md127

Jul 27 07:26:01 acer kernel: md: md127: recovery done.
```

----------

