How to block or prevent USB storage mount automatically? i have tried using this code, but doesn't work.

I have tried using this code, but it doesn't work.

sudo echo "blacklist usb-storage" >> /etc/modprobe.d/blacklist.conf
  • 3
    You might have to give us some more information. What version of elementary are you using? Have you installed Nautilus? USB Media does not automatically mount on insertion for me in pantheon-files. Only once I click on the drive in the side bar. – elmato Aug 27 '15 at 4:45
  • 1
    Another thought, the command you gave would require an underscore rather than a hyphen in the module name. eg usb_storage – elmato Aug 27 '15 at 5:19
  • i tried that too. – Rayhan Huda Aug 28 '15 at 3:05
  • @RayhanHuda, I flaged this as too board. You need to add more details to your question, uname -a , lsb_release -r – user.dz Sep 25 '15 at 19:56

Unfortunately elementary OS doesn't povide an UI to change this kind of options directly.

You need to install and run dconf-editor from the official repositories, navigate to org -> gnome -> desktop -> media-handling. Disable the options automount-open and automount, that should do the trick.


| improve this answer | |
  • These settings are for Nautilus, they don't affect Files. In fact, OP still hasn't specified which file manager he's using. – Giulio Sant Sep 25 '15 at 11:24

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