How do I power cycle a usb port on Fedora? I want to turn off power for a specific USB…
- User
How do I power cycle a usb port on Fedora? I want to turn off power for a specific USB port and then enable it again.
Assistant
To power cycle a specific USB port on Fedora, use these methods:
1. Using
hub-ctrlUtilityFor USB hubs with power control capabilities:
# Install hub-ctrl (compile from source if not available) sudo ./hub-ctrl -B <bus> -D <device> -P <port> -p 0 # Disable power sudo ./hub-ctrl -B <bus> -D <device> -P <port> -p 1 # Enable powerIdentify
<bus>,<device>, and<port>usinglsusborusb-devices[1].
2. Direct Kernel Power Control
Manipulate the
power/controlfile for the USB device:# Find the device path (e.g., /sys/bus/usb/devices/3-1) echo "0" > /sys/bus/usb/devices/<device>/power/control # Disable echo "1" > /sys/bus/usb/devices/<device>/power/control # EnableUse
lsusb -tto locate the device path[1][6].
3. Disable USB Device via
udevCreate a script to disable/enable devices by vendor/product ID:
# Example script (requires root) #!/bin/bash echo "0" > /sys/bus/usb/devices/<device>/authorized # Disable echo "1" > /sys/bus/usb/devices/<device>/authorized # EnableIdentify
<device>usinglsusbandusb-devices[2][6].
4. Reset USB Controller (Advanced)
For persistent issues, reset the entire USB stack:
# Find USB controller PCI address DEVICE=$(lspci -Dm | grep "USB controller" | cut -f1 -d' ') # Unbind and rebind echo "$DEVICE" | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind echo "$DEVICE" | sudo tee /sys/bus/pci/drivers/xhci_hcd/bindThis resets all USB ports[5].
Note: For Fedora-specific issues like periodic USB disablement, check power management tools like
powertopor disable TLP if installed[3][7].
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.