Некоторые картинки не загружаются из РФ и РК, используйте VPN.

среда, 4 февраля 2026 г.

Reschedule mdadm check

By default, mdadm checks arrays at 01:00:00 on the first Sunday of every month. For me this is terrible, because the heaviest load on the array starts on Saturday and ends on Monday. Naturally, the mdadm check caused additional problems, and several times it even stopped the array completely. So I decided to look for information on  "How to change the mdadm check schedule?"

It is not difficult. FIrst, check the current schedule, then change "OnCalendar" parameter in the timer configuration file and reload the daemon. 

Note: this parameter works in conjunction with the next parameter "RandomizedDelaySec". This means that the service startup will actually occur between OnCalendar and OnCalendar+RandomizedDelaySec

Note: Sun *-*-1..7 1:00:00 - this means start on the first Sunday of every month

Check the result

user@vrem:~$ systemctl list-timers --all | grep -i check
Wed 2026-02-04 18:26:26 UTC 3h 1min left Sun 2026-02-01 22:57:41 UTC 2 days ago   mdcheck_start.timer            mdcheck_start.service
Thu 2026-02-05 04:29:41 UTC 13h left     Wed 2026-02-04 02:59:49 UTC 12h ago      mdcheck_continue.timer         mdcheck_continue.service

user@vrem:~$ sudo nano /lib/systemd/system/mdcheck_start.timer
user@vrem:~$ sudo systemd-analyze verify /lib/systemd/system/mdcheck_start.*
user@vrem:~$ sudo systemctl daemon-reload
# it is not necessary
user@vrem:~$ sudo systemctl restart mdcheck_start.timer

user@vrem:~$ sudo systemctl list-timers --all | grep -i check
Wed 2026-02-04 15:40:53 UTC 1min 33s left     Sun 2026-02-01 22:57:41 UTC 2 days ago   mdcheck_start.timer            mdcheck_start.service
Thu 2026-02-05 05:50:28 UTC 14h left          Wed 2026-02-04 02:59:49 UTC 12h ago      mdcheck_continue.timer         mdcheck_continue.service

user@vrem:~$ sudo dmesg -T | grep check
[Wed feb  4 15:41:16 2026] md: data-check of RAID array md0
[Wed feb  4 15:41:17 2026] md: data-check of RAID array md127
[Wed feb  4 15:50:16 2026] md: md0: data-check done.

If you did not find the /lib/systemd/system/mdcheck_start.timer file, you should check the /etc/cron.d/mdadm file, maybe your version may use crontab to schedule this task

Комментариев нет:

Отправить комментарий