3

Sometimes hdd might drop out of my RAID, but after I fix HW problem - I have to manually find out which is device name of dropped HDD and manually re-add it.

Is there a way to let mdadm scan all HDDs and auto-read ones which belong to array?

  • 1
    There's mdadm --assemble --scan, I believe it works with the correct setup in /etc/mdadm/mdadm.conf (see the RAID wiki). If that doesn't work, could you give some more details? – j-g-faustus Jan 21 '11 at 20:16
  • Well, RAID is already assembled and working, it's just degraded - 1 drive dropped out of 5 (RAID-6). – BarsMonster Jan 21 '11 at 22:11
  • So when you manually re-add (I assume that works?) you do something like mdadm /dev/mdX --add /dev/sdY1? And then the RAID starts the reconstruction process? – j-g-faustus Jan 22 '11 at 09:54
  • Yes, manually it perfectly works, and as I have bitmap too, reconstruction is being done in seconds. – BarsMonster Jan 22 '11 at 14:02
  • I may be wrong here, but if mdadm has marked the dropped drive as 'faulty' (so that mdadm does reconstruction/rebuild, not merely reassembly; the newly added drive will initially be listed as 'spare') I don't think there's an "auto-add" option available. I assume this is by design; if you actually have a bad drive you don't want the RAID to use that drive until you have replaced/fixed it. – j-g-faustus Jan 22 '11 at 17:55

1 Answers1

2

No, there is no automated way to do this. There are mdadm monitors out there which parse the various events to enable you to create a custom application to manage the array according to your wishes. There are plenty of NAS appliances that use MD and developed a closed source daemon to manage md, to my knowledge, no open source equivalents exist.

ppetraki
  • 5,483