4

I am running Raspbian Jessie with Pixel desktop from a USB flash drive on my Rpi3 so I can use the SD slot for other purposes. However, whenever I plug in an SD card while the system is running, I will get a message saying an SD card has been plugged in. It automatically mounts it to /media/pi/<vendorId/productId. I do not want this. I haven't installed anything since the first boot except for qtcreator.

I do not want the system to mount the SD card for me by creating its own mountpoint without asking me first. How can I stop this behavior?

(Normally I'd be happy with it automatically mounting storage so I can use it easily. But this is a development machine and a strict requirement is that it does not mount SD cards automatically.)

4

As an alternative to removing the whole udisks2 package (as suggested in the answer first given), you may instead want to overwrite the default rule for mmcblk[0-9] from the distributed configuration file /lib/udev/rules.d/80-udisks2.rules. For this purpose create a file for example named /etc/udev/rules.d/80-udisks2-nosdcard.rules and put a copy of the line from the default configuration file augmented with the option ENV{UDISKS_IGNORE}="1" into it. After editing it might be required to restart the udisksd daemon process using for example the command:

sudo service udisks2 restart
  • You should never edit the configuration file directly in the /lib/udev/rules/ directory. Any change, like an update, to udev/udisks2 will overwrite this. Not only is this not recommended in the documentation, it even say so directly at the top of the rules file. – Zimano May 4 '17 at 13:08
  • You are right: For some reason I overlooked that the path was starting with /lib instead of /etc. – pefu May 4 '17 at 13:22
  • I've changed my answer according to your hint. – pefu May 4 '17 at 13:30
0

Try removing udisks or udisks2 packages. Please check the list before removing, since AFAIK those packages are pulled as dependencies of your desktop environment, and you don't want to remove that.

  • I found out that it is indeed udisks2. Using d-feet I explored the udisks2 D-bus interfaces and for my block device (SD card) found that the AutoHint was true. Looking in the udisks2 documentation I found this decided if the device was mounted automatically. To fix this, I have to place a specific rule for this in the udisks2 rules file under /etc/udev/rules. This answer is not really what I'm looking for as this removes udisks2 entirely, possibly bringing down other (automount) features as well. – Zimano May 4 '17 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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