Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Readding a stale drive to mdadm RAID5 ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Goverp
l33t
l33t


Joined: 07 Mar 2007
Posts: 729

PostPosted: Thu Jul 26, 2018 7:13 pm    Post subject: Readding a stale drive to mdadm RAID5 ? Reply with quote

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.)
_________________
Greybeard
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1774

PostPosted: Thu Jul 26, 2018 9:01 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Goverp
l33t
l33t


Joined: 07 Mar 2007
Posts: 729

PostPosted: Fri Jul 27, 2018 8:11 am    Post subject: Reply with quote

Thanks szatox. In the end,
Code:
mdadm /dev/md127 --re-add /dev/sdb3
seems to have done the job in almost no time. Syslog shows
Code:
Jul 27 07:26:01 acer kernel: md: recovery of RAID array md127
Jul 27 07:26:01 acer kernel: md: md127: recovery done.

_________________
Greybeard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum