Find the answer to your Linux question:
Results 1 to 8 of 8
Once in a while, server administrators can initiate a "CHECK" sync_action on their array. This can be accomplished with the following command: Code: sudo su - echo check >> /sys/block/md0/sync_action ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2005
    Posts
    54

    Question mdadm - How to Pause a "CHECK" sync_action?


    Once in a while, server administrators can initiate a "CHECK" sync_action on their array. This can be accomplished with the following command:

    Code:
    sudo su -
    echo check >> /sys/block/md0/sync_action
    This will have mdadm immediately start a "check" process on the array to verify that all parity is correct. It is a good way to ensure the array is healthy, and that there are no underlying errors on any of the drives affecting your data. CarefuL: On large arrays (++TB), this check can take days!

    Typically, one might decided to schedule these checks using a cron entry. Perhaps once a month, we'll have this run.

    The Question:
    * Is there any way to "PAUSE" this mdadm check process? Or stop it?

    It is unfortunate if you've brought your server to a LAN party to host files, and all of a sudden the CHECK is running (oops I forgot it's the XX day of the month and the cron kicked in). Sometimes there are situations where you just don't want it to run and it's already started! (i..e you would notice because there is a huge performance impact on CPU and I/O.)

  2. #2
    Banned
    Join Date
    Feb 2010
    Posts
    31

    To Pause

    I assume you tried:
    kill -STOP [pid]
    and
    kill -CONT [pid]

  3. #3
    Just Joined!
    Join Date
    Jan 2005
    Posts
    54

    Post

    So during the check operation:

    Code:
    root@fermmy-server:/sys/block/md500/md# cat /proc/mdstat | grep -A3 md500
    md500 : active raid5 sde1[0] sdg1[5] sdf1[4] sdl1[3] sdi1[2] sdh1[1]
          2441919360 blocks level 5, 128k chunk, algorithm 2 [6/6] [UUUUUU]
          [>....................]  check =  0.6% (2965760/488383872) finish=467.1min speed=17316K/sec

    Hmmm.... could someone confirm which PID to kill?

    Code:
    root@fermmy-server:/sys/block/md500/md# ps wauxx | grep md500
    root      4787  0.3  0.0      0     0 ?        S<   Feb27   5:28 [md500_raid5]
    root      5290  3.1  0.0      0     0 ?        R<   22:48   0:00 [md500_resync]
    root      6443  0.0  0.0   2160   600 ?        Ss   Feb27   0:00 /sbin/mdadm --monitor --pid-file /var/run/mdadm/monitor.pid --daemonise --scan --syslog --test /dev/md1000 /dev/md125 /dev/md250 /dev/md500
    I'm guessing it's the one in bold, but wanted to get a second opinion prior to doing so.

  4. #4
    Just Joined!
    Join Date
    Jan 2005
    Posts
    54
    ping; I guess this is still an open question; sometimes check resync actions are occuring, and we want to pause them ...

  5. #5
    Just Joined!
    Join Date
    Apr 2011
    Posts
    1

    Smile

    Very similar as to
    Quote Originally Posted by Fermulator View Post
    Code:
    sudo su -
    echo check >> /sys/block/md0/sync_action
    , but instead of check, echo 'idle'

    Code:
    sudo su -
    echo idle > /sys/block/md0/sync_action
    Killing the sync process is NOT the way to do it. Note that the path might be different on your system, on mine it's /sys/block/md0/md/sync_action

    You can edit the scheduling in your crontab, /etc/cron.d/mdadm
    Last edited by pmodin; 04-05-2011 at 11:10 PM.

  6. #6
    Just Joined!
    Join Date
    Jan 2005
    Posts
    54
    Hm. But wouldn't that STOP the check sync action, rather than pause?

    i.e., if I set it to idle in the middle of a check (say, 50% complete), then a few hours later, put in "check" again, will it resume @ the previous 50%, or restart @ 0%?

  7. #7
    Just Joined!
    Join Date
    Jan 2005
    Posts
    54

    Question

    Can anyone comment on this though?

    Code:
    kill -STOP [pid]
    and
    kill -CONT [pid]
    What affect does this have on the array while the resync process (PID) is paused? Obviously, we'd like to still access the filesystem on the array while a resync process is paused via "kill -STOP [pid]".

    I haven't actually tried it yet, as I'm not confident myself that it is safe.

  8. #8
    blq
    blq is offline
    Just Joined!
    Join Date
    Aug 2011
    Posts
    1
    Quote Originally Posted by Fermulator View Post
    Hm. But wouldn't that STOP the check sync action, rather than pause?

    i.e., if I set it to idle in the middle of a check (say, 50% complete), then a few hours later, put in "check" again, will it resume @ the previous 50%, or restart @ 0%?

    idle works, and yes you will resume at the previous state.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •