How to Reset a USB Device via the Linux Command Line
07:50, 24.04.2026
USB devices occasionally malfunction or stop responding properly, requiring a reset to restore functionality. This guide outlines how to reset a USB device directly from the Linux command line without rebooting your system. Let’s explore the steps.
Step 1: Detecting the USB Device in Linux
The first step is identifying the USB device you plan to reboot. You can use the Isusb command, which lists all the connected devices, to do that:
Lsusb
You’ll see the list of all connected devices. Each device will have a Bus and Device number, for example:
Bus 002 Device 003: ID 0781:5567 SanDisk Corp. Cruzer Blade
The Alternative Way to Detect a USB Device
Another way to get more information about USB devices is to use dmesg command:
dmesg | grep usb
Once the device is identified, check its file path using lsblk or df -h. For example:
lsblk
Step 2: Safely Unmounting the USB Device in Linux
Before resetting the USB device, you need to unmount it safely. You can do that by using the unmount command with a specified device mount point.
To see where the device is mounted, use:
df -h
Identify your device output, and specify it when running the command:
sudo umount /dev/sdb1
The device should no longer appear as mounted.
Step 3: Performing a USB Device Reset in Linux
After successfully unmounting the device, you can reset it using the usbreset utility. If you don’t have it installed, you can install the usbutils package, which includes the utility, with the following command:
sudo apt install usbutils
Then, reset the device by specifying its Bus and Device number:
sudo usbreset /dev/bus/usb/002/003
Replace /002/003 with the Bus and Device numbers from lsusb.
Step 4: Reattaching the USB Device in Linux
After resetting the USB device is done, you should remount it to see how it’s working.
If the device was previously mounted, use the following command:
sudo mount /dev/sdb1 /mnt
Replace /dev/sdb1 with the correct device path.
Finally, run the lsusb command to ensure that the device is functioning properly. If it appears in the list of active devices, it means that you have successfully reset it:
lsusb
Conclusion
Based on our experience, resetting a USB device via the Linux command line can be a quick and effective way to resolve issues without needing to reboot your system. By following these steps, you can detect, unmount, reset, and remount a USB device with ease.