Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| 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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
01-12-2005, 10:29 AM
|
#1
|
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Rep:
|
make hotplug run a script on detect
How would i get around to making my external hdd to automatically mount when detected (connected via firewire). I have written the scripts already and they work perfectly, but how would i get around to making it automatic? Do i just have to add a line in some hotplug configuration file or something? Thanks.
|
|
|
|
01-12-2005, 12:38 PM
|
#2
|
|
Member
Registered: Jan 2005
Distribution: Gentoo/Vector/Debian
Posts: 95
Rep:
|
The easiest method would be to edit your startup scripts for debian. I assume that hotplug is done in a high sequence number.
Simply make a file in the /etc/init.d directory containing something along the lines of:
mount /dev/sda1 /mnt/exthd
Set that file as executable:
chmod +x file
Then you run update-rc.d like so:
update-rc.d file defaults
That should do it for you. I wouldn't touch the hotplug script as it is rather annoying scripting. This way you can edit this script to test if mount returns an error or not and display a message accordingly. But that is complicated and gl if you want to do that.
|
|
|
|
01-12-2005, 12:59 PM
|
#3
|
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Original Poster
Rep:
|
Yeah i have the file as executable and the mount command with which uses quite a few options. I would rather make hotplug run the script, because i try to keep this external hard drive off as much as possible (so it can't get damaged) since it is my backup drive. I was thinking of making my scripts run when it detects the drive and depending whether it is sda or sdb it will mount it with my proper script, since i sometimes hook up a flashdisk or a mp3 player and it turns into sdb instead of sda. It probably uses the lines in lsusb, but i don't know where to make it so that in the case the usb line corresponds to the hdd it automatically mounts it using the proper letter sda or sdb, if the latter is too complicated i can just make it attempt to mount both so i'll have it mounted for sure. You seem to know how to do this with hotplug, where should i start looking? Thanks
|
|
|
|
01-12-2005, 01:45 PM
|
#4
|
|
Member
Registered: Jan 2005
Distribution: Gentoo/Vector/Debian
Posts: 95
Rep:
|
well if it is a firewire device then perhaps you can edit the /etc/hotplug/ieee1394.agent script. Just match up the $VENDOR_ID's so that
if ["$VENDOR_ID" = "myvencor"]
do mount here
fi
just add that under the error handing Vendor_id line. This is a pretty big hack but it should work fine . . . . I haven't tried it, but good luck.
You can find your vendor's id via the /sys file system. Gl with that too.
|
|
|
|
01-13-2005, 11:16 AM
|
#5
|
|
Member
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586
Original Poster
Rep:
|
Could "ST320082" be the vendor id? I looked around /sys and found the hdd, but instead of a vendor_id file i just saw a vendor file, which is the one above. Could this be the vendor id or do i have to keep on looking? The ieee1394 id is "0050770e00071002:0:0", it could also be it, not sure though. I think it would probably work better if i put it in the add) section, just gotta be sure of the vendor id. Which one do you think it is? Thanks.
|
|
|
|
01-13-2005, 11:42 AM
|
#6
|
|
Member
Registered: Jan 2005
Distribution: Gentoo/Vector/Debian
Posts: 95
Rep:
|
most likely that first one.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:59 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
|
|