I want to interrupt a running resync operation on a debian squeeze software raid. (This is the regular scheduled compare resync. The raid array is still clean in such a case. Do not confuse this with a rebuild after a disk failed and was replaced.)

How to stop this scheduled resync operation while it is running? Another raid array is "resync pending", because they all get checked on the same day (sunday night) one after another. I want a complete stop of this sunday night resyncing.

[Edit: sudo kill -9 1010 doesn't stop it, 1010 is the PID of the md2_resync process]

I would also like to know how I can control the intervals between resyncs and the remainig time till the next one.

[Edit2: What I did now was to make the resync go very slow, so it does not disturb anymore:

sudo sysctl -w dev.raid.speed_limit_max=1000

taken from http://www.cyberciti.biz/tips/linux-raid-increase-resync-rebuild-speed.html

During the night I will set it back to a high value, so the resync can terminate.

This workaround is fine for most situations, nonetheless it would be interesting to know if what I asked is possible. For example it does not seem to be possible to grow an array, while it is resyncing or resyncing "pending"]

link|improve this question
I don't think i've got the balls to cancel a resync. I fear it might never start again. – Tom O'Connor Dec 28 '10 at 13:37
@Tom: this is only the normal resync that checks every sunday if everything matches. if it is stopped (e.g. by shutting down the machine) it continues on the next boot. – Adam5 Jan 2 '11 at 19:59
Oh, ok. That's ok then – Tom O'Connor Jan 2 '11 at 21:01
feedback

4 Answers

If your array is md0 then echo "idle" > /sys/block/md0/md/sync_action

'idle' will stop an active resync/recovery etc. There is no guarantee that another resync/recovery may not be automatically started again, though some event will be needed to trigger this.

http://www.mjmwired.net/kernel/Documentation/md.txt#477

link|improve this answer
I could update the textfile after changing its permissions, but the content of the file is changed back to "resync" from behind in the same instance. And the resync continues at the other array (which was formerly "pending"). When I write "idle" to the other array's file it swaps again, but never stops. – Adam5 Dec 27 '10 at 22:15
feedback

I wanted to slow down, or pause the resync process to save some I/O to backup some stuff on antoher computer. This thread helped me but I found another solution.

On my Debian Lenny :

  • echo "idle" > /sys/block/md0/md/sync_action works but the resync process is immediatly restarted.

  • checkarray -x --all : works, but same same : the resync process is immediatly restarted.

So I use this method: echo 0 >/proc/sys/dev/raid/speed_limit_min

link|improve this answer
feedback

Not sure about how to cancel a re-sync, but the schedule is controlled by /etc/cron.d/mdadm on Debian/Ubuntu systems.

The script /usr/share/mdadm/checkarray may shed some light on the other part of your question, since that is what is being called by cron.

link|improve this answer
Thank you, I will have a look at these scripts – Adam5 Dec 27 '10 at 19:39
feedback

As mentioned above, on Debian/Ubuntu systems the /etc/cron.d/mdadm script invokes the /usr/share/mdadm/checkarray script to initiate re-sync checks.

This script has an option for cancelling all running sync checks:

checkarray -x --all
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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