Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working with software raid in Linux. When I start the recovery of a raid array after a disk failure this task happens in background. /proc/mdstat should show the estimated time of recovery but it is not correct. In my case /proc/mdstat was showing estimated 15 hours but the recovery was done in around 10 hours. Is there a way to know exact time of execution of recovery daemon?

share|improve this question
How about the kernel log? Otherwise, dmesg shows log messages (printk's) which include (depending on your kernel config) the number of seconds since kernel bootup. – Friek Jan 31 '12 at 20:15
@Friek sorry but i couldn't see timing information with dmesg.it is only showing log messages. thanks for the reply. – raj_gt1 Feb 1 '12 at 9:52

migrated from stackoverflow.com Feb 2 '12 at 3:32

1 Answer

up vote 1 down vote accepted

You can run a simple script in the background that checks for the "rebuilding status" and dumps the time it's been waiting:

tick=$(date +%s)
while [ -n "$(cat /proc/mdstat | grep 'rebuilding')" ]; do
    sleep 10
done
tock=$(date +%s)
echo $(($tock-$tick))

mdadm also has a --monitor option that will sendmail when events are raised. I've never used it, but it may be worth looking into since a completed rebuild may qualify as a noteworthy event.

share|improve this answer
thanks. both script and --monitor option worked for me . --monitor option is quiet sophisticated as it can e-mail on the state change of array. – raj_gt1 Feb 1 '12 at 10:01
glad to hear i helped. accept the answer? :) – user112358132134 Feb 1 '12 at 16:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.