4

How do I set GID/UID and mode bits assigned to the directory in /media, to which my USB drive is auto-mounted when I plug it in (i.e. to the directory, which represents the drive itself, e.g. /media/MyUSBDriveLabel)?

I'm trying to make an auto-mounted drive accessible by several users, belonging to the same group. Bu default I'm getting it accessible to the current user only:

$ ls -ld /media/MyUSBDriveLabel
drwx------ 18 user group 16384 1970-01-01 03:00 MyUSBDriveLabel

while I'd like to get something like

drwxrwx--- 18 user sharedgroup 16384 1970-01-01 03:00 MyUSBDriveLabel

Is it doable with Nautilus's auto-mount or should I use some other auto-mount solution?

1 Answer 1

1

A very similar question has a udev-based answer. Try taking that solution, but replace the MODE setting with a USER and/or GROUP setting.

5
  • Or maybe not. It seems that answer will let you control the owner of the device file, not the owner of the mounted filesystem. Aug 1, 2011 at 16:46
  • The only other answer I've been able to find involves recompiling udisks-daemon (which is what actually does the mount on Ubuntu 10.10, as far as I can tell - not nautilus itself, despite nautilus having support for doing the mount itself). This isn't a very satisfying solution, though. Aug 1, 2011 at 16:47
  • Nope, udev's RUN option is the way to go. One cane issue a mount command inside that option. See: askubuntu.com/questions/54321/…
    – con-f-use
    Aug 1, 2011 at 16:50
  • Ooh. Following a link to wiki.archlinux.org/index.php/… from askubuntu.com/questions/30762/… suggests that udev can control the mount options using something like ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002" which should actually affect the mounted filesystem in the usual way. Aug 1, 2011 at 16:50
  • Or the arch way. That is untested though :D
    – con-f-use
    Aug 1, 2011 at 16:52

You must log in to answer this question.

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