1

I have a number of disk partitions, which are represented by icons in the GUI. Something like this:

Media-icon

When I double-click on this icon, the partition got mounted. Or I can right-click on this icon and get a three-line menu with operations Open/Mount Volume/Properties.

My questions - where can I find an actual command line text, which is executed during this operation? Can I modify/adjust this line for my needs?

Raffa
  • 34,963
HEKTO
  • 585

1 Answers1

1

Where can I find an actual command line text, which is executed during this operation?

What you want should look like this:

udisksctl mount -b /dev/sdxy

Can I modify/adjust this line for my needs?

Yes, see man udisksctl.

Notice on Ubuntu, this is handled by udisks and usually tracked/managed by gvfsd.

However modifying the default behavior of those daemons/services is not recommended and you should, instead, consider using udisksctl as a command in your custom script/shortcut for mounting/unmounting filesystems actions or adding udev rules for actions other than mounting/unmounting filesystems.

That said, ...

What do you want to achieve?

Is it, for example, to set read-only ro mount option as the default for "all" automatically mounted media? ...

Refer to /etc/udisks2/mount_options.conf.example and create/edit /etc/udisks2/mount_options.conf to look like this:

[defaults]
# # common options, applied to any filesystem, always merged with specific filesystem type options
defaults=ro
allow=exec,noexec,nodev,nosuid,atime,noatime,nodiratime,ro,rw,sync,dirsync,noload
... or is it, for example, to set read-only ro mount option as the default for "a specific" automatically mounted media/disk/partition? ...

Hove a look at /dev/disk/by-* in order to identify your target media/disk/partition device and use that as follows ...

Refer to /etc/udisks2/mount_options.conf.example and create/edit /etc/udisks2/mount_options.conf to look like this:

[/dev/disk/by-partuuid/30ea9e87-01]
# # Options, applied to a specific partition by partition uuid
defaults=ro
allow=exec,noexec,nodev,nosuid,atime,noatime,nodiratime,ro,rw,sync,dirsync,noload
... or do you prefer "a more portable, independent and powerful" media/disk/partition mounting/unmounting way? ...

See Different behaviour of bash script in udev

Raffa
  • 34,963