Gentoo Archives: gentoo-user

From: Joost Roeleveld <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] pmount question
Date: Tue, 22 Feb 2011 14:13:56
Message-Id: 20110222133609.C99192569@data.antarean.org
In Reply to: Re: [gentoo-user] pmount question by David Relson
1 On Tuesday 22 February 2011 07:33:45 David Relson wrote:
2 > On Tue, 22 Feb 2011 08:37:06 +0000
3 >
4 > Neil Bothwick wrote:
5 > > On Mon, 21 Feb 2011 21:01:25 -0500, David Relson wrote:
6 > > > > pmount is supposed to be run as a user and it mounts the
7 > > > > filesystem owned by the user running it. If you only have a
8 > > > > single user, you could call pmount with su. If you have multiple
9 > > > > users, you should be letting a desktop tool handle the mounting
10 > > > > anyway.
11 > > >
12 > > > I've heard "pmount ... as a user" before, but never understood what
13 > > > it meant. If "pmount ..." is run by a rule
14 > > > in /etc/udev/rules.d/10-local.rules, how is it known what userid to
15 > > > use? Does "pmount ... as a user" assume particular settings in
16 > > > gnome, the kernel, or ???
17 > >
18 > > pmount is meant to be run by a normal user, usually from an
19 > > automounter, as its main objective is to allow normal users to mount
20 > > removable devices without fstab rules, while udev rules are run as
21 > > root. So if you want it to run as a user from a udev rule you'll have
22 > > to use su, as in
23 > >
24 > > su youruser -c 'pmount /dev/PTY'
25 >
26 > Neil:
27 >
28 > I'm currently using "pmount -u 007 /dev/PTY" as this gives rwx
29 > permissions for root and group plugdev, which is adequate for my
30 > workstation (which only ever has me using it).
31 >
32 > I've seen that Ubuntu with Gnome automounts USB sticks. That seems
33 > pleasantly convenient and is done without any rules (such as I
34 > presently have) in /etc/udev/rules.d. Do you know what they're doing?
35
36 Gnome (and most other desktop environments) can be configured to auto-mount a
37 USB-drive, CDs,...
38
39 Gnome will, as is mentioned previously, probably use "pmount" started as the
40 current user which will then mount the drive with the user as the owner.
41
42 udev-rules are only really needed when you don't (want to) use an automounter
43 with your X-desktop.
44
45 I myself use KDE and there I can specify if I want a USB-drive mounted or not.
46 I believe I can also specify some USB-drives to auto-mount when I plug them
47 in. But I do prefer to be able to decide each time as sometimes I just plug in
48 my phone or camera to charge it. (My phone also acts like a usb-drive when so
49 configured)
50
51 --
52 Joost

Replies

Subject Author
Re: [gentoo-user] pmount question Neil Bothwick <neil@××××××××××.uk>