On newer Ubuntu (at least 22.04+), the raid gets checked/resync-ed through CRON tasks that are started with a systemd timer.
$ systemctl list-timers
NEXT LEFT LAST PASSED UNIT ACTIVATES
___________________________________________________________________________________________________________________________________________________
Tue 2023-06-06 12:52:04 PDT 5h 17min left Mon 2023-06-05 02:36:42 PDT 1 day 4h ago mdmonitor-oneshot.timer mdmonitor-oneshot.service
Sun 2023-07-02 22:17:28 PDT 3 weeks 5 days left Sun 2023-06-04 21:31:43 PDT 1 day 10h ago mdcheck_start.timer mdcheck_start.service
n/a n/a Tue 2023-06-06 03:17:46 PDT 4h 16min ago mdcheck_continue.timer mdcheck_continue.service
(other timers not shown)
As mentioned by others, the mdcheck will also do a resync at least once a month to make sure your data is safe. If you have a lot of data (Tera bytes) then it may take a long time.
You can get details about each entry using the show command:
systemctl show mdcheck_start
That will start a check. The mdcheck_continue makes sure that it ends (in case it was interrupted, possibly by a reboot).
How the check works?
If you look at the mdadm man page, it says:
_--action= _
Set the "sync_action" for all md devices given to one of idle, frozen, check, repair. Setting to idle will abort any currently running action though some actions will automatically restart. Setting to frozen will abort any current action and ensure no other action starts automatically.
Details of check and repair can be found it md(4) under SCRUBBING AND MISMATCHES.
So we do:
man md
and search for SCRUBBING ......
SCRUBBING AND MISMATCHES
As storage devices can develop bad blocks at any time it is valuable to regularly read all blocks on all devices in an array so as to catch such bad blocks early. This process is called scrubbing.
md arrays can be scrubbed by writing either check or repair to the file md/sync_action in the sysfs directory for the device.
[...]
The systemctl command will send a repair action to md and the continue makes sure the command is indeed running. This allows the reboot process to interrupt and restart the process cleanly.