Skip to contentSkip to conversation

mdcheck: Log when done

PATCH Applied Paul Menzel 2 participants 2 messages May 13, 2020 – May 14, 2020 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mdcheck: Log when done

From: Donald Buczek <[email protected]>

Currently mdcheck (when called with --duration) logs only the beginning of the check, the pausing and the continuation but not the completion.

So, log the completion, too, so that it can be determined how long the raid check took.

    2020-05-08T18:00:02+02:00 deadpool root: mdcheck start checking /dev/md0
    2020-05-08T18:00:02+02:00 deadpool root: mdcheck start checking /dev/md1
    2020-05-09T15:32:04+02:00 deadpool root: mdcheck finished checking /dev/md1
    2020-05-09T17:38:04+02:00 deadpool root: mdcheck finished checking /dev/md0
---
 misc/mdcheck | 2 ++
 1 file changed, 2 insertions(+)
misc/mdcheck +2 -0
index 42d4094..700c3e2 100644
@@ -125,11 +125,13 @@ do
 	do
 		eval fl=\$MD_${i}_fl
 		eval sys=\$MD_${i}_sys
+		eval dev=\$MD_${i}_dev
 
 		if [ -z "$fl" ]; then continue; fi
 
 		if [ "`cat $sys/md/sync_action`" != 'check' ]
 		then
+			logger -p daemon.info mdcheck finished checking $dev
 			eval MD_${i}_fl=
 			rm -f $fl
 			continue;
Signature · 1 line
2.26.2
Applied
#1 lore raw
Quoted 9 lines · Paul Menzel

From: Donald Buczek <[email protected]>

Currently mdcheck (when called with --duration) logs only the beginning of the check, the pausing and the continuation but not the completion.

So, log the completion, too, so that it can be determined how long the raid check took.

Quoted 7 lines
    2020-05-08T18:00:02+02:00 deadpool root: mdcheck start checking /dev/md0
    2020-05-08T18:00:02+02:00 deadpool root: mdcheck start checking /dev/md1
    2020-05-09T15:32:04+02:00 deadpool root: mdcheck finished checking /dev/md1
    2020-05-09T17:38:04+02:00 deadpool root: mdcheck finished checking /dev/md0

Applied!

Thanks,
Jes