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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-29-2003, 11:28 AM
|
#1
|
LQ Newbie
Registered: Aug 2003
Posts: 5
Rep:
|
How to automount device...
I need to be able to auto-mount a device only after it's been detected (plugged-in). Where would be the starting point for such script, and where should it reside?
Thanks much.
|
|
|
11-29-2003, 02:12 PM
|
#2
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
|
|
|
11-29-2003, 03:12 PM
|
#3
|
LQ Newbie
Registered: Aug 2003
Posts: 5
Original Poster
Rep:
|
Thanks Tinkster for the reply,
I took a look at the link you recommended. This was way over my head and I don't want to update my kernel, yet. All I want to be able to do is to mount a directory upon detection of a device. I am doing this now manually but I thought I can just have a simple script that can do this. You know how when a CD is inserted into the CD drive it gets mounted? Pretty simple I think, I just dunno where to start.
Thanks.
|
|
|
11-29-2003, 04:25 PM
|
#4
|
Senior Member
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440
Rep:
|
Hi,
Well you could write a script but since you just want to mount it during bootup then just edit /etc/fstab. For example, lets say you plugged in a new hdd and you want to mount a partition labeled hdb1. Then add this line to your /etc/fstab:
/dev/hdb1 /home/whatever ext2 defaults 0 1
NOTE: Make sure you make that directory first! However, if you have that partition as ext3, then if I recall correctly, the last field is 2 instead of 1. If you want to know the definition of those fields, just do a google search. Google is your best friend
-twantrd
|
|
|
11-29-2003, 09:17 PM
|
#5
|
Moderator
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
|
Quote:
Originally posted by bestmehr
Thanks Tinkster for the reply,
I took a look at the link you recommended. This was way over my head and I don't want to update my kernel, yet. All I want to be able to do is to mount a directory upon detection of a device. I am doing this now manually but I thought I can just have a simple script that can do this. You know how when a CD is inserted into the CD drive it gets mounted? Pretty simple I think, I just dunno where to start.
Thanks.
|
Is that device USB in the first place? :)
Depending on what distro you're using chances
are you won't have to re-compile your kernel, they
are pretty common defaults in most distros.
Usbmgr isn't that difficult to install, either.
Cheers,
Tink
|
|
|
All times are GMT -5. The time now is 10:55 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|