https://unix.stackexchange.com/questions/333721/how-to-stop-auto-mounting-of-devices-in-ubuntu In Ubuntu 22.04 I was able to stop automatic mounting of devices using the dconf Editor. First install it: sudo apt install dconf-editor Next, run it and navigate up to this setting: org.gnome.desktop.media-handling automount false To automate: gsettings set org.gnome.desktop.media-handling automount false