Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 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.

share|improve this answer
    
Or maybe not. It seems that answer will let you control the owner of the device file, not the owner of the mounted filesystem. –  Jean-Paul Calderone Aug 1 '11 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. –  Jean-Paul Calderone Aug 1 '11 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 '11 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. –  Jean-Paul Calderone Aug 1 '11 at 16:50
    
Or the arch way. That is untested though :D –  con-f-use Aug 1 '11 at 16:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.