LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
LinkBack Search this Thread
Old 05-21-2010, 06:50 AM   #16
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,516
Blog Entries: 27

Rep: Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174Reputation: 1174

Quote:
Originally Posted by Linux.tar.gz View Post
It's mounted via udev/hal and Xfce volman.
What is the file system on these USB drives -- vfat, NTFS, ext3 ... ?

Which user is logged on at the Xfce desktop when volman mounts the volume -- root or an ordinary user?

After it is mounted by volman, what does the mount command display for it? What are the permissions of a sample of files in the root of the mounted volume? Here is an example as mounted by Thunar not volman
Code:
c@CW8:~$ mount
[snip othe file systems]
/dev/sdc1 on /media/CHARLES8GB type vfat (rw,nosuid,nodev,uhelper=hal,shortname=winnt,uid=1000)
c@CW8:~$ /bin/ls -l /media/CHARLES8GB
total 8
-rwxr-xr-x 1 c root  111 2008-10-11 11:35 Owners' contact details.txt
drwxr-xr-x 2 c root 4096 2010-03-28 14:55 Printing
 
Old 05-21-2010, 07:08 AM   #17
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
It's actually fat32. But it must work for ntfs too.

The /media/KINGSTON folder belongs to the current user:root

/dev/sdb1 on /media/KINGSTON type vfat (rw,nosuid,nodev,uhelper=hal,shortname=winnt,uid=1000)

BTW it's mounted by thunar, so i assume, thunar-volman

Found this, but there's no devfsd.conf anymore :
http://forum.xfce.org/index.php?topic=3250.0

Last edited by Linux.tar.gz; 05-21-2010 at 07:12 AM.
 
Old 05-21-2010, 08:24 AM   #18
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946Reputation: 1946
Quote:
Originally Posted by Linux.tar.gz View Post
It's actually fat32. But it must work for ntfs too.
That's your entire problem right there. Neither FAT nor NTFS support posix-style permissions. They can only be simulated by applying a umask in your mount options.

Whatever mount system you're using, find out how to add mount options and give it a umask=000. This will give you simulated 777 permissions.

See the mount man page for more on mount options for various file types.
 
Old 05-21-2010, 08:59 AM   #19
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
Yep, i was aware of this, but i don"t find where to apply those options.
I don't know which program create /media/name_of_my_key and mounts the device into it.
As far as i get, udev rules only applies on /dev/sdb1 , and gives 777 to it.
What happens next is a mystery :/

-----EDIT :
The answer may be in /usr/share/hal/fdi/policy/10osvendor/

-----EDIT 2 :
Used some rules from here :
http://ubuntuforums.org/showthread.php?t=141295
But hal seems to totally ignore it...

Last edited by Linux.tar.gz; 05-21-2010 at 09:31 AM.
 
Old 11-18-2010, 09:33 AM   #20
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
Yay !

Created /etc/udev.d/11-media-by-label-auto-mount.rules

Here's the content :

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

# Global mount options
ACTION=="add", ENV{mount_options}="relatime,users"
# Filesystem specific options
ACTION=="add", PROGRAM=="/sbin/vol_id -t %N", RESULT=="vfat|ntfs-3g", ENV{mount_options}="$env{mount_options},utf8,gid=100"
ACTION=="add", PROGRAM=="/sbin/vol_id --label %N", ENV{dir_name}="%c"
ACTION=="add", PROGRAM!="/sbin/vol_id --label %N", ENV{dir_name}="usb-%k"
#ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options},umask=000,users /dev/%k /media/%E{dir_name}"
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o rw,noauto,users,umask=000,iocharset=utf8 /dev/%k /media/%E{dir_name}"
ACTION=="remove", ENV{dir_name}=="?*", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"
LABEL="media_by_label_auto_mount_end"

--------------EDIT :
Seems umounting doesn't work properly.
I'm playing around with two systems and i'm a bit confused by now. Anyway this is a huge step.

Last edited by Linux.tar.gz; 11-18-2010 at 11:25 AM.
 
Old 11-23-2010, 05:56 AM   #21
Linux.tar.gz
Senior Member
 
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,223

Original Poster
Rep: Reputation: 86
Installed pmount, and changed /etc/udev.d/11-media-by-label-auto-mount.rules for using pumount instead of umount.

Now it works.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] udev rules to automatically apply 666 permission linuxmandrake Linux - Newbie 2 04-03-2010 03:31 AM
slackware 12.0, udev rules for usb-dev works, but mounting does not work correct paalmarker Linux - General 5 03-30-2010 01:51 AM
? on accessing usb drive in SuSE 10 with udev steve_f60 Linux - Newbie 1 03-05-2008 08:21 PM
Can I make a udev rule for a particular usb port? kairen Slackware 3 02-15-2008 08:30 AM
Trying to use udev to auto mount usb drive njnear Linux - General 5 12-04-2007 01:53 AM


All times are GMT -5. The time now is 05:16 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration