No auto-check md-RAID in AL9

In RHEL8/AL8, it will check raid once a week, in a system which has set LVM-RAID while the installing of the system.

# in centos8
[root@centos8 ~]# cat /etc/cron.d/raid-check 
# Run system wide raid-check once a week on Sunday at 1am by default
0 1 * * Sun root /usr/sbin/raid-check

However, no auto-check in AL9.

On Alma 8 the dnf provides /etc/cron.d/raid-check says: “mdadm” and:

$ rpm -ql mdadm
/etc/cron.d/raid-check
/etc/libreport/events.d/mdadm_event.conf
/etc/sysconfig/raid-check
/usr/lib/.build-id
/usr/lib/.build-id/79
/usr/lib/.build-id/79/c2d9bece84ddd680ee6729e9ba5f15bcd8bb00
/usr/lib/.build-id/95
/usr/lib/.build-id/95/29cea4b00f0339679567866d171e3b12738e33
/usr/lib/mdadm/mdadm_env.sh
/usr/lib/systemd/system-shutdown/mdadm.shutdown
/usr/lib/systemd/system/mdadm-grow-continue@.service
/usr/lib/systemd/system/mdadm-last-resort@.service
/usr/lib/systemd/system/mdadm-last-resort@.timer
/usr/lib/systemd/system/mdcheck_continue.service
/usr/lib/systemd/system/mdcheck_continue.timer
/usr/lib/systemd/system/mdcheck_start.service
/usr/lib/systemd/system/mdcheck_start.timer
/usr/lib/systemd/system/mdmon@.service
/usr/lib/systemd/system/mdmonitor-oneshot.service
/usr/lib/systemd/system/mdmonitor-oneshot.timer
/usr/lib/systemd/system/mdmonitor.service
/usr/lib/tmpfiles.d/mdadm.conf
/usr/lib/udev/rules.d/01-md-raid-creating.rules
/usr/lib/udev/rules.d/63-md-raid-arrays.rules
/usr/lib/udev/rules.d/64-md-raid-assembly.rules
/usr/lib/udev/rules.d/65-md-incremental.rules
/usr/lib/udev/rules.d/69-md-clustered-confirm-device.rules
/usr/sbin/mdadm
/usr/sbin/mdmon
/usr/sbin/raid-check
/usr/share/doc/mdadm
/usr/share/doc/mdadm/COPYING
/usr/share/doc/mdadm/ChangeLog
/usr/share/doc/mdadm/TODO
/usr/share/doc/mdadm/mdadm.conf-example
/usr/share/doc/mdadm/mdcheck
/usr/share/doc/mdadm/syslog-events
/usr/share/man/man4/md.4.gz
/usr/share/man/man5/mdadm.conf.5.gz
/usr/share/man/man8/mdadm.8.gz
/usr/share/man/man8/mdmon.8.gz
/usr/share/mdadm/mdcheck
/var/run/mdadm

On Alma 9:

$ rpm -ql mdadm
/etc/libreport/events.d/mdadm_event.conf
/etc/sysconfig/raid-check
/run/mdadm
/usr/lib/.build-id
/usr/lib/.build-id/22
/usr/lib/.build-id/22/0a972cefcbded11211313b664b3c7f631c2d76
/usr/lib/.build-id/3c
/usr/lib/.build-id/3c/d4a032644d74bfe5191f4a3560d8cef0ea2eca
/usr/lib/systemd/system-shutdown/mdadm.shutdown
/usr/lib/systemd/system/mdadm-grow-continue@.service
/usr/lib/systemd/system/mdadm-last-resort@.service
/usr/lib/systemd/system/mdadm-last-resort@.timer
/usr/lib/systemd/system/mdcheck_continue.service
/usr/lib/systemd/system/mdcheck_continue.timer
/usr/lib/systemd/system/mdcheck_start.service
/usr/lib/systemd/system/mdcheck_start.timer
/usr/lib/systemd/system/mdmon@.service
/usr/lib/systemd/system/mdmonitor-oneshot.service
/usr/lib/systemd/system/mdmonitor-oneshot.timer
/usr/lib/systemd/system/mdmonitor.service
/usr/lib/systemd/system/raid-check.service
/usr/lib/systemd/system/raid-check.timer
/usr/lib/tmpfiles.d/mdadm.conf
/usr/lib/udev/rules.d/01-md-raid-creating.rules
/usr/lib/udev/rules.d/63-md-raid-arrays.rules
/usr/lib/udev/rules.d/64-md-raid-assembly.rules
/usr/lib/udev/rules.d/65-md-incremental.rules
/usr/lib/udev/rules.d/69-md-clustered-confirm-device.rules
/usr/sbin/mdadm
/usr/sbin/mdmon
/usr/sbin/raid-check
/usr/share/doc/mdadm
/usr/share/doc/mdadm/mdadm.conf-example
/usr/share/doc/mdadm/mdcheck
/usr/share/doc/mdadm/syslog-events
/usr/share/licenses/mdadm
/usr/share/licenses/mdadm/COPYING
/usr/share/man/man4/md.4.gz
/usr/share/man/man5/mdadm.conf.5.gz
/usr/share/man/man8/mdadm.8.gz
/usr/share/man/man8/mdmon.8.gz

Do notice:

AL8: /etc/cron.d/raid-check

AL9: /usr/lib/systemd/system/raid-check.service
     /usr/lib/systemd/system/raid-check.timer

Interestingly, on both:

$ cat /etc/sysconfig/raid-check
#!/bin/bash
#
# Configuration file for /etc/cron.weekly/raid-check
#
# options:
...

… while neither has that “/etc/cron.weekly/raid-check”.

On AL9:

$ systemctl status raid-check.service
○ raid-check.service - RAID setup health check
     Loaded: loaded (/usr/lib/systemd/system/raid-check.service; static)
     Active: inactive (dead)
$ systemctl status raid-check.timer
○ raid-check.timer - Weekly RAID setup health check
     Loaded: loaded (/usr/lib/systemd/system/raid-check.timer; disabled; vendor preset: disabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● raid-check.service

I’d guess that one should enable the raid-check.timer.

1 Like

raid-check.timer maybe the right solution.

by the way, /etc/sysconfig/raid-check is used in /usr/sbin/raid-check:

[root@al9 ~]# grep sysconfig /usr/sbin/raid-check
# This script reads it's configuration from /etc/sysconfig/raid-check
[ -f /etc/sysconfig/raid-check ] || exit 0
. /etc/sysconfig/raid-check

so, this file is usefull.
However, the comments in file /etc/sysconfig/raid-check need to be modified, if using systemd_timer instead crond now.