LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-16-2008, 11:48 AM   #1
Peter Rhone
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Rep: Reputation: 0
Execute command on mount and integrate with gnome-mount / umount


Hello I have a Western Digital Passport 250 GB USB drive (1058:0702 Western Digital Technologies, Inc. Passport External HDD). Unfortunately it is rather quirky on linux, and I haven't been able to use it since I originally purchased it a year ago (loss of data, slow transfers, etc)

I have finally traced down the problem and can now use the drive. After connecting it I have to run (as root, and assuming it has been assigned to sdb)
echo 128 >/sys/block/sdb/device/max_sectors

and finally after unmounting the drive, I have to run
sdparm --command=stop /dev/sdb.
before disconnecting it.

Now I am trying to figure out how to have this happen automatically when I mount/unmout the drive, and preferrably be integrated with gnome's (nautilus) eject system so that my girlfriend doesn't have to resort to the command line.

I've been trying various things with udev and hal but can't really figure it out.

Does anyone have an idea how to get this to work?

thanks

p.s. I'm on Ubuntu Intrepid Ibex

Last edited by Peter Rhone; 11-17-2008 at 05:30 AM.
 
Old 11-16-2008, 02:14 PM   #2
Saptech
Member
 
Registered: Nov 2000
Location: Third Stone from the Sun
Distribution: Mageia 7, Devuan & Void Linux
Posts: 172

Rep: Reputation: 40
Does Ubuntu have gnome-volume-manager installed? Are you using Gnome desktop? What file system format is it?

I have a WD 250gb My Book about two years old and has never had a problem with it mounting/unmounting automagically. I use Gnome also.
 
Old 11-17-2008, 05:27 AM   #3
Peter Rhone
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Saptech View Post
Does Ubuntu have gnome-volume-manager installed? Are you using Gnome desktop? What file system format is it?

I have a WD 250gb My Book about two years old and has never had a problem with it mounting/unmounting automagically. I use Gnome also.
gnome-volume-manager isn't installed by default so I installed it, it doesn't seem to give me the option to run the commands I need after mounting/unmounting.

The My Book is a different creature than the passport, so it doesn't surprise me that you don't have the same issues.

In my fiddling I have managed to write a udev profile which creates a /dev/passport node, but I can't eject it from nautilus and it also doesn't seem to execute the commands I need, and I can't figure out when the 'action remove' part is being called, if at all (is this called on umount or only after I have physically pulled the usb plug from the computer?).

Last edited by Peter Rhone; 11-17-2008 at 05:29 AM.
 
Old 11-17-2008, 11:46 AM   #4
Saptech
Member
 
Registered: Nov 2000
Location: Third Stone from the Sun
Distribution: Mageia 7, Devuan & Void Linux
Posts: 172

Rep: Reputation: 40
I'm not sure how all of it works with the internals, but plugging any usb device opens up a window for the device. If I type the command to mount a device manually, an icon will appear on my desktop. If I type the unmount command, it disappears from the desktop and I can unplug the device.

Hope this helps some.
 
Old 11-18-2008, 05:28 AM   #5
Peter Rhone
LQ Newbie
 
Registered: Nov 2008
Posts: 3

Original Poster
Rep: Reputation: 0
yes, Saptech, that works most of the time. In fact, it works for this WD drive as well in that it is mounted automatically and the contents are displayed. Unfortunately the drive requires special attention as mentioned in my first post. I need to know how to run those special commands when the device is connected/disconnected. The automounting without those commands being run is damaging to the drive and useless.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
DVD (auto)mount problem, gnome-mount, hal, Fedora C 5 lazarion Linux - Hardware 5 01-10-2007 04:45 AM
util-linux-2.12r error on 'make -C mount mount umount' james penguin Linux From Scratch 2 08-28-2006 11:55 PM
How to automatically execute a command (TrueCrypt) on mount cbonar Linux - General 2 08-27-2006 10:42 AM
Why Gnome can't mount & umount disks anymore? DLCI Red Hat 0 11-10-2003 07:58 AM
execute mount (or any) command on startup frieza Linux - Software 3 04-29-2003 06:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:37 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