View previous topic :: View next topic |
Author |
Message |
Loke Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 25 May 2002 Posts: 274 Location: Norway
|
Posted: Wed Jan 28, 2004 3:23 am Post subject: hotplug for normal users |
|
|
How to make hotplug mount usbfs with the correct permissions, so normal users can mount and unmount USB devices?
Ive got Freevo - freevo.sf.net - running on a standalone box, and it support a camera plugin. When I plug my camera in, it pops up in the menu (based on the lsusb ID), but since I run freevo as a normal user, Im not allowed to mount the camera.
Nor sudo or entry in fstab is sufficient for me, so alternate solutions would be great ![Smile :-)](images/smiles/icon_smile.gif) _________________ I'm not saying there should be capital punishment for stupidity, I'm saying why don't we take the warning labels off of everything, and let the problem take care of itself? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
taskara Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Wed Jan 28, 2004 3:44 am Post subject: |
|
|
I think it's just permissions in your fstab file.. uid=1000 or something like that.. hang on.. that's for ntfs.. ahh.. I'm sure it's here in the forums somewhere.. try this thread
EDIT: sorry. just read fstab entries are no good for you.. ahh .. try the thread above anyhow.. soz.. _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Loke Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 25 May 2002 Posts: 274 Location: Norway
|
Posted: Sat Feb 07, 2004 8:09 pm Post subject: |
|
|
But how am I able to solve this problem then? When I plug my camera in, it appears as /dev/sdb (On /dev/sda Ive got a cardreader). If I then unplug my camera, and then plug it in again, it appears as /dev/sdc. So obviously I cant add an entry in /etc/fstab since I cant guarantee what ID devfs assigns to it. Imagine I had many more hotplug devices. Then there would be no way I could predict what /dev/sdX a certain device got assigned.
Heeelp ![Shocked 8O](images/smiles/icon_eek.gif) _________________ I'm not saying there should be capital punishment for stupidity, I'm saying why don't we take the warning labels off of everything, and let the problem take care of itself? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
taskara Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Sat Feb 07, 2004 9:44 pm Post subject: |
|
|
unmount it before you unplug it and it should be re-detected as sdb
perhaps we are talking about two different things here.. hotplug is the daemon that detects your devices, and supermount is the app that mounts them automatically.
supermount will not work with a usb device I don't think, because supermount works on MEDIA, not a device.
ie, you put in a new cd, it mounts it.
but if you pull out the whole cdrom drive and plug it back in, of course that won't work.
that's what you are doing if you have a usb drive, you are not unplugging the media, you're unplugging the device.
so you can't use supermount with it, but you CAN mount it manually, and unmount it manually, and then unplug it, and when you plug it back in, it shoudl detect as sdb again.
so you will need an fstab entry _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Loke Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 25 May 2002 Posts: 274 Location: Norway
|
Posted: Sat Feb 07, 2004 10:16 pm Post subject: |
|
|
Pardon me if I sound like a jerk, but why are you talking about supermount? Ive never mentioned it, I dont want it, I dont need it and I dont use it hehe
I know what supermount is and how it works. And it wont help me solve my problem. Actually, if I plug the camera in and without mounting it, remove it and plug it in again it will be /dev/sdc (being /dev/sdb previously). Perhaps hotplug think /dev/sdb is "occupied" (timeout?) after the removal of the usb-storage device, and assign it to /dev/sdc the next time.
Anyway, this cant be the way this works. What if I had 10 usb-storage devices, like a phone, camera, usb-pen etc etc. and id want to mount these in /mnt/phone, /mnt/camera, /mnt/storage etc. How can you then specify an /etc/fstab entry for these items? You cant possibly know what /dev/sdX devfs assigns to the device youre plugging in next?
So there has to be another solution than what we mention here, presumably based on the USB-ID from lsusb.
Edit: Sorry if Im bitching, but its frustrating to explain this problem since noone seems to understand the nature of my inquiry. I appreciate you trying to help ![Smile :-)](images/smiles/icon_smile.gif) _________________ I'm not saying there should be capital punishment for stupidity, I'm saying why don't we take the warning labels off of everything, and let the problem take care of itself? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
taskara Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Sat Feb 07, 2004 10:44 pm Post subject: |
|
|
yeah no worries, well I guess I don't have a solution for you.
lemme check on my system...
well it works just fine for me.
Code: | bash-2.05b$ ls -l /dev/sdd
lr-xr-xr-x 1 root root 33 Feb 8 09:43 /dev/sdd -> scsi/host4/bus0/target0/lun0/disc
bash-2.05b$ ls -l /dev/sdd
ls: /dev/sdd: No such file or directory
bash-2.05b$ ls -l /dev/sdd
lr-xr-xr-x 1 root root 33 Feb 8 09:43 /dev/sdd -> scsi/host5/bus0/target0/lun0/disc
bash-2.05b$ ls -l /dev/sdd
ls: /dev/sdd: No such file or directory
bash-2.05b$ ls -l /dev/sdd
lr-xr-xr-x 1 root root 33 Feb 8 09:43 /dev/sdd -> scsi/host6/bus0/target0/lun0/disc
bash-2.05b$
|
there was a second delay between each unplug and rechecking if /dev/sdd existed.
so linux sees my device instantantly, assigns it to /dev/sdd, unplug it and instantly /dev/sdd is gone.
plug it back in straight away and instantly /dev/sdd is back.
sorry I can't help you. good luck! _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Loke Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 25 May 2002 Posts: 274 Location: Norway
|
Posted: Sat Feb 07, 2004 11:36 pm Post subject: |
|
|
Yes, but thats not _the_ problem! *sigh* What if you had more than 1 usb hotplug device? How would you solve it then? Say you have one phone and one camera, and theyre both using the usb-storage protocol, and youd want them appear in the local filesystem under /mnt/phone and /mnt/camera. (After all - you want to know if you are browsing the files on the phone or the camera)
Depending on which device you plug in first, it will appear under the mount point defined in conjunction with eg /dev/sda (whatever comes first). So if youve defined /mnt/camera as /dev/sda in your /etc/fstab and you plug in your phone - devfsd will assign it to the first available logical letter - which is /dev/sda. Because as far as devfsd is concerned, youve plugged in just another usb-storage device. And consequently it will be mounted on /mnt/camera and *NOT* /mnt/phone which would be the correct behaviour.
Perhaps you now understand the issue at hand, and why there has to be another way around this problem
Edit: Actually, I think you just proved my point with ls output from your computer. As you can see, /dev/sdd does not contain the same hostX mapping (it clearly says host4, host5, host6 etc between each hotplug/removal) - so as far as devfsd is concerned you plugged in 3 different devices. Perhaps its easier to understand why Im frustrated now. _________________ I'm not saying there should be capital punishment for stupidity, I'm saying why don't we take the warning labels off of everything, and let the problem take care of itself? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
taskara Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 10 Apr 2002 Posts: 3763 Location: Australia
|
Posted: Sun Feb 08, 2004 4:48 am Post subject: |
|
|
I understand. I have no idea how to help. good luck! _________________ Kororaa install method - have Gentoo up and running quickly and easily, fully automated with an installer! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Vann Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/d19984d93d4cd69db64d7.gif)
Joined: 04 Aug 2002 Posts: 357
|
Posted: Sun Feb 08, 2004 7:05 pm Post subject: |
|
|
You might want to look into udev. This is one of the problems with devfs it was created to solve. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
el_compa n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Final Fantasy/Final_Fantasy_7_-_Vincent.jpg)
Joined: 28 Jan 2004 Posts: 65 Location: France
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Loke Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 25 May 2002 Posts: 274 Location: Norway
|
Posted: Mon Feb 09, 2004 1:57 pm Post subject: |
|
|
Ah, thanks for the feedback, guys. After this Ive been reading up on devfs / udev debate and it looks like devfs has designflaws regarding my issue described above. And it looks like devfs is being dumped from the kernel soon, too. Going from experimental to deprecated
el_compa: Do you need udev working if using the instructions in the url you posted? The author doesnt mention udev, so I was just wondering. To me it seems like hotplug has the functionality to recognize certain USB devices based on their USB-ID tag from lsusb, and take the appropriate action. _________________ I'm not saying there should be capital punishment for stupidity, I'm saying why don't we take the warning labels off of everything, and let the problem take care of itself? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|