Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Probelm with mount with udev regulars and rights
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
lovelytux
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2013
Posts: 108

PostPosted: Fri Aug 23, 2013 6:27 pm    Post subject: [SOLVED] Probelm with mount with udev regulars and rights Reply with quote

Hey,
Problem: mount shows me, that the filesystem is mounted for user but only root has rights not the normal user.

I mount an usb-stick. The Filesystem is ext3. I write regular for udev: /etc/udev/rules.d/33-usb.rules

Code:
KERNEL=="sdc2", ATTR{size}=="23592960", SYMLINK+="usb-sdc2-stick",
MODE="0666", GROUP="users"

ACTION=="add", RUN+="/bin/mount -t auto -o rw,user,users /dev/usb-sdc2-stick
/media/usb-sdc2"
ACTION=="remove", RUN+="/bin/umount /media/usb-sdc2"

The Symling "/dev/usb-sdc2-stick" is create:

/dev/ls -hasl usb-sdc2* =>
Code:
0 lrwxrwxrwx  1 root root     4 23. Aug 19:19 usb-sdc2-stick -> sdc2


mount -l | grep sdc2 =>

Code:
/dev/sdc2 on /media/usb-sdc2 type ext3 (rw,noexec,nosuid,nodev,user))
shows me, that the device is mounted with "rw" but the user can't create folders or files.

Thanks for help!

lovelytux


Last edited by lovelytux on Sat Aug 24, 2013 9:03 am; edited 2 times in total
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1522

PostPosted: Fri Aug 23, 2013 7:03 pm    Post subject: Reply with quote

What output
Code:
ls -ld /media/usb-sdc2
?
Back to top
View user's profile Send private message
lovelytux
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2013
Posts: 108

PostPosted: Fri Aug 23, 2013 9:08 pm    Post subject: Reply with quote

Hey,

Code:
drwxr-xr-x 3 root root 4096 23. Aug 18:36 /media/usb-sdc2


lovelytux
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1522

PostPosted: Fri Aug 23, 2013 9:19 pm    Post subject: Reply with quote

Try passing an additional option for mount. Udev rule looks like:
Code:
ACTION=="add", RUN+="/bin/mount -t auto -o rw,user,users,umask=0 /dev/usb-sdc2-stick
/media/usb-sdc2"
Back to top
View user's profile Send private message
lovelytux
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2013
Posts: 108

PostPosted: Fri Aug 23, 2013 9:27 pm    Post subject: Reply with quote

Hey,

nothing is mount.
Quote:
mount -l | grep /dev/sdc2
is empty.

lovelytux
Back to top
View user's profile Send private message
lovelytux
Tux's lil' helper
Tux's lil' helper


Joined: 23 Aug 2013
Posts: 108

PostPosted: Fri Aug 23, 2013 10:24 pm    Post subject: Reply with quote

Hey,

I delete "user,users"(contradictory) and add one line (3rd). I hope this is a neat solution ! ?

Code:
KERNEL=="sdc2", ATTR{size}=="23592960", SYMLINK+="usb-sdc2-stick", MODE="0666", GROUP="users"
ACTION=="add", RUN+="/bin/mount -t auto -o rw  /dev/usb-sdc2-stick /media/usb-sdc2"
ACTIOM=="add", RUN+="/bin/chown -R lovelytux: /media/usb-sdc2"
ACTION=="remove", RUN+="/bin/umount /media/usb-sdc2"


Thanks for help! lovelytux
Back to top
View user's profile Send private message
quilosaq
Veteran
Veteran


Joined: 22 Dec 2009
Posts: 1522

PostPosted: Fri Aug 23, 2013 10:40 pm    Post subject: Reply with quote

I was wrong. umask is for fat filesystem only. Sorry.
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Aug 23, 2013 11:01 pm    Post subject: Reply with quote

Quote:
ACTION=="remove", RUN+="/bin/umount

That will not work as hoped, because umount must be performed before removal. Remove that useless rule.

It's sensible to use the flush option, to be confident that writes have been performed, e.g.:
Code:
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},flush,utf8,gid=100,umask=002"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum