First, run lsusb
.
The output should be like:
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 2232:1020
Bus 002 Device 009: ID 0bc2:a013 Seagate RSS LLC
Bus 002 Device 003: ID 0a5c:219c Broadcom Corp.
In the output, find the device number of the port to be disabled. For example, the Seagate drive in the example has Device 009
- that is its device number. Then the id will be usb[device number]
- such as usb9
Then, disable USB wake-up (do this only once):
Be sure to replace X
in usbX
with the device number.
echo disabled | sudo tee /sys/bus/usb/devices/usbX/power/wakeup
Then turn it off:
echo suspend | sudo tee /sys/bus/usb/devices/usbX/power/level
Undo this:
echo enabled | sudo tee /sys/bus/usb/devices/usbX/power/wakeup
echo on | sudo tee /sys/bus/usb/devices/usbX/power/level