Wednesday, September 16, 2015

Possible USB fix

I'd been having trouble with external USB drives disappearing and then reappearing randomly about once a week - meaning perhaps three times in a week or maybe even going a month without bothering me.

The following suggestions from wyl1e may be of help.

echo "Y" > /sys/module/usbcore/parameters/old_scheme_first

echo -n "0000:00:1d.0" > /sys/bus/pci/drivers/ehci_hcd/unbind

echo '2-1.2' > /sys/bus/usb/drivers/usb/bind   

echo -n "-1" > /sys/module/usbcore/parameters/autosuspend
What they do:
/sys/module/usbcore/parameters/old_scheme_first
Changes the enumeration of devices. One of my symptoms was that USB drives would disappear and then reappear under a different name, e.g., /dev/sde would return as /dev/sdf; that naming could not be influenced by udev, and LVM could not be convinced to accept the drive by its new name. So possibly, this might cause the device to return by the same name?
/sys/bus/pci/drivers/ehci_hcd/unbind
This is an opportunity to turn off "high speed" (480Mbit/s, 60Mbyte/s) for a device; not appropriate for a disk drive.
/sys/bus/usb/drivers/usb/bind
Having unbound a device, bind it to a different device driver. That's not appropriate for my problem: the USB disk drive has been working for days with the same device driver; I just don't want it to disappear.
/sys/module/usbcore/parameters/autosuspend
Now we're talking: I never want these drives to suspend themselves.
But there is suspending by the kernel and there is also apparently suspending initiated by the disk drive - that too needs to be investigated.

No comments: