linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* objective: automount a thumbdrive when it is inserted, autodetect
@ 2003-11-11 17:46 Brian T. Brunner
  0 siblings, 0 replies; only message in thread
From: Brian T. Brunner @ 2003-11-11 17:46 UTC (permalink / raw)
  To: linux-hotplug


I run shrike (RH9, linux kernel 2.4.20-8).

I insert a thumb drive (Kanguru Microdrive 128MB) 
that lsusb says is 0d7d/0120 Apacer.

Currently I poll for the device being physically present using 
system("grep -q usb-storage /proc/bus/usb/devices)".  
This seems to be a reliable indicator of whether the device is inserted.

When this returns success, then mount("/dev/sda1","/mnt/thumbdrive") and 
system("cat bigfile | bzip2 > /mnt/thumbdrive/smallfile") to compress 
bigfile onto the thumbdrive. There may be several bigfiles.

Then I umount("/mnt/thumbdrive") and wait for the periodic grep
of usb-storage in /proc/bus/usb/devices to indicate that the thumbdrive 
went away, and then got plugged in again.

This all works fine the first time, sometimes the second. 

By time the 5th attempt is made, /var/log/messages begins to get 
"kernel: usb_control/bulk_msg: timeout"
messages, and "time lsusb" takes 15 seconds to run.

The file copy take proportionately longer, but completes.

devlabel is not employed (I tried it, it created a symlink and 
did nothing else; no automount ever occurred).

I'll happily RTFM, which part? Or is there a clue about
the cause of the timeout?


Brian Brunner
brian.t.brunner@gai-tronics.com
(610)796-5838



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept
for the presence of computer viruses.

www.hubbell.com - Hubbell Incorporated
**********************************************************************



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-11 17:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-11 17:46 objective: automount a thumbdrive when it is inserted, autodetect Brian T. Brunner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).