Bug#522710: checkarray: line 167: echo: write error: Device or resource busy

Andrey Panin pazke at donpac.ru
Wed Apr 8 14:31:33 UTC 2009


This bug is simple, if one of your md devices is in auto-read-only state
all attempts to write to corresponding /sys/block/md2/md/sync_action
fail with EBUSY. 

To make things even worse bash after getting this error just dies and 
if you have for example /dev/md1 in auto-read-only state your /dev/md2
will never be checked.

I fixed it on my servers with this very small patch:

--- /usr/share/mdadm/checkarray.old	2009-04-08 18:27:02.000000000 +0400
+++ /usr/share/mdadm/checkarray	2009-04-08 18:09:45.000000000 +0400
@@ -164,7 +164,7 @@
 
       # queue request for the array. The kernel will make sure that these requests
       # are properly queued so as to not kill one of the array.
-      echo $action > $SYNC_ACTION_CTL
+      echo $action > $SYNC_ACTION_CTL || true
       [ $quiet -lt 1 ] && echo "$PROGNAME: I: check queued for array $array." >&2
       ;;
   esac

I'm not sure that this patch is 100% correcrt, but it seems to work for me.





More information about the pkg-mdadm-devel mailing list