Sunday, November 2, 2008

USB stops working in Ubuntu

For the last couple of months I've been having a problem connecting usb devices to my Ubuntu PC. Everything seems to be working fine when I bootup but if the machine stays on for a day or so, usb just stops working. I couldn't even charge my iPhone.

After looking around Ubuntu forums and Googling the only helful hints I could find was adding noacpi to my boot options. Since I sort of like my ACPI based soft shut off functionality I tried a different way, which actually worked just as well.

I call this the windows way of fixing software glitches since this pretty much just restarts the usb modules:

sudo rmmod usbhid && sudo rmmod ehci_hcd && sudo rmmod uhci_hcd && sudo rmmod usbcore
sudo modprobe usbhid && sudo modprobe ehci_hcd && sudo modprobe uhci_hcd && sudo modprobe usbcore

A word of caution first. Killing uhci, not to mention usbcore, will most likely temporarily disable your usb 2.0 devices like the mouse. They should come right back when you modprobe the modules back in.

No comments: