LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 05-02-2004, 12:56 PM   #1
Muzzy
Member
 
Registered: Mar 2004
Location: Denmark
Distribution: Gentoo, Slackware
Posts: 333

Rep: Reputation: 30
mount mp3 player to /mnt/mp3?


Hi all,

I want my mp3 player (a USB Mass Storage Device) to always mount to /mnt/mp3, regardless of how many other USB Mass Storage devices are already plugged in, and I want to setup fstab so that this will work even for an ordinary user with no root access.

Is this possible using Linux kernel 2.4.26? If so, how?

Thanks in advance,
Mark.
 
Old 05-02-2004, 02:22 PM   #2
nhs
Member
 
Registered: Aug 2003
Location: Edinburgh, Scotland
Distribution: Gentoo
Posts: 246

Rep: Reputation: 30
It is theoretically possible however I haven't ever tested the theory. You would need to hack the hotplug scripts to detect your mp3 player and issue a mount/umount command. I would first of all put in place a script that dumps all the environment variables available to a file when run (all the information needed is passed as environment variables). Examining the files would allow you to spot distinguishing variables (e.g. PRODUCT=xxx or VENDOR=xxx). You would then code the script to check for those values and issue a mount (if ACTION=add) or umount (if ACTION=remove) command. I hope this helps. I have no idea where slackware keeps its hotplug scripts.
 
Old 05-02-2004, 03:46 PM   #3
Muzzy
Member
 
Registered: Mar 2004
Location: Denmark
Distribution: Gentoo, Slackware
Posts: 333

Original Poster
Rep: Reputation: 30
Thank you for your answer.

Actually I'm mainly using Gentoo these days but I have not updated my profile yet.

OK - I will leave this for a while to consider it. I have other problems I am trying to solve too, but I will probably come back to this later, maybe next week. Is there anyone else that would be interested in a script which can recognise specific devices and always mount them in the same place? Or am I just different from everyone else?!

Mark.
 
Old 05-06-2004, 01:31 AM   #4
Muzzy
Member
 
Registered: Mar 2004
Location: Denmark
Distribution: Gentoo, Slackware
Posts: 333

Original Poster
Rep: Reputation: 30
OK I upgraded to Linux 2.6.6-rc1 and replaced /sbin/hotplug with this script:

http://dev.gentoo.org/~wmertens/automount.hotplug

(There is also a version for Linux 2.4 on that website.)

It does what I want, after a few modifications to mount accesible to all users, and to create an icon on my KDE desktop. But it only works sometimes - sometimes the /sbin/hotplug script is not called at all by the kernel when my USB Mass Storage Device is inserted and removed. This happens for example if I have not used the computer for a few hours. Anyone know what the problem is?

Thanks,
Mark.

--- edit ---

I have noticed that when the script is not called the /dev/sd* device file is not created either, so it seems to be some problem with the kernel detection. Usually works the first time, but not always afterwards... has anyone else seen this...?

Last edited by Muzzy; 05-06-2004 at 03:41 AM.
 
Old 05-09-2004, 06:31 AM   #5
Muzzy
Member
 
Registered: Mar 2004
Location: Denmark
Distribution: Gentoo, Slackware
Posts: 333

Original Poster
Rep: Reputation: 30
My problem seems to have disappeared all by itself. Hmm! It's working as it should now . When I plug a device in an icon appears on my desktop, and when I remove the device, the icon disappears.

Cool!
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mount my mp3 player eerstkoffie Linux - Hardware 1 08-09-2005 08:27 AM
mount an mp3 player SystemDownfall Linux - Hardware 4 04-15-2005 06:47 AM
How do I mount I-river mp3 player? tanya Linux - Newbie 2 04-04-2005 04:10 PM
Mount mp3 player via usb? donbellioni Linux - Hardware 7 11-16-2004 12:47 PM
Can't mount mp3 player redneon Linux - Hardware 4 06-03-2004 06:11 AM


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

Main Menu
Advertisement
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 Google+: linuxquestions
Open Source Consulting | Domain Registration