From 29ba480497f8c45032180d4e358139e134454f4d Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 30 Jun 2010 16:55:17 +1000 Subject: Add -fail support to --incremental This can be used for hot-unplug. When a device has been remove, udev can call mdadm --incremental --fail sda and mdadm will find the array holding sda and remove sda from the array. Based on code from Doug Ledford Signed-off-by: NeilBrown --- mdadm.8.in | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'mdadm.8.in') diff --git a/mdadm.8.in b/mdadm.8.in index e5cc89e6..f6f6b75a 100644 --- a/mdadm.8.in +++ b/mdadm.8.in @@ -136,6 +136,10 @@ This provides a convenient interface to a system. As each device is detected, .I mdadm has a chance to include it in some array as appropriate. +Optionally, when the +.I \-\-fail +flag is passed in we will remove the device from any active array +instead of adding it. If a .B CONTAINER @@ -189,7 +193,7 @@ Change the size or shape of an active array. .TP .BR \-I ", " \-\-incremental -Add a single device into an appropriate array, and possibly start the array. +Add/remove a single device to/from an appropriate array, and possibly start the array. .TP .B \-\-auto-detect @@ -1239,6 +1243,15 @@ in .B mdadm.conf as requiring an external bitmap, that bitmap will be attached first. +.TP +.BR \-\-fail ", " \-f +This allows the hot-plug system to remove devices that have fully disappeared +from the kernel. It will first fail and then remove the device from any +array it belongs to. +The device name given should be a kernel device name such as "sda", +not a name in +.IR /dev . + .SH For Monitor mode: .TP .BR \-m ", " \-\-mail @@ -2145,6 +2158,10 @@ Usage: .I component-device .HP 12 Usage: +.B mdadm \-\-incremental \-\-fail +.I component-device +.HP 12 +Usage: .B mdadm \-\-incremental \-\-rebuild\-map .HP 12 Usage: @@ -2157,6 +2174,11 @@ passed to .B "mdadm \-\-incremental" to be conditionally added to an appropriate array. +Conversely, it can also be used with the +.B \-\-fail +flag to do just the opposite and find whatever array a particular device +is part of and remove the device from that array. + If the device passed is a .B CONTAINER device created by a previous call to -- cgit v1.2.3