[YLUG] USB Reset

Phil Jordan lists at philjordan.eu
Wed Jan 9 19:48:17 GMT 2008


Alex Smith wrote:
> Hi
> 
> Any way to 'reset' (rehash?) USB, without reloading the module? I have a
> production box that has a USB drive attached, and I want to simulate an
> unplug/replug, but can't think of a way to do it without it going badly

As root, cd into /sys/bus/usb/drivers/<driver_name>, where driver_name
is probably usb-storage. An 'ls' will show you the devices that are
bound to that module - compare with lsusb to make sure you've found the
right device, then unbind it by doing something like:

echo -n 1-3 > unbind

where 1-3 is the device in question. A subsequent ls should show the
device as no longer bound to the driver. Re-bind it with

echo -n 1-3 > bind

I'm not sure if that will fully simulate an unplug/replug sequence, or
if that's possible at all, but it should get you very close.

~phil



More information about the York mailing list