ChatGPT said:
Yes, in Ubuntu you can reset a specific USB port or device without rebooting the entire system using a few different methods. Here's how you can do it safely and quickly.
✅ Step-by-Step USB Port Reset (No Reboot)
Option 1: Using usbreset
utility
This is the cleanest way to reset a USB device without unplugging.
-
Install usbreset (if not available):
bashsudo apt install usbutils build-essential wget https://raw.githubusercontent.com/jkulesza/usbreset/master/usbreset.c gcc usbreset.c -o usbreset
-
Find your USB device (e.g., mouse):
bashlsusb
Example output:
arduinoBus 001 Device 005: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
-
Get the device file:
bashls -l /dev/bus/usb/001/005
-
Run usbreset:
bashsudo ./usbreset /dev/bus/usb/001/005
Option 2: Unbind/Bind USB driver manually
You can unbind and rebind the USB device manually.
-
Get the device path:
bashlsusb
-
Find the device ID in
/sys/bus/usb/devices/
:bashls /sys/bus/usb/devices/
Look for something like
1-1.2
(USB port path). To confirm:bashcat /sys/bus/usb/devices/1-1.2/product
-
Reset the device:
bashecho '1-1.2' | sudo tee /sys/bus/usb/drivers/usb/unbind sleep 1 echo '1-1.2' | sudo tee /sys/bus/usb/drivers/usb/bind
Option 3: Use uhubctl
to cycle USB port power (if hardware supports)
For laptops with USB hubs supporting power control (like some Intel chipsets):
-
Install
uhubctl
:bashsudo apt install uhubctl
-
List USB hubs:
bashuhubctl
-
Turn power off then on (example):
bashsudo uhubctl -l 1-1 -p 2 -a 0 # off sleep 1 sudo uhubctl -l 1-1 -p 2 -a 1 # on
-l
is the hub location,-p
is the port number.
💡 Tips
-
If the device disappears completely from
lsusb
, then a hard unplug or restart might still be needed. -
These methods don't affect your full system, just the specific USB device/port.
-
Always check
dmesg
orjournalctl -xe
for logs after resetting to confirm success.
Let me know if you want a script to automate this process.
You said:
ChatGPT said:
Thanks. Based on your lsusb
output, it seems your wired mouse is not being detected at all, since there's no device listed corresponding to it (Logitech, HP, Dell, etc.).
This typically means:
-
The USB port is dead or stuck
-
The device has failed
-
Or it’s a power issue
✅ Try to Reset All USB Ports via Sysfs
Since the mouse doesn’t show up in lsusb
, let’s try resetting the USB controller. This works without rebooting.
⚠️ Identify USB controllers:
bashls /sys/bus/pci/drivers/xhci_hcd
You should see something like:
bash0000:00:14.0 bind new_id remove_id uevent unbind
The part 0000:00:14.0
is your USB controller ID.
🔁 Reset the USB controller:
bashecho -n '0000:00:14.0' | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind
sleep 2
echo -n '0000:00:14.0' | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind
⚠️ This will disconnect all USB devices temporarily, including webcam/Bluetooth/mouse if connected.
✅ Alternative: Check dmesg
when plugging mouse
Try this after plugging in your wired mouse:
bashdmesg | tail -n 30
If you see nothing related to USB device detection, the port or the mouse might be faulty or underpowered.
🔧 Additional Suggestions
-
Try another USB port
-
Try the mouse in another system to rule out hardware issue
-
Use a powered USB hub if your laptop’s USB is undervolting
Let me know if you want a script to auto-reset all USB controllers, or if you're using a specific mouse brand — I can help match its device ID too.
You said:
ChatGPT said:
Thanks for the clarification — this is a classic case of a per-port USB glitch, not hardware failure.
🔍 Summary:
-
USB port is not faulty (wireless mouse works).
-
Wired mouse is not faulty (works on other port).
-
Problem: Specific wired mouse not detected on one port only, after Ubuntu boot.
✅ Solution: Reset Just That USB Port (Without Reboot)
🔧 Step 1: Identify USB port path of the non-working port
-
Plug the wired mouse into the port where it’s not working.
-
Run:
bashjournalctl -k -n 30
or:
bashdmesg | tail -n 30
See if any message is logged like:
cppusb 1-1.3: new low-speed USB device number 8 using xhci_hcd
Here,
1-1.3
is the USB port path.
🔧 Step 2: Reset that port via unbind/rebind
Assuming the path was 1-1.3
, do:
bashecho '1-1.3' | sudo tee /sys/bus/usb/drivers/usb/unbind
sleep 1
echo '1-1.3' | sudo tee /sys/bus/usb/drivers/usb/bind
Replace
1-1.3
with the actual USB path from dmesg.
🧪 Optional: Reset via controller (less preferred, affects all ports)
You can also reset the whole controller as mentioned before:
bashecho -n '0000:00:14.0' | sudo tee /sys/bus/pci/drivers/xhci_hcd/unbind
sleep 2
echo -n '0000:00:14.0' | sudo tee /sys/bus/pci/drivers/xhci_hcd/bind
You can find the controller ID with:
bashlspci | grep -i usb
🧼 Optional One-liner to list USB device-tree
bashlsusb -t
This helps you visually see which device is connected to which port.
💡 Why this happens?
Some wired mice get stuck due to USB power negotiation glitches or static charge. Ubuntu may not fully reset the USB port on reboot (especially if fast boot is enabled in BIOS).
Let me know if you want a script that auto-detects and resets the stuck port dynamically.
You said:
ChatGPT said:
Great question — and you're right to be cautious.
✅ Short Answer:
Yes, you can safely copy-paste everything above into a blog post.
None of the commands or outputs shared here pose any security risk to your system or personal data.
🔍 Details:
1. Your lsusb
output
yamlBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 0c45:6730 Microdia Integrated_Webcam_HD
Bus 001 Device 007: ID 0bda:c829 Realtek Semiconductor Corp. Bluetooth Radio
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
-
This is generic device info (no serial numbers or hardware IDs).
-
IDs like
0c45:6730
are vendor:product IDs, which are public and used across many systems. -
No private or sensitive identifiers are shown here.
2. Commands like usbreset
, unbind/bind
, or dmesg
-
These are admin tools or diagnostics, not exploits.
-
Nothing here can be used to hack or take over your system.
-
They only affect your local USB port/hardware when you run them as root.
3. Hardware controller IDs like 0000:00:14.0
-
These are local PCI device addresses.
-
They’re not unique or traceable, and they differ across machines.
-
Safe to share in public.
🚫 What Would Be Unsafe (Just FYI)?
-
Full output of
dmesg
orjournalctl
containing serial numbers or mount points. -
Anything with private file paths, encryption keys, Wi-Fi MACs, or IPs.
-
Output from
lsblk
,ip a
, or/etc/
files with config values.
✅ Good Practice for Blogging:
You can include this kind of info and say:
"Note: Output like
lsusb
and PCI IDs are safe to share publicly. Just avoid sharing private mount paths or serial numbers."
Let me know if you want me to format this into a ready-to-publish blog-style note.
- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
Comments
Post a Comment
If you have any doubts, please let me know.