Bug#497949: mdadm: a cron.daily script to check would be helpful

Paul Slootman paul at debian.org
Tue Sep 9 13:25:57 UTC 2008


tags 497949 patch
thanks

> Could you please send me a well-tested patch as I have no time these
> days for mdadm maintenance.

See below.
Installed on 6 systems for a couple of days without problems.
Then again, I can't confirm it works when a device is degraded, but I
assume it does, if mdadm does as advertised in the manpage :-)


Paul Slootman


diff -ru --unidirectional-new-file mdadm-2.6.7/debian/changelog mdadm-2.6.7x/debian/changelog
--- mdadm-2.6.7/debian/changelog	2008-09-08 11:44:32.000000000 +0200
+++ mdadm-2.6.7x/debian/changelog	2008-09-08 11:37:43.000000000 +0200
@@ -1,3 +1,10 @@
+mdadm (2.6.7-3.2) unstable; urgency=low
+
+  * Add cron.daily script to check for degraded arrays.
+    closes:#497949
+
+ -- Paul Slootman <paul at debian.org>  Mon, 08 Sep 2008 11:36:41 +0200
+
 mdadm (2.6.7-3.1) unstable; urgency=low
 
   * Non-maintainer upload with permission.
diff -ru --unidirectional-new-file mdadm-2.6.7/debian/mdadm.cron.daily mdadm-2.6.7x/debian/mdadm.cron.daily
--- mdadm-2.6.7/debian/mdadm.cron.daily	1970-01-01 01:00:00.000000000 +0100
+++ mdadm-2.6.7x/debian/mdadm.cron.daily	2008-09-08 11:36:28.000000000 +0200
@@ -0,0 +1,17 @@
+#! /bin/sh
+#
+# cron.daily/mdadm -- daily check that MD devices are functional
+#
+# Copyright © 2008 Paul Slootman <paul at debian.org>
+# distributed under the terms of the Artistic Licence 2.0
+
+# As recommended by the manpage, run
+#	mdadm --monitor --scan -1
+# every day to ensure that any degraded MD devices don't go unnoticed.
+# Email will go to the address specified in /etc/mdadm/mdadm.conf .
+
+MDADM=/sbin/mdadm
+
+[ -x $MDADM ] || exit 0 # package may be removed but not purged
+
+$MDADM --monitor --scan -1





More information about the pkg-mdadm-devel mailing list