Disable Autofs

Posted on Sunday March 13, 2016 by Eric Potvin

You can disable autofs if you don't need it. This will prevent to mount automatically removable media or NFS filesystems.

You can simply write a udev rule to disable automounting.

First, create the file /etc/udev/rules.d/85-no-automount.rules

sudo vi /etc/udev/rules.d/85-no-automount.rules

and add the following lines:

SUBSYSTEM=="usb", ENV{UDISKS_AUTO}="0"

Restart the service:

sudo service udev restart

This will prevent any USB device from being mounted by the udisksd daemon. If the service didn't worked, you might need to reboot the server.