8

I share my computer in a multiseat configuration and would like everyone to mount removable devices with a umask of 0 (ie. readable and writeable by all and sundry). Well, ideally just by group disks or plugdev or something, but global will do in a pinch.

Except nope, it insists on mode 700 with owner and group as my user.


Things I thought might work but didn't:

Policy kit

This got people able to mount the device. But the permissions were wrong. It does not seem to be possible to change the permissions here---I think only udisks can.

udev

Tried this rule and didn't manage to get the USB stick. However I'm pretty sure it's moot as this would be the permissions for the device and not the mountpoint and those are already adequate with a gid of disk.

KERNEL=="sd*[0-9]", ATTR{removable}=="1", ENV{ID_BUS}=="usb", MODE="0000"

KDE Device Notifier + udisks

udisks performs the mount operation for the KDE Device Notifier. However, it does not have any setting to control/override the mount options it uses. Device Notifier does not seem to have any setting for group or umask either.

However, if one mounts it manually, things work fine. This does anyhow:

udisks --mount /dev/sdf1 --mount-options umask=0

udisks-glue

A very promising tool, but no dice. udisks-glue lets your configure custom reactions to udisks events on dbus! It can automount devices and you can control the umask for that. Alas this has no effect on the mount options for the Device Notifier and there is no setting to override mount options generally.

It can trigger an event when udisks mounts something. So I thought I'd use it to remount the drive. Except it turns out that while it passes along most mount options just fine, udisks cannot handle remount.

$ udisks --mount /dev/sdf1 --mount-options umask=0,remount
Mount failed: Mount option remount is not allowed

Aaaand I'm stumped. Any ideas? I'm on 12.10 still, maybe 13.04 has some magic for this?

4
  • 1
    I can't get automounting to work on 13.10.:) Maybe the KDE-bits haven't picked up on that user-stuff is to be mounted at /media/<username> now.
    – kaleissin
    Nov 27, 2013 at 11:41
  • Did you fix this? I have the same issue and cannot find any solution
    – mgutierrez
    Jun 17, 2015 at 9:12
  • @skomorokh: Have you gotten a solution ?
    – Cbhihe
    Oct 10, 2015 at 14:16
  • Did you try listing each device by UUID in /etc/fstab with a mountpoint like /media/USB1 with read/write access to your group of users?
    – mDfRg
    Apr 2, 2016 at 0:23

2 Answers 2

2

The ability to modify the allowed and default mount options is now available in udisks2 as of version 2.9.0. Note that you'll need to install a newer version of udisks2 on Ubuntu 18.04 and 20.04 to have access to this functionality. I wrote up a tutorial on how to install it from source on Ubuntu 18.04 here for anyone who is interested. The official udisks2 documentation can be found here for how to configure default and allowed mount options.

For your particular use case, you could set the default vfat options to include umask=0 in /etc/udisks2/mount_options.conf as shown here.

[defaults]
vfat_defaults=uid=$UID,gid=$GID,shortname=mixed,utf8=1,showexec,flush,umask=0
0

The best option I've found is udiskie. Udiskie is in Debian, and thefore also in Ubuntu.

I share my computer in a multiseat configuration and would like everyone to mount removable devices with a umask of 0 (ie. readable and writeable by all and sundry).

This is what it does by default.

udiskie-mount devicename

Sample session:

udiskie-mount /dev/disk/by-uuid/4E1AEA7B1AEA6007
mounted /org/freedesktop/UDisks2/block_devices/sde1 on /media/faheem/My Passport
cd /media/faheem/My\ Passport
ls -lah
total 302G
drwxrwxrwx  1 faheem faheem 8.0K Apr 19 04:18 .
drwxr-x---+ 3 root   root   4.0K Apr 19 21:08 ..
drwxrwxrwx  1 faheem faheem 4.0K Apr 19 04:19 backup-home

If you want to mount with a specific set of permissions, you can do, for example:

udiskie-mount -o umask=0022 devicename

Sample session:

cd ..
udiskie-umount /dev/disk/by-uuid/4E1AEA7B1AEA6007
unmounted /org/freedesktop/UDisks2/block_devices/sde1

cd /media/faheem/My\ Passport
ls -lah
total 302G
drwxr-xr-x  1 faheem faheem 8.0K Apr 19 04:18 .
drwxr-x---+ 3 root   root   4.0K Apr 19 21:10 ..
drwxr-xr-x  1 faheem faheem 4.0K Apr 19 04:19 backup-home

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .