* [gentoo-user] pmount question @ 2011-02-21 23:58 David Relson 2011-02-22 0:11 ` Neil Bothwick 0 siblings, 1 reply; 7+ messages in thread From: David Relson @ 2011-02-21 23:58 UTC (permalink / raw To: gentoo-user G'day, My USB subsystem is working much better now (than it was this weekend). /etc/fstab had a reference to "/dev/hdb" which no my current kernel no longer supports. Removing this has improved flash drive mounting a whole lot! I've also modified /etc/udev/rules.d/10-local.rules to use "pmount device label" rather than "mount -a". This is mounting flash drives in /media as desired: root@osage media # ls -l total 32 drwx------ 19 root plugdev 16384 Dec 31 1969 PNY drwx------ 3 root plugdev 16384 Dec 31 1969 SD_2G However (as can be seen above) the permissions are 700, which makes the drives unusable by members of the plugdev group. Alternatively, I can use "pmount -u 007 device label" to provide full access to the plugdev group. This seems awkward and inelegant. What's the right way to use pmount and set permissions? Regards, David ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] pmount question 2011-02-21 23:58 [gentoo-user] pmount question David Relson @ 2011-02-22 0:11 ` Neil Bothwick [not found] ` <20110221210125.34e17f3b@osage.osagesoftware.com> 0 siblings, 1 reply; 7+ messages in thread From: Neil Bothwick @ 2011-02-22 0:11 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 1287 bytes --] On Mon, 21 Feb 2011 18:58:38 -0500, David Relson wrote: > I've also modified /etc/udev/rules.d/10-local.rules to use "pmount > device label" rather than "mount -a". This is mounting flash drives > in /media as desired: mount -a was always a bad idea, because it could potentially affect drives other than the one the rule was intended for. What would happen if you had unmounted a filesystem to run fsck on it and you plugged in your USB drive? > > root@osage media # ls -l > total 32 > drwx------ 19 root plugdev 16384 Dec 31 1969 PNY > drwx------ 3 root plugdev 16384 Dec 31 1969 SD_2G > > However (as can be seen above) the permissions are 700, which > makes the drives unusable by members of the plugdev group. > > Alternatively, I can use "pmount -u 007 device label" to provide full > access to the plugdev group. This seems awkward and inelegant. > > What's the right way to use pmount and set permissions? pmount is supposed to be run as a user and it mounts the filesystem owned by the user running it. If you only have a single user, you could call pmount with su. If you have multiple users, you should be letting a desktop tool handle the mounting anyway. -- Neil Bothwick We all know what comes after 'X', said Tom, wisely. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20110221210125.34e17f3b@osage.osagesoftware.com>]
* Re: [gentoo-user] pmount question [not found] ` <20110221210125.34e17f3b@osage.osagesoftware.com> @ 2011-02-22 8:37 ` Neil Bothwick 2011-02-22 12:33 ` David Relson 0 siblings, 1 reply; 7+ messages in thread From: Neil Bothwick @ 2011-02-22 8:37 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 1099 bytes --] On Mon, 21 Feb 2011 21:01:25 -0500, David Relson wrote: > > pmount is supposed to be run as a user and it mounts the filesystem > > owned by the user running it. If you only have a single user, you > > could call pmount with su. If you have multiple users, you should be > > letting a desktop tool handle the mounting anyway. > I've heard "pmount ... as a user" before, but never understood what it > meant. If "pmount ..." is run by a rule > in /etc/udev/rules.d/10-local.rules, how is it known what userid to > use? Does "pmount ... as a user" assume particular settings in gnome, > the kernel, or ??? pmount is meant to be run by a normal user, usually from an automounter, as its main objective is to allow normal users to mount removable devices without fstab rules, while udev rules are run as root. So if you want it to run as a user from a udev rule you'll have to use su, as in su youruser -c 'pmount /dev/PTY' -- Neil Bothwick A consultant is a person who borrows your watch, tells you what time it is, pockets the watch, and sends you a bill for it. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] pmount question 2011-02-22 8:37 ` Neil Bothwick @ 2011-02-22 12:33 ` David Relson 2011-02-22 13:23 ` Neil Bothwick 2011-02-22 13:32 ` Joost Roeleveld 0 siblings, 2 replies; 7+ messages in thread From: David Relson @ 2011-02-22 12:33 UTC (permalink / raw To: gentoo-user; +Cc: neil On Tue, 22 Feb 2011 08:37:06 +0000 Neil Bothwick wrote: > On Mon, 21 Feb 2011 21:01:25 -0500, David Relson wrote: > > > > pmount is supposed to be run as a user and it mounts the > > > filesystem owned by the user running it. If you only have a > > > single user, you could call pmount with su. If you have multiple > > > users, you should be letting a desktop tool handle the mounting > > > anyway. > > > I've heard "pmount ... as a user" before, but never understood what > > it meant. If "pmount ..." is run by a rule > > in /etc/udev/rules.d/10-local.rules, how is it known what userid to > > use? Does "pmount ... as a user" assume particular settings in > > gnome, the kernel, or ??? > > pmount is meant to be run by a normal user, usually from an > automounter, as its main objective is to allow normal users to mount > removable devices without fstab rules, while udev rules are run as > root. So if you want it to run as a user from a udev rule you'll have > to use su, as in > > su youruser -c 'pmount /dev/PTY' Neil: I'm currently using "pmount -u 007 /dev/PTY" as this gives rwx permissions for root and group plugdev, which is adequate for my workstation (which only ever has me using it). I've seen that Ubuntu with Gnome automounts USB sticks. That seems pleasantly convenient and is done without any rules (such as I presently have) in /etc/udev/rules.d. Do you know what they're doing? Regards, David ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] pmount question 2011-02-22 12:33 ` David Relson @ 2011-02-22 13:23 ` Neil Bothwick 2011-02-22 13:32 ` Joost Roeleveld 1 sibling, 0 replies; 7+ messages in thread From: Neil Bothwick @ 2011-02-22 13:23 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 546 bytes --] On Tue, 22 Feb 2011 07:33:45 -0500, David Relson wrote: > I've seen that Ubuntu with Gnome automounts USB sticks. That seems > pleasantly convenient and is done without any rules (such as I > presently have) in /etc/udev/rules.d. Do you know what they're doing? It's using the GNOME automounter, other desktops also do this and it is more friendly than udev rules. I don't know the details because I have never been able to stand GNOME for long enough to find out. -- Neil Bothwick [---- Printed on recycled electrons ----] [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] pmount question 2011-02-22 12:33 ` David Relson 2011-02-22 13:23 ` Neil Bothwick @ 2011-02-22 13:32 ` Joost Roeleveld 2011-02-22 14:24 ` Neil Bothwick 1 sibling, 1 reply; 7+ messages in thread From: Joost Roeleveld @ 2011-02-22 13:32 UTC (permalink / raw To: gentoo-user On Tuesday 22 February 2011 07:33:45 David Relson wrote: > On Tue, 22 Feb 2011 08:37:06 +0000 > > Neil Bothwick wrote: > > On Mon, 21 Feb 2011 21:01:25 -0500, David Relson wrote: > > > > pmount is supposed to be run as a user and it mounts the > > > > filesystem owned by the user running it. If you only have a > > > > single user, you could call pmount with su. If you have multiple > > > > users, you should be letting a desktop tool handle the mounting > > > > anyway. > > > > > > I've heard "pmount ... as a user" before, but never understood what > > > it meant. If "pmount ..." is run by a rule > > > in /etc/udev/rules.d/10-local.rules, how is it known what userid to > > > use? Does "pmount ... as a user" assume particular settings in > > > gnome, the kernel, or ??? > > > > pmount is meant to be run by a normal user, usually from an > > automounter, as its main objective is to allow normal users to mount > > removable devices without fstab rules, while udev rules are run as > > root. So if you want it to run as a user from a udev rule you'll have > > to use su, as in > > > > su youruser -c 'pmount /dev/PTY' > > Neil: > > I'm currently using "pmount -u 007 /dev/PTY" as this gives rwx > permissions for root and group plugdev, which is adequate for my > workstation (which only ever has me using it). > > I've seen that Ubuntu with Gnome automounts USB sticks. That seems > pleasantly convenient and is done without any rules (such as I > presently have) in /etc/udev/rules.d. Do you know what they're doing? Gnome (and most other desktop environments) can be configured to auto-mount a USB-drive, CDs,... Gnome will, as is mentioned previously, probably use "pmount" started as the current user which will then mount the drive with the user as the owner. udev-rules are only really needed when you don't (want to) use an automounter with your X-desktop. I myself use KDE and there I can specify if I want a USB-drive mounted or not. I believe I can also specify some USB-drives to auto-mount when I plug them in. But I do prefer to be able to decide each time as sometimes I just plug in my phone or camera to charge it. (My phone also acts like a usb-drive when so configured) -- Joost ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] pmount question 2011-02-22 13:32 ` Joost Roeleveld @ 2011-02-22 14:24 ` Neil Bothwick 0 siblings, 0 replies; 7+ messages in thread From: Neil Bothwick @ 2011-02-22 14:24 UTC (permalink / raw To: gentoo-user [-- Attachment #1: Type: text/plain, Size: 610 bytes --] On Tue, 22 Feb 2011 14:32:23 +0100, Joost Roeleveld wrote: > I myself use KDE and there I can specify if I want a USB-drive mounted > or not. I believe I can also specify some USB-drives to auto-mount when > I plug them in. But I do prefer to be able to decide each time as > sometimes I just plug in my phone or camera to charge it. (My phone > also acts like a usb-drive when so configured) Yes, you can specify which devices are automounted. I have KDE mount USB sticks, but not my phone - for the same reasons as you. -- Neil Bothwick Friends may come and go, but enemies accumulate. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-02-22 15:06 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-02-21 23:58 [gentoo-user] pmount question David Relson 2011-02-22 0:11 ` Neil Bothwick [not found] ` <20110221210125.34e17f3b@osage.osagesoftware.com> 2011-02-22 8:37 ` Neil Bothwick 2011-02-22 12:33 ` David Relson 2011-02-22 13:23 ` Neil Bothwick 2011-02-22 13:32 ` Joost Roeleveld 2011-02-22 14:24 ` Neil Bothwick
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox