Permanently disable malfunctioning USB ports in Linux

7,675

Solution 1

Probably the easiest way is through the BIOS; many BIOSes have an option to disable onboard USB.

Disabling it in Linux would involve preventing the driver for the USB controller from loading. This wouldn't work if the chipset in your motherboard USB controller is the same as the chipset in your PCI USB controller.

Do some research on your motherboard and find out who makes the USB controller on it. You might be able to find out with a simple lspci. A little bit more Googling and/or observing the output of lsmod ought to tell you what kernel module is responsible for it. You can then take a look at this and prevent the module from loading.

I'm sure there's a way to identify by some sort of unique ID and then disable or "unregister" certain USB "branches" in the USB "tree"; hopefully a more enlightened person can share if possible.

Solution 2

You can switch off the power to a USB port with

echo suspend >/sys/bus/usb/devices/usb42/power/level
echo disabled >/sys/bus/usb/devices/usb42/power/wakeup

I don't know if this has the same effect on the hardware as disabling the port through the BIOS or Windows.

Share:
7,675

Related videos on Youtube

Dhananjaya
Author by

Dhananjaya

Pragmatic software engineer, experienced working in agile/scrum teams building, full-stack web applications, enterprise resource planning solutions, and compilers. Currently, I work as a compiler engineer in the Ballerina language team. I enjoy learning new programming languages and watching software engineering conference talks. Have a knack for software performance engineering.

Updated on September 18, 2022

Comments

  • Dhananjaya
    Dhananjaya over 1 year

    Recently my motherboard's built-in USB ports started malfunctioning. On Windows it said power surge in USB port, and in Linux it says nothing but also in Linux USB ports malfunction. So I installed a PCI card that have USB port in it. And in Windows I can disable malfunctioning ports by device manager. How can I disable those malfunctioning USB ports.

  • Dhananjaya
    Dhananjaya almost 13 years
    My onboard chip-set is Intel and PCI card's chip is VIA, I think BIOS method will work for me. Thank you.
  • poolie
    poolie over 10 years
    Linux 3.2.5 says WARNING! power/level is deprecated; use power/control instead
  • Tom Hale
    Tom Hale over 6 years
    Won't this only persist until the next boot?
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 6 years
    @TomHale Yes, of course. If you want to make it persistent, you need to add it to your boot scripts or to a udev rule.