I am running a RaspPi 4 headless and want to disable automount USB drive permanently. To disable automouont temporarily, I execute "systemctl stop udisks2". Thinkiing "ystemctl disable udisks2" will do the trick but it does not. After reboot and plug in a USB drive, the system will mount it at /media/pi.... . Is udisks2 responsible or automounting? What does it take so my Rasp Pi doesn't automount?

2 Answers 2


There is an option in File Manager preferences to disable it.

This needs to be done in the GUI, either by attaching a monitor or using VNC.

If you don't use the GUI disable login to Desktop and enable login to command line.


Check your run level with the runlevel command. Eventhough you are headless, it may very well be 5, which is normally for GUI.

If it is 5, then automount is enabled. You will have to switch to 3 to disable automount. The only difference between 3 and 5 is normally the GUI capability, which automount is part of.

If you are running raspbian, use the raspbian-config script and edit the system parameters to permanently boot into console mode (= level 3)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.