10

It looks like there's been some changes in when mdadm does parity checks and how it is controlled. It used to start the first Sunday of the month at about 1AM and was started by a cron entry. Now it looks like it's starting at about 5AM on the first Sunday and has a new features that pauses it (when the system is being used?) and then restarts it at weird (random?) times like 8AM on a weekday. I don't see any cron entries for this anymore so I'm not sure how it's being controlled.

Can someone tell me...

  • Where are the start, pause, restart behaviors controlled from in 20.04
  • What causes it to pause
  • Generally, how is this supposed to work now

I'd like to change the behaviors so it restarts early AM instead of during the day.

bivouac0
  • 561

1 Answers1

18

mdadm checks are now controlled by systemd in a more complicated process than previously.

The systemd timer starts the mdadm check service at 1AM on the first Sunday of the month but has a random start time of 24H, meaning it starts anytime on that day (which seems kind of dumb). This can be changed with the command sudo systemctl edit --full mdcheck_start.timer and editing the RandomizedDelaySec field to something like 10m.

When the check service starts, it runs mdcheck --duration 6 hours meaning that the check will run for 6 hours and then pause (aka stop and save the stopping point so it can be continued later). This can be seen with the command systemctl cat mdcheck_start.service

Systemd runs the continuation check every day at a 12hour randomized time (midnight - noon). To changed this do sudo systemctl edit --full mdcheck_continue.timer. The OnCalendar field and RandomizedDelaySec can be changed to have this continue at more specific days/times.

When the continuation service runs it calls mdcheck --continue --duration 6 to continue checking for another 6 hours. This can be seen with the command systemctl cat mdcheck_continue.service

bivouac0
  • 561