You are not logged in.

#1 2014-10-17 07:35:18

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Default mount options for media mounted automatically

Removable media are automounted or mounted when you click on them in most major desktop environments (depending on the configuration). My question is what are the default mount options used? Is that configurable. In my understanding, it is udisk that mount them.

Last edited by olive (2014-10-17 07:44:44)

Offline

#2 2014-10-17 08:26:17

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Default mount options for media mounted automatically

Your question is too vague to be answered precisely; there exists many way to automount devices in many different desktop environments;
and in each case the answer could be different.
As for automounting using udisks2 API, udisks2 is pretty strict on non default mounting options, only a few considered safe are permitted.
You can see the default options with the output of the 'mount' command;
and you can test if an option is accepted by udisks2 by manually trying to mount the device with the 'udisksctl mount' command with the options you want to try (--options).
To be able to choose freely the mount options, I think udisks2 is not the good tool for that; but there exists other tools which will permit this more easily.

Offline

#3 2014-10-17 08:56:43

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Default mount options for media mounted automatically

@berbae. Thank you for your answer, but it does not really answer my question. I was speaking of the mounting of the removable media by the desktop with the default setup. I am currently on KDE. I think KDE use udisk2 as well as other major desktop environment. My question was more how can change the default mount options than just seeing them with the mount command. What I want is to be able  to change the mount options used by udisk2 when you do not mention options explicitly, so that they are applied when KDE use udisk2 (There does not seems to be a KDE configuration allowing me to pass options to udisk2). Moreover can I change what is considered "safe". This is a general question, but I would like in particular force an NTFS mount obeying the normal Windows conventions when mounting an NTFS USB storage system (key or hard drive), so that Windows is not confused. ntfs-3g has all the options I want: case insensitivity, making new files with the default Windows permissions (inherit), applying Windows restrictions in file names, etc. But I do not know to apply these options if I just click on the removable media from KDE.

Last edited by olive (2014-10-17 08:58:54)

Offline

#4 2014-10-17 15:25:22

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Default mount options for media mounted automatically

I tested some of the ntfs-3g options you mentioned on a ntfs partition:

$ udisksctl mount --block-device /dev/sdb4 --options 'ignore_case'
Error mounting /dev/sdb4: GDBus.Error:org.freedesktop.UDisks2.Error.Failed: Error mounting /dev/sdb4 at /run/media/berbae/windows: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=100,dmask=0077,fmask=0177,ignore_case" "/dev/sdb4" "/run/media/berbae/windows"' exited with non-zero exit status 11: 'ignore_case' is an unsupported option.

$ udisksctl mount --block-device /dev/sdb4 --options 'inherit'                                              
Error mounting /dev/sdb4: GDBus.Error:org.freedesktop.UDisks2.Error.OptionNotPermitted: Mount option `inherit' is not allowed

$ udisksctl mount --block-device /dev/sdb4 --options 'windows_names'
Mounted /dev/sdb4 at /run/media/berbae/windows.

$ mount|grep sdb4
/dev/sdb4 on /run/media/berbae/windows type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)

Only the 'windows_names' options is accepted, but it doesn't appear in the output of the mount command; maybe it is default.
It's possible that some of the options you want are default already with ntfs-3g.

But as I said in my previous post "To be able to choose freely the mount options, I think udisks2 is not the good tool for that".
So if KDE uses the udisks2 API, using its automounting feature will not do it also.
There is no configuration file for udisks2, all is hard coded in the source code or taken from /etc/fstab.

A simple way to obtain what you want is to add an entry for the ntfs partition with the options you choose in  /etc/fstab ;
so udisks2, and KDE will use it for mounting.

Or you can try another (auto)mounting tool: https://wiki.archlinux.org/index.php/Li … ount_tools

Last edited by berbae (2014-10-17 15:35:21)

Offline

#5 2014-10-17 15:31:34

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: Default mount options for media mounted automatically

Well if you say that it is not configurable, so it is. I was interested in this for newly inserted usb key (fstab works only for fixed media that we can clearly identify when we put the entry). In fact KDE, in my configuration, does not automount the media, it mount them when I click on the icon: this is a good behaviour. I believe it uses udisk2 but I am not sure. If I have to do the thing from the command line, it is then easier to use the standard mount command (possibly with the help of sudo).

Last edited by olive (2014-10-17 15:43:30)

Offline

Board footer

Powered by FluxBB