From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Brian T. Brunner" Date: Tue, 11 Nov 2003 17:46:48 +0000 Subject: objective: automount a thumbdrive when it is inserted, autodetect Message-Id: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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