How do I change the mount options (specifically, permissions) of auto-mounted vfat usb keys?

Asked by Christopher Armstrong on 2009-10-14

Before Karmic, when I plugged in my USB key, it would mount the vfat filesystem as the user who owned the current X session with permissions restricted to that user.

Since upgrading to Karmic, it still auto-mounts the filesystem as the current user, but now it uses world-readable permissions.

This is problematic for me because I keep my SSH private key on the filesystem. Of course, not only is it a security issue, but practically, ssh-add refuses to accept a key which is world-readable.

I *think* there used to be a way to set mount options with nautilus if you right-clicked the volume and went to properties, but no such setting exists in Karmic. I've tried "palimpset" ("Disk Utility" in system->administration) but it doesn't have any way to set mount options. I've read man pages for DeviceKit-disks and devkit-disks and devkit-disks-daemon, and while devkit-disks appears to have a way to mount a device with particular options, it doesn't seem to have a way to set the mount options in a persistent way.

Do I have to edit udev configuration files, or something?

Alternatively, could the default settings in Karmic be changed back to only allowing the current user to see the device?

Question information

English Edit question
Ubuntu devicekit-disks Edit question
No assignee Edit question
Last query:
Last reply:
Christopher Armstrong (radix) said : #1

Sorry, I typoed "palimpsest" above.

You can use the UUID of the disk in /etc/fstab (which can be determined with sudo blkid)

If you create a folder in /media for each storage device you use, you can use the fstab file to tell the system how to mount the device there. I'm sure there is a more graceful way but I personally dont like automount and prefer to mount things how I want, rather than what the OS thinks I want.

Maybe someone else has a more graceful method but thats how I'd do it.

Maxim Kalinin (kalinin-maxim) said : #3

That's weird. I have the opposite problem: I want the automounted USB drives to be readable for everyone, but they aren't. (I'm at lucid currently, but I remember clearly that with Karmic it was the same.) I tried setting umask=0777 in HAL config (/usr/share/hal/fdi/policy/10osvendor/20-storage-methods.fdi), but it didn't help.

Jochen Fahrner (jofa) said : #4

I have the same problem. I would like to add the "noatime" option for mounting optical media (DVD-RAM). Without "noatime" timestamps are written on every read access, slowing down read speed and waering the media.
The same ist true for flash memory media.

Can you help with this problem?

Provide an answer of your own, or ask Christopher Armstrong for more information if necessary.

To post a message you must log in.