.Pausing an mdadm RAID array check - Chris Stretton

Chris Stretton

Jun 09, 2023

Pausing an mdadm RAID array check

When mdadm is checking your disk array, you may find performance crawls to a halt.

1
2
3
4
5
6
7
8
9
$ mdadm --detail /dev/md2
...
State: clean, checking

$ cat /proc/mdstat
md2 : active raid1 sdb3[1] sda3[0]
3872281408 blocks super 1.2 [2/2] [UU]
[=============>.......] check = 65.5% (2538119744/3872281408) finish=227.3min speed=97794K/sec
bitmap: 1/29 pages [4KB], 65536KB chunk

To mitigate this you may want to stop the check and restart it when it is quieter.

Stopping

You can stop the check with the following:

1
$ echo idle > /sys/devices/virtual/block/md2/md/sync_action

You can then see that the check has stopped

1
2
3
4
$ cat /proc/mdstat
md2 : active raid1 sdb3[1] sda3[0]
3872281408 blocks super 1.2 [2/2] [UU]
bitmap: 14/29 pages [56KB], 65536KB chunk

Resuming

Tou can resume it again at a later date (when the system is quieter) wth the following:

1
$ echo check > /sys/devices/virtual/block/md2/md/sync_action
OLDER > < NEWER