How to Completely Disable the ‘kmod-static-nodes.service’ in Ubuntu Server

In Ubuntu Server, the kmod-static-nodes.service is a systemd unit responsible for creating static device nodes in /dev/ based on the kernel modules configured in /lib/modules/$(uname -r)/modules.devname during the boot process. While this service is crucial for legacy compatibility and specific hardware configurations that require predefined device nodes before udev is fully operational, it is entirely unnecessary in many modern virtualized, containerized, or strictly minimal server environments. Disabling it can slightly optimize boot times and reduce systemd clutter in highly tuned deployments.

This guide provides a straightforward method to completely disable and mask the kmod-static-nodes.service in Ubuntu Server, preventing it from executing during the boot sequence.

How to Disable the ‘kmod-static-nodes.service’

To safely disable the service, you must interact with systemctl. Follow these steps carefully with root or sudo privileges:

  1. Connect to your Ubuntu Server via SSH or open a terminal window.
  2. First, disable the service to prevent it from starting automatically on the next system boot:
    sudo systemctl disable kmod-static-nodes.service
  3. Because this service is often pulled in as a dependency by systemd-udevd or other early-boot targets, simply disabling it is usually insufficient. You must completely mask the service to lock it down:
    sudo systemctl mask kmod-static-nodes.service

Masking links the service file to /dev/null, effectively making it impossible for systemd to start it, even if requested by another unit.

Verifying the Changes

To confirm that the kmod-static-nodes.service has been successfully disabled and masked, run the following verification command:

sudo systemctl status kmod-static-nodes.service

The output should indicate that the service is masked and inactive (dead). You can safely reboot the server to ensure that the system initializes normally without attempting to parse static module device nodes.

Get the best tech tips delivered straight to your inbox.

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