Skip to contentSkip to conversation

Synchronous mdadm --add/--re-add operations

DISCUSSION Andre Majorel 2 participants 2 messages Jan 25, 2007 MD RAID

lore
Share & tools
lore
#0 lore raw

How do I serialise mdadm --add/--re-add calls other than by writing some shell to poll /proc/mdstat ? Is there a way to make mdadm synchronous i.e., waiting until the operation completes or fails instead of starting it in the background and returning.

Signature · 7 lines
André Majorel <URL:http://www.teaser.fr/~amajorel/>
Do not use this account for regular correspondence.
See the URL above for contact information.
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 4 lines · On Thursday January 25, [email protected] wrote:

How do I serialise mdadm --add/--re-add calls other than by writing some shell to poll /proc/mdstat ? Is there a way to make mdadm synchronous i.e., waiting until the operation completes or fails instead of starting it in the background and returning.

Something has to poll mdstat (or some /sys file). In mdadm-2.6 where is a '-W' option which will wait for resync/recovery to complete. So
mdadm /dev/mdX -add /dev/thing
mdadm -W /dev/mdX

might be what you want.

NeilBrown