3

I've got a brand new Ubuntu 20.04 machine built out which is using a mdadm RAID5 configuration (3x 10TB). The system is throwing an error every time I log in. I can see from systemctl that the mdcheck_start service has failed.

I can also see from checking the service status that the daemon is trying to launch a script that does not exist. This script was not installed with Ubuntu or any of the mdadm packages.

systemctl status mdcheck_start.service
● mdcheck_start.service - MD array scrubbing
     Loaded: loaded (/lib/systemd/system/mdcheck_start.service; static; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2020-05-03 09:18:05 EDT; 5min ago
TriggeredBy: ● mdcheck_start.timer
    Process: 196602 ExecStart=/usr/share/mdadm/mdcheck --duration $MDADM_CHECK_DURATION (code=exited, status=203/EXEC)
   Main PID: 196602 (code=exited, status=203/EXEC)

May 03 09:18:05 BAILEYFS02 systemd[1]: Starting MD array scrubbing...
May 03 09:18:05 BAILEYFS02 systemd[196602]: mdcheck_start.service: Failed to execute command: No such file or directory
May 03 09:18:05 BAILEYFS02 systemd[196602]: mdcheck_start.service: Failed at step EXEC spawning /usr/share/mdadm/mdcheck: No such file or directory
May 03 09:18:05 BAILEYFS02 systemd[1]: mdcheck_start.service: Main process exited, code=exited, status=203/EXEC
May 03 09:18:05 BAILEYFS02 systemd[1]: mdcheck_start.service: Failed with result 'exit-code'.
May 03 09:18:05 BAILEYFS02 systemd[1]: Failed to start MD array scrubbing.

Is this a legitimate error?

Can I safely disable this service so I stop getting these annoying errors everytime I log in? Shouldn't mdadm be scrubbing my array periodically to ensure it is working properly?

Error

Game Poop
  • 33
  • 4

2 Answers2

4

This appears to be a bug in Ubuntu 20.04's mdadm package. The mdcheck script is missing altogether so the timer/service fails to execute the it.

When you install mdadm, it also activates the mdcheck_start timer and service.

# apt-get install mdadm
[...]
Setting up mdadm (4.1-5ubuntu1) ...
Generating mdadm.conf... done.
update-initramfs: deferring update (trigger activated)
Created symlink /etc/systemd/system/mdmonitor.service.wants/mdcheck_start.timer → /lib/systemd/system/mdcheck_start.timer.
Created symlink /etc/systemd/system/mdmonitor.service.wants/mdmonitor-oneshot.timer → /lib/systemd/system/mdmonitor-oneshot.timer.
mdcheck_continue.timer is a disabled or a static unit, not starting it.
[...]

The mdcheck_start service is then supposed to run the mdcheck script:

[Service]
Type=oneshot
Environment=MDADM_CHECK_DURATION='"6 hours"'
ExecStart=/usr/share/mdadm/mdcheck --duration $MDADM_CHECK_DURATION

However... /usr/share/mdadm/mdcheck does not actually exist at all, so it can't work.

# ls -l /usr/share/mdadm/
total 12
-rwxr-xr-x 1 root root 6475 Jan 23 19:41 checkarray
-rwxr-xr-x 1 root root 2637 Jan 23 19:41 mkconf

Searching packages.ubuntu.com for this file also yields nothing.

So, either Ubuntu forgot to include the mdcheck script, or they intended to remove it and forgot to also remove the systemd timer / service reference to it.

If interested, I guess you could grab the file here: https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/tree/misc/mdcheck

I found a bug report from January 2020 https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/1858342 however this bug doesn't seem to be assigned to anyone yet.

Shouldn't mdadm be scrubbing my array periodically to ensure it is working properly?

If there is anything that does that in Ubuntu 20.04 then I couldn't find it.

There's a checkarray script installed, but no timer or cron job to actually call it.

So I don't think it would run any automated checks for now.

frostschutz
  • 47,228
  • 5
  • 112
  • 159
  • excellent response! I put the expected script into the expected location and started the service. The dialog that says there was a program problem still appears on every login but whatever is wrong isn't a service because the systemctl --failed command returns 0 failed service now. – Game Poop May 03 '20 at 18:18
  • Thanks for the response - that's really helpful :) – Justin Finkelstein Sep 16 '20 at 16:28
0

tl;dr apt install mdadm

The bug was fixed in 4.1-5ubuntu1.1:

mdadm (4.1-5ubuntu1.1) focal; urgency=medium

  • d/rules: Install misc/mdcheck (LP: #1852747)
    • The absence of mdcheck utility is preventing mdcheck_continue.service & mdcheck_start.service to execute the command when the service start via ExecStart. (Closes: #960132)

Debian changelog:

mdadm (4.1-6) unstable; urgency=medium

  • Install misc/mdcheck; thanks Richard Laager. (Closes: #960132)

Ubuntu bug report
Debian bug report
Salsa commit

x-yuri
  • 3,223
  • 10
  • 39
  • 62