How to Reset USB Device Using Command Line in Linux

Resetting a USB device from the Command Line Interface (CLI) can help resolve issues such as unresponsiveness or connection problems. This guide will walk you through the steps to reset a USB device using simple commands.

Step 1: Identify the USB Device in Linux

Before resetting the USB device, you must identify it by using the lsusb command, which lists all USB devices connected to your system.

lsusb

You’ll see a list of connected USB devices, something like this:

Find USB Drive in Linux
Find a USB Drive in Linux

Note the bus and device number of the USB device you want to reset (e.g., Bus 001 Device 004).

Step 2: Unmount the USB Device in Linux

If the USB device is mounted, you need to unmount it before resetting it by using the umount command followed by the device’s mount point.

You can use the df command to see where the USB device is mounted:

df -h

Look for your USB device in the output, which will usually looks like /media/username/device_name.

Find USB Device Mount Point
Find USB Device Mount Point

Now run the command below, replacing /media/username/device_name with the actual mount point:

sudo umount /media/username/device_name

Step 3: Reset the USB Device in Linux

After unmounting the device, you can reset it using the usbreset utility. If you don’t have usbreset installed, you can install it using the following appropriate command for your specific Linux distribution.

sudo apt install usbutils         [On Debian, Ubuntu and Mint]
sudo yum install usbutils         [On RHEL/CentOS/Fedora and Rocky/AlmaLinux]
sudo emerge -a sys-apps/usbutils  [On Gentoo Linux]
sudo apk add usbutils             [On Alpine Linux]
sudo pacman -S usbutils           [On Arch Linux]
sudo zypper install usbutils      [On OpenSUSE]    
sudo pkg install usbutils         [On FreeBSD]

Once installed, you can reset the USB device using the following command by replacing Bus 001 Device 004 with your USB device’s bus and device number:

sudo usbreset /dev/bus/usb/001/004

Alternatively, you can use the following command, where <device_id> is the ID of the USB device (from the lsusb output):

sudo usbreset 090c:1000
Reset USB Device in Linux
Reset USB Device in Linux

Step 4: Remount the USB Device in Linux

After resetting the USB device, you can remount it. If your system does not automatically mount it, you can do it manually by running the following commands.

lsblk
sudo mount /dev/sdX1 /media/username/device_name

Replace /dev/sdX1 with your USB device’s identifier, which you can find using the lsblk command.

Mount USB Device in Linux
Mount USB Device in Linux

Finally, verify that the USB device is functioning properly by running the lsusb command. If it appears in the list, it is successfully reset and ready to use.

lsusb
Verify USB Device in Linux
Verify USB Device in Linux
Conclusion

Resetting a USB device from the Linux terminal is a straightforward process that can help resolve various issues. By following the steps outlined above, you can identify, unmount, reset, and remount your USB device without much hassle.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Ravi Saive
I am an experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.