5

In Ubuntu 20.04 (as in previous versions), external USB drives are automatically mounted when they are plugged in, and an icon for each partition appears in the Dock.

How is that working? Which services take care of that, and where do they get the details for their configuration?

In particular, I would like to change mount options for NTFS and HFS+ partitions.

There are several similar questions, but they seem more focused on specific drives, and the answers send to /etc/fstab, or using the Disks utility (gnome-disk-utility) to edit options which will only apply to one specific drive or partition.

The AutomaticallyMountPartitions page mentions udisks, but only shows how to use it interactively and doesn't describe how it interacts with the other parts.

I can also find udev rules with scripts to automount partitions, but the system already does that.

mivk
  • 5,312
  • 1
    have you looked at https://help.ubuntu.com/community/Mount/USB or https://help.ubuntu.com/community/UsbDriveDoSomethingHowto ? – Jad Jan 25 '22 at 14:44
  • @Jad: unfortunately, nothing new in these pages. And, yes, I had already installed dconf-editor to look for settings there, but that didn't help either. – mivk Jan 25 '22 at 15:03

1 Answers1

1

You can provide specific mount options for automatically mounted partitions in a file /etc/udisks2/mount_options.conf. For example, one could set options for a specific drive as:

[/dev/disk/by-uuid/18afd8f0-0d86-4d96-8de0-5f92d2ee9800]
defaults=uid=$UID,gid=$GID,noexec

See /etc/udisks2/mount_options.conf.example for details and examples on how changes can be changed, globally or for specific drives and/or file systems.

vanadium
  • 88,010