If you are setting up a home server, a Raspberry Pi, or a basic VPS using Ubuntu Server, you might notice a background daemon running called multipathd. This service is designed for enterprise storage environments (like SANs) where a single hard drive might be connected to a server via multiple physical fiber channel cables. The daemon manages these multiple paths, ensuring that if one cable is cut, data continues to flow through the backup cable.
While this is critical for a Fortune 500 database server, it is completely useless for 99% of normal users who simply have a standard SATA SSD or an NVMe drive plugged directly into their motherboard. Leaving multipathd running on a standard server just wastes memory, slows down the boot process as it scans for non-existent network storage, and clutters your system logs with warnings about missing paths. If you are not using enterprise storage arrays, you should completely disable this service.
Disabling the Multipathd Service via Systemctl
You can safely kill the daemon and prevent it from launching at boot without harming the rest of your server’s storage configuration.
- Open a Terminal session (or connect to your Ubuntu server via SSH).
- First, stop the daemon from running in your current session by typing the following command and pressing Enter (provide your password if prompted):
sudo systemctl stop multipathd.service multipathd.socket - Next, you must instruct systemd to never start this service automatically when the server reboots:
sudo systemctl disable multipathd.service multipathd.socket - Finally, to ensure that no other enterprise software package accidentally attempts to wake the service back up as a dependency, you must “mask” it. Masking creates a symlink pointing to
/dev/null, securely locking the service away:sudo systemctl mask multipathd.service multipathd.socket - You should see terminal output confirming that symlinks were created for both the service and the socket pointing to
/dev/null.
Removing the Package (Optional)
If you want to go a step further and completely remove the software from your hard drive, you can uninstall the package using APT. (Note: Only do this if you are absolutely certain you will never connect to an iSCSI or Fibre Channel SAN in the future).
- In the terminal, run the following command:
sudo apt-get purge multipath-tools - Press Y when prompted to confirm the removal.
- Clean up any leftover dependencies by running:
sudo apt-get autoremove
Whether you choose to mask it or uninstall it entirely, your server will now boot slightly faster and consume less memory, operating perfectly with your standard, single-path hard drives.