LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 08-12-2008, 11:40 AM   #1
colbert
LQ Newbie
 
Registered: Jul 2008
Posts: 19

Rep: Reputation: 0
How to have external eSATA drive auto mount on plug-in??


I have a SATA drive in an external enclosure connected via eSATA. The same device I plug in with USB works just fine, mounts up automatically and unmounts no prob. (I use thunar and HAL with thunar-volman on a plain fluxbox session).

I'm wondering how or if it's even possible to have the drive behave the same way when plugged in via eSATA, or if I have to add an fstab entry??

TIA for any help
 
Old 08-12-2008, 01:23 PM   #2
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
I apologize, because my post isn't going to be much help, but I recently wrote a script for my work (in Python) that uses DBUS (and HAL) to watch for a drive with a specific volume name to get plugged in, and then automagically mounts it when it is ready.

My only suggestion is to look into HAL's rule definitions for handling drives.
 
Old 08-12-2008, 01:35 PM   #3
colbert
LQ Newbie
 
Registered: Jul 2008
Posts: 19

Original Poster
Rep: Reputation: 0
Would you mind sharing the script? I'd like to give it a shot
 
Old 08-12-2008, 01:48 PM   #4
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
I would, except I can't divulge the script due to non-distribution clauses in my employment agreement; not to mention, there are too many work-specific things within the script. I'll re-write a bare-bones version when I get home.
 
Old 08-12-2008, 02:16 PM   #5
colbert
LQ Newbie
 
Registered: Jul 2008
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks a lot indienick, that would be greatly appreciated!!
 
Old 08-15-2008, 10:54 AM   #6
colbert
LQ Newbie
 
Registered: Jul 2008
Posts: 19

Original Poster
Rep: Reputation: 0
Hmm, indienick?

Or anyone else?
 
Old 08-15-2008, 11:04 AM   #7
caleb12
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
I'd love to see this script as well.

I've been trying to mount my externals to specific locations for awhile. The only answer I've found is using the UUID of the drive and creating a static entry for it in FSTAB, but then it doesn't automatically mount when plugged... you have to hit it with a command line.
 
Old 08-16-2008, 01:32 AM   #8
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
Sorry for the lack of sending any scripts; I've been terribly busy at work (double-duty as a machinist and mechanical engineer) and I've either been at work, or sleeping.

I'll be sure to email both of your when I have the script ready.
(I'll post it here as well.)
 
Old 08-17-2008, 10:58 AM   #9
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
I do apologize, but I just do not have the time, currently, to re-write this script. Here's a link to the dbus-python bindings I used. If you haven't programmed in Python before, it's shockingly easy (perhaps the easiest programming language to learn I've ever seen). I used that tutorial when I was writing the original script for my work; just as a vote of confidence in your abilities, I do not program in Python unless specifically asked to, not because I don't think it's a good language (I think it's a sweet language), but because I have a focus on Common Lisp and Java.

Last edited by indienick; 08-18-2008 at 07:43 AM.
 
Old 08-17-2008, 11:16 AM   #10
caleb12
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
Sweet! I'll give it a try, thanks for the reference...
 
Old 08-19-2008, 05:19 PM   #11
colbert
LQ Newbie
 
Registered: Jul 2008
Posts: 19

Original Poster
Rep: Reputation: 0
No sweat indienick!

My drive actually does automount with eSATA, but it does not show in the thunar side pane (with all other volumes/mounted drives as icons). What I'm going to do is try and make a little zenity script with a pop-up question to unmount/mount the drive and bind the script to a keybinding in flux's keys file.
 
Old 08-19-2008, 05:39 PM   #12
caleb12
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
This may or may not help your situation, but I did figure out the settings I needed for FSTAB... It was as simple as creating these entries:

LABEL=Muzick /media/muzick ntfs-3g uid=1000,gid=0,rw,users 0 0
~ My NTFS drive that is a music archive

UUID=61bfb982-a349-4269-8bec-8a941036ae1a /media/dropbox ext2 users,atime,rw,nodev,noexec,nosuid 0 0
~ An ext2 drive that is for backup

The drives will consistently mount to those locations, with the edition of the "users" attribute and the "uid=1000" (my uid) allowed them to be automagically mounted and handled through Konqueror. I would assume you could bookmark the static folders of the mount location and access them through Thunar the same way...
 
Old 08-21-2008, 11:39 PM   #13
colbert
LQ Newbie
 
Registered: Jul 2008
Posts: 19

Original Poster
Rep: Reputation: 0
How do I get the UUID of my disk/partition?? I'd like to try that second entry for my ext3 drive. Thanks Caleb
 
Old 08-22-2008, 07:57 AM   #14
indienick
Senior Member
 
Registered: Dec 2005
Location: London, ON, Canada
Distribution: Arch, Ubuntu, Slackware, OpenBSD, FreeBSD
Posts: 1,853

Rep: Reputation: 65
I believe you can get it if you run:
Code:
# vol_id -u device
 
Old 01-19-2009, 11:25 AM   #15
pexctt
LQ Newbie
 
Registered: Jan 2009
Posts: 16

Rep: Reputation: 1
Question

i got the volume id for the ext4 backup partition using sudo vol_id /dev/sdb5

then i created the /etc/fstab entry and substituted ext4 in place of ext3 where the example here was earlier, as follows:

UUID=404ae123-6ee1-43f9-b6fb-0f0e0d66411b /media/seagate ext4 users,atime,rw,nodev,noexec,nosuid 0 0

i rebooted

noticed there was no "seagate" directory inside of /media so i

sudo mkdir /media/seagate

some reason, i still don't get a external esata auto mount icon in gnone. fdisk -l sees it fine so does sudo vol_id and i've double checked the UUID. any ideas ?
 
  


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
auto mount external hd on boot jaymoney Ubuntu 1 06-09-2008 10:20 AM
configuring eSata PCI card and Lacie 2big Dual external hard drive Flailing_Novice Linux - Hardware 18 04-17-2008 01:08 PM
How to plug in external USB CD-ROM drive? General Linux - Hardware 1 04-21-2007 06:36 PM
got my ntfs sata drive to mount but cat get to auto mount Jack Daniels Linux - Hardware 3 04-15-2007 10:42 AM
How do I set exec option on USB drive hot plug mount? dhuseby Linux - Hardware 2 05-30-2006 09:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:49 AM.

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