LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 03-17-2008, 11:12 PM   #1
yitzle
Member
 
Registered: Aug 2006
Posts: 50

Rep: Reputation: 15
Gnome: Auto mounting external devices as first user logged in, not current user


Debian, Gnome.
When I insert a memory card into the flash reader, Gnome/Debian automoaunts it (pmount?).
However, if there are two users logged it, it sets the mount folder's owner to whomever the first user is and the second user can not access the device.
How do I solve this?
 
Old 03-18-2008, 10:32 AM   #2
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Debian GNU/Linux with XFCE and packages from "testing"
Posts: 377

Rep: Reputation: 46
I'm thinking of two possibilities:

(1)
The first user can umount it by opening the context menu on the device (probably right mouse button) and choosing "umount device" (could be "remove" or "aushängen" [in german], I don't know exactly). After that, the current user can use it (GNOME will automatically re-mount it when programs demand it).

(2)
If that doesn't help, you will probably have to edit the file /etc/fstab and find out what the block device file for your card reader is (probably /dev/sda or /dev/sda1); unfortunately, GNOME doesn't tell us that (I really think it should!).
Do that like this: change into a tty console (e.g. press ctrl+alt+F2; don't open a terminal/console window). Then insert a flash card; the terminal should show a bunch of messages. When I do that with USB storage, my device name (without "/dev/") appears in squared brackets, [sda], several times. To go back to GNOME, press ctrl+alt+F7 (can be ctrl+alt+F6 or ctrl+alt+any other F-key if you modified Debian so).
How to edit the file: Press alt+F2 and enter gksu gedit /etc/fstab and press Enter or click on "execute". The system will ask for the root password. If you misspell it, nothing happens (you are not even told).
Without having changed it since installation (I use GNOME's automation), my /etc/fstab looks like this:
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda5       /home           ext3    defaults        0       2
/dev/hda6       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   auto	user,noauto     0       0
If the contents in the device /dev/sda are to be accesible by anyone, I add one line in /etc/fstab like this:
Code:
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda5       /home           ext3    defaults        0       2
/dev/hda6       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   auto	user,noauto     0       0
/dev/sda        /mnt/sda        auto    defaults,user,umask=000  0       0
The options user,umask=000 make the device mountable and accesible by any user.

I hope this helps, good luck

Last edited by TITiAN; 03-18-2008 at 11:29 AM.
 
Old 03-30-2008, 11:34 PM   #3
yitzle
Member
 
Registered: Aug 2006
Posts: 50

Original Poster
Rep: Reputation: 15
Sorry for the late response.
The first solution doesn't work for me because the first user may not be around.
The second solution doesn't seem to work, either. When I modified my fstab, it tried mounting it on boot and failed (device wasn't present).
The same issue applies to when a USB key is inserted.
Is there a way to change the default permissions used by pmount?

EDIT: This might do it -> http://ubuntuforums.org/showthread.php?t=386400
EDIT: Or this -> http://www.togaware.com/linux/surviv...e_Manager.html

Last edited by yitzle; 03-30-2008 at 11:40 PM.
 
Old 03-31-2008, 12:18 AM   #4
yitzle
Member
 
Registered: Aug 2006
Posts: 50

Original Poster
Rep: Reputation: 15
It seems gnome-volume-manager doesn't play nice with multiple X11 sessions/servers running at once.
So I turn it off and use the Disk Mounter applet instead.
However, I'm having trouble keeping stuff from starting up with the new session. The session manager doesn't seem to be able to edit the startup programs that were put there when the account was set up.
For now I just ran chmod 644 /usr/bin/gnome-volume-manager
 
Old 04-01-2008, 09:43 AM   #5
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Debian GNU/Linux with XFCE and packages from "testing"
Posts: 377

Rep: Reputation: 46
Quote:
Originally Posted by yitzle View Post
[...]it tried mounting it on boot and failed (device wasn't present).[...]
Yes, sorry; I forgot the "noauto" option in /etc/fstab. If you add it, the system won't try to mount /dev/sda on startup, but only when a user (here: gnome) demands it.
Any questions?
 
  


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
auto exec take after user has logged in linuxmandrake Ubuntu 1 02-08-2006 12:08 PM
Mounting external HDD as user mabalel Mandriva 12 01-20-2006 04:03 AM
Multi-user and 3D sharing, 3D only works for the first logged in user foxy123 Suse/Novell 0 02-20-2005 04:31 AM
smbmount not mounting when logged on as a user hunan6 Slackware 1 02-05-2005 08:27 PM
mounting drives and devices as an ordinary user jamesbond Linux - Newbie 3 07-07-2002 05:40 AM


All times are GMT -5. The time now is 01:09 PM.

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
Open Source Consulting | Domain Registration