All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bill Merriam <lists@billmerriam.com>
To: linux-raid@vger.kernel.org
Subject: [PATCH] mdcheck: Send progress messages to system log
Date: Tue, 17 May 2016 11:12:59 -0400	[thread overview]
Message-ID: <1463497979.31691.7.camel@billmerriam.com> (raw)

From 03bec5cfdd87f25b1669a4b62d19cf872403d37a Mon Sep 17 00:00:00 2001
From: Bill Merriam <bill@merriam.net>
Date: Tue, 17 May 2016 10:16:13 -0400
Subject: [PATCH] The mdcheck script now adds messages to the system log
to
 report on progress of the array check.  These are issued when mdcheck
starts
 or continues a check and when it suspends a check at the expiration of
 duration.  The messages either report the check has completed or the
block
 number of the current and last block in the array and the percentage of
 completion.

Signed-off-by: Bill Merriam <bill@merriam.net>
---
 misc/mdcheck | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/misc/mdcheck b/misc/mdcheck
index 2c8f54d..c33e3f6 100644
--- a/misc/mdcheck
+++ b/misc/mdcheck
@@ -100,6 +100,8 @@ do
 		continue
 	else
 		start=`cat "$fl"`
+		size=$(expr $(cat $sys/md/component_size) \* 2)
+		logger $(echo $dev $start $size | awk '{printf "MDCHECK Continuing
check on %s at block %i of %i, %6.2f%% complete\n", $1, $2, $3,
$2/$3*100 }')
 	fi
 
 	cnt=$[cnt+1]
@@ -129,6 +131,7 @@ do
 		then
 			eval MD_${i}_fl=
 			rm -f $fl
+			logger "MDCHECK check completed on ${sys##*/}, removing $fl"
 			continue;
 		fi
 		read a rest < $sys/md/sync_completed
@@ -156,4 +159,8 @@ do
 	fi
 	echo idle > $sys/md/sync_action
 	cat $sys/md/sync_min > $fl
+	dev=${sys##*/}
+	start=$(cat $fl)
+	size=$(expr $(cat $sys/md/component_size) \* 2)
+	logger $(echo $dev $start $size | awk '{printf "MDCHECK Suspending
check on %s at block %i of %i, %6.2f%% complete\n", $1, $2, $3,
$2/$3*100 }')
 done
-- 



             reply	other threads:[~2016-05-17 15:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 15:12 Bill Merriam [this message]
2016-07-21 15:53 ` [PATCH] mdcheck: Send progress messages to system log Jes Sorensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1463497979.31691.7.camel@billmerriam.com \
    --to=lists@billmerriam.com \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.