You are not logged in.

#1 2009-12-02 17:46:48

muchzill4
Member
From: Poland
Registered: 2009-03-30
Posts: 30

[SOLVED] USB mount weird problem.

So, I have this weird problem - udev automounting does not allow normal user to write to usb device.

/etc/fstab:

/dev/sdc1 /media/usbhd-sdc1 vfat users,exec,dev,suid 0 1
/etc/rules.d/10-my-udev.rules:

KERNEL!="sd[a-z][0-9]", GOTO="mnt_auto_mount_end"

ACTION=="add", RUN+="/bin/mkdir /media/usbhd-%k", RUN+="/bin/mount /dev/%k"
ACTION=="remove", RUN+="/bin/umount -l /media/usbhd-%k", RUN+="/bin/rmdir /media/usbhd-%k"
LABEL="mnt_auto_mount_end"

When I manually do:

$ mount /dev/sdxy

it works nicely, but when i do it with 'sudo' it's the same as udev. So I guess that's something with udev. Can any1 help me? smile

Last edited by muchzill4 (2009-12-02 20:29:38)

Offline

#2 2009-12-02 18:48:22

tavianator
Member
From: Waterloo, ON, Canada
Registered: 2007-08-21
Posts: 858
Website

Re: [SOLVED] USB mount weird problem.

What filesystem is on your flash drive?  If it's FAT, there's no concept of ownership, so linux will just make the user running mount own everything, hence permissions problems when root mounts it.  I believe RUN+="/bin/mount -o uid=<your uid>,gid=<your gid> /dev/%k" or RUN+="/bin/mount -o umask=000 /dev/%k" will make it writeable by you and the world, respectively.  If the second solution is too insecure but you need multiple users to be able to access mounted flash drives, check out HAL.

Offline

#3 2009-12-02 20:29:49

muchzill4
Member
From: Poland
Registered: 2009-03-30
Posts: 30

Re: [SOLVED] USB mount weird problem.

Tyvm, works. smile

Offline

Board footer

Powered by FluxBB