Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

migrated from Feb 2 '12 at 3:32

This question came from our site for professional and enthusiast programmers.

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 is only showing log messages. thanks for the reply. – raj_gt1 Feb 1 '12 at 9:52
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
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? :) – Christopher Neylan Feb 1 '12 at 16:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .