How to Completely Disable the ‘mdmonitor’ Service in Ubuntu Server

In Ubuntu Server environments, mdmonitor.service is a background daemon that continuously polls software RAID arrays (created using mdadm) to detect disk degradation, sync status, and array health. If a drive fails, mdmonitor triggers alerts (typically via email) to the system administrator. However, in modern cloud infrastructure, storage is often abstracted. If you are running Ubuntu Server on an AWS EC2 instance, an Azure VM, or utilizing a hardware RAID controller (like a Dell PERC), the OS has absolutely no business monitoring the block devices for software RAID degradation. In these scenarios, mdmonitor simply wastes CPU cycles polling non-existent or hardware-abstracted arrays, cluttering syslog with unnecessary checks.

This guide explains how to completely disable the mdmonitor service in Ubuntu Server, ensuring the OS stops attempting to monitor software RAID arrays that do not exist.

Stop and Mask the MDMonitor Service

To prevent the server from initializing the RAID monitoring daemon during the boot sequence, we must stop the service and explicitly mask it to prevent dependency invocation.

  1. Log into your Ubuntu Server via SSH using an account with sudo privileges.
  2. First, check if the service is currently running:
    sudo systemctl status mdmonitor.service
  3. If it is active, stop the service immediately:
    sudo systemctl stop mdmonitor.service
  4. Next, disable the service to remove its symlinks from the multi-user boot target:
    sudo systemctl disable mdmonitor.service
  5. For absolute certainty, explicitly mask the service. This symlinks the unit file to /dev/null, creating a hard block against it starting under any circumstances:
    sudo systemctl mask mdmonitor.service

Verify the Service Lockdown

By masking mdmonitor.service, you guarantee that the Ubuntu OS will no longer invoke the mdadm --monitor process, freeing up system resources for actual application workloads in virtualized or hardware-RAID environments.

To verify the lockdown is successful, attempt to start the service manually:

sudo systemctl start mdmonitor.service

Systemd will return a fatal error stating that the unit is masked (e.g., Failed to start mdmonitor.service: Unit mdmonitor.service is masked). Your server is now optimized to ignore software RAID telemetry entirely.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.