How to Reset a USB Device via the Linux Command Line

watch 1m, 57s
views 2

07:50, 24.04.2026

Article Content
arrow

  • Step 1: Detecting the USB Device in Linux
  • The Alternative Way to Detect a USB Device
  • Step 2: Safely Unmounting the USB Device in Linux
  • Step 3: Performing a USB Device Reset in Linux
  • Step 4: Reattaching the USB Device in Linux
  • Conclusion

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.

Share

Was this article helpful to you?

VPS popular offers

-10.1%

CPU
CPU
3 Epyc Cores
RAM
RAM
2 GB
Space
Space
20 GB NVMe
Bandwidth
Bandwidth
Unlimited
aiKVM-NVMe 2048 Linux

8.94 /mo

/mo

Billed annually

-16.3%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
30 GB SSD
Bandwidth
Bandwidth
40 Mbps
DDoS Protected SSD-KVM 2048 Linux

48 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
16 GB
Space
Space
150 GB NVMe
Bandwidth
Bandwidth
Unlimited
Keitaro KVM 16384
OS
CentOS
Software
Software
Keitaro

55.54 /mo

/mo

Billed annually

-15%

CPU
CPU
6 Xeon Cores
RAM
RAM
8 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
80 Mbps
DDoS Protected SSD-wKVM 8192 Windows

101 /mo

/mo

Billed annually

-20.2%

CPU
CPU
1 Xeon Core
RAM
RAM
1 GB
Space
Space
50 GB SSD
Bandwidth
Bandwidth
300 GB
wKVM-SSD 1024 HK Windows

19 /mo

/mo

Billed annually

-10%

CPU
CPU
3 Epyc Cores
RAM
RAM
2 GB
Space
Space
25 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 2048 Windows

9.9 /mo

/mo

Billed annually

-7.1%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB HDD
Bandwidth
Bandwidth
Unlimited
wKVM-HDD 4096 Windows

21 /mo

/mo

Billed annually

-20.6%

CPU
CPU
6 Xeon Cores
RAM
RAM
8GB
Space
Space
100GB SSD
Bandwidth
Bandwidth
500GB
KVM-SSD 8192 HK Linux

59 /mo

/mo

Billed annually

-10%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
40 GB HDD
Bandwidth
Bandwidth
Unlimited
KVM-HDD 1024 Linux

6.1 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
75 GB SSD
Bandwidth
Bandwidth
Unlimited
wKVM-SSD 2048 Windows

10.23 /mo

/mo

Billed annually

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.