Re: [gentoo-user] pmount question
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. signature.asc Description: PGP signature
Re: [gentoo-user] pmount question
On Tue, 22 Feb 2011 08:37:06 + 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
Re: [gentoo-user] pmount question
On Tuesday 22 February 2011 07:33:45 David Relson wrote: On Tue, 22 Feb 2011 08:37:06 + 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
Re: [gentoo-user] pmount question
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 ] signature.asc Description: PGP signature
Re: [gentoo-user] pmount question
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. signature.asc Description: PGP signature
[gentoo-user] pmount question
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
Re: [gentoo-user] pmount question
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. signature.asc Description: PGP signature