LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 11-11-2006, 11:20 PM   #1
highgeere
LQ Newbie
 
Registered: Nov 2006
Posts: 1

Rep: Reputation: 0
Run script when USB drive is mounted


Hello everyone.

I am looking for a way to run a script when I mount my USB external harddrive. Basically, I've got this 80G external drive that I haven't used since I made the switch to desktop Linux(Ubuntu dapper). The problem is that Ubuntu hangs when booting if the drive is connected. Since the external drive is primarily for backups, it doesn't need to be connected all of the time anyway, so I just connect it when I'm going to do my weekly backup. So the question is, how can I make Ubuntu run an 'autorun' type bash script when I connect and mount the drive? I mean, I can write the script, but how can I make it run. Thanks in advance,

Highgeere
 
Old 11-12-2006, 01:45 AM   #2
Titan485
Member
 
Registered: Dec 2005
Location: Rapid City
Distribution: Edgy64, Dapper32, SUSE10.1, FC3, DSL, Linspire
Posts: 30

Rep: Reputation: 15
I would write a script on your computer that did the mounting for you, and then in the same script on your computer execute a command. Basically you're just solidifying the mount and the other command, but if you do this frequently you might find it useful. In theory, there probably is something that does exactly what you're looking for, but I don't know it is.
 
Old 11-13-2006, 08:44 AM   #3
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
Maybe udev gives you an opportunity there, but I'm not sure. Do you know e.g.

http://www.reactivated.net/writing_udev_rules.html
http://ftp.kernel.org/pub/linux/util...tplug/udev-FAQ
http://www.linuxfromscratch.org/lfs/...er07/udev.html
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to test is a drive is mounted in a shell script? agtlewis Linux - General 7 03-18-2009 09:58 AM
script to check if a drive is mounted gazman1 Programming 3 07-10-2006 09:09 AM
Can not access mounted USB drive Honkeychops Mandriva 5 03-06-2006 12:59 PM
how come usb flash drive doesn't get auto mounted? darkhatter Fedora 5 02-26-2006 08:04 PM
USB Drive - Mounted OK, but files aren't recognized Dr3n Linux - Hardware 6 03-14-2005 06:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:45 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
Open Source Consulting | Domain Registration