View previous topic :: View next topic |
Author |
Message |
lovelytux Tux's lil' helper
Joined: 23 Aug 2013 Posts: 108
|
Posted: Fri Aug 23, 2013 6:27 pm Post subject: [SOLVED] Probelm with mount with udev regulars and rights |
|
|
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 |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1522
|
Posted: Fri Aug 23, 2013 7:03 pm Post subject: |
|
|
What output Code: | ls -ld /media/usb-sdc2 | ? |
|
Back to top |
|
|
lovelytux Tux's lil' helper
Joined: 23 Aug 2013 Posts: 108
|
Posted: Fri Aug 23, 2013 9:08 pm Post subject: |
|
|
Hey,
Code: | drwxr-xr-x 3 root root 4096 23. Aug 18:36 /media/usb-sdc2 |
lovelytux |
|
Back to top |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1522
|
Posted: Fri Aug 23, 2013 9:19 pm Post subject: |
|
|
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 |
|
|
lovelytux Tux's lil' helper
Joined: 23 Aug 2013 Posts: 108
|
Posted: Fri Aug 23, 2013 9:27 pm Post subject: |
|
|
Hey,
nothing is mount. Quote: | mount -l | grep /dev/sdc2 | is empty.
lovelytux |
|
Back to top |
|
|
lovelytux Tux's lil' helper
Joined: 23 Aug 2013 Posts: 108
|
Posted: Fri Aug 23, 2013 10:24 pm Post subject: |
|
|
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 |
|
|
quilosaq Veteran
Joined: 22 Dec 2009 Posts: 1522
|
Posted: Fri Aug 23, 2013 10:40 pm Post subject: |
|
|
I was wrong. umask is for fat filesystem only. Sorry. |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Fri Aug 23, 2013 11:01 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|