I'm working on creating an Ubuntu variant that has a lot of forensic analysis tools etc installed. However I can't seem to find out how to disable auto-mounting at all..I want it to NEVER mount anything, I always want to mount something manually.

I've done some searching and found this: How can I use gsettings to disable device automount in Ubuntu 16.04?

However, if I use: gsettings set org.gnome.desktop.media-handling automount false

It still auto-mounts. Also the thread says something about

The reason it failed on this occasion seemed to be caused by the lack of environment variables being set, notably $DBUS_SESSION_BUS_ADDRESS.

Now I have now idea what this last part mean, anyone care to explain or have any other solution to fully disable auto-mounting cd/usb/sata etc.

share|improve this question
    
apt purge udisk\* – Ipor Sircer Jun 4 '17 at 16:38
up vote 3 down vote accepted

One way of doing that is to write an udev rule that makes udisks2 ignore any added block devices. This can be done by dropping a file 10-myudisks2.rules in /etc/udev/rules.d with the rule:

ACTION=="add|change", SUBSYSTEM=="block", ENV{UDISKS_IGNORE}="1"

This is documented in:

man 7 udev
man 8 udisks
share|improve this answer
    
Thanks a lot, this did work indeed. I selected your comment as the answer. Have a good day! – Nerotix Jun 5 '17 at 14:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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