HOW-TO: Fixing USB 2.0 HDD / Flash Storage Devices on Ubuntu 10.04 Linux

There is a nasty / annoying bug in Ubuntu 10.04 LTS (Lucid Lynx) Linux which prevents attaching USB storage devices such as hard disk drives (HDD) and Flash memory stick drives. With the assistance of others in the Ubuntu bug tracker system, I just arrived at a little script which successfully corrects the Plug-n-Play (PnP) detection problem. It is as follows, fixext_backup.sh:

Note: You need to run this script as root (aka sudo the script).

#!/bin/bash -x

cd /sys/bus/pci/drivers/ehci_hcd

USBDRIVE=`/usr/bin/find ./ -name "0000:00:*"`
echo $USBDRIVE

echo $USBDRIVE | /bin/sed "s/\.\///">unbind
echo $USBDRIVE | /bin/sed "s/\.\///">bind

/usr/sbin/lsusb
/bin/sleep 5
/usr/sbin/lsusb

Executing that script "wakes up" Linux to the drive's presence. You may then proceed with mounting the drive / using the drive normally.

In the first lsusb command output, you will not see the USB drive. You should see it after the 5 second delay in the second lsusb command output. Having the device in the lsusb list, you may proceed with mounting the device, and, and, and... :-)