Fix USB not working in Linux

You have connected a USB or keyboard or mouse to your Linux PC, but it doesn't work. What's happening? Why can't my Linux device detect my device?

Is your USB device stopped working? Here's what to do on Linux if your USB is not detected or detected.

1. USB device is not detected by Linux

The first thing to check when plugging your USB device into a Linux computer is whether it is detected or not. Detecting a USB device often doesn't sound or sound like it does in Windows or macOS, meaning you usually have to check if the device is recognized by the operating system.

Fortunately, this is very simple. First, disconnect the USB device you are querying. Then, open a command line window and enter the command "list USB":

Fix USB not working in Linux Picture 1Fix USB not working in Linux Picture 1

Record the result, then connect the USB device and run lsusb again.

This time, you will see an additional device listed, with Bus ID, Device ID, USB ID and description. If you can't find out what the additional device is (you might have a USB device inside, such as Ethernet), try another command.

dmesg | grep -i USB

The dmesg command will list the USB devices connected on your system. It will also include non-USB hardware and provide a large amount of information. To prevent this, you can try:

dmesg | less

The result will give you more user-friendly information.

usb-devices

Fix USB not working in Linux Picture 2Fix USB not working in Linux Picture 2

This is like a combination of dmesg and lsusb, listing the USB hardware connected with enough information to identify them.

So is the USB you connected to listed here? If not, then the port is probably damaged or there is a problem with the device. Similarly, the device may not be compatible with Linux.

2. How to check the USB port

If the USB device is not displayed, it may be caused by a problem with the USB port.

The best way to test this quickly is to simply use one USB port on the same computer. If the USB hardware is now detected, then you know that you are having problems with the original USB port.

If you don't have another USB port, you'll need to try the USB device on another PC or laptop. However, this might not be ideal since you probably only have one Windows or macOS computer. Since some USB devices cannot be used on Linux, it will be difficult to determine whether the USB device or the USB port is causing the problem for you.

For best results, if possible, choose Linux-compatible hardware when troubleshooting USB devices.

3. Repair damaged USB hardware

If your USB hardware is not showing up in Linux and you suspect it is faulty, you have two options: Repair or return.

The fix usually involves checking the USB port, as well as the device is not working currently. As for peripherals, fixes will almost always revolve around USB cables and ports on the computer. However, the USB cable can often be replaced, while the ports can be repaired.

Physical testing of the USB device is a good idea. The cable must be sturdy, free of cracks; The plug must not be loose.

Meanwhile, the USB ports should be checked when your PC is turned off and disconnected from the mains power. Check the ports for sure (wobbly USB ports are a sign of worn-out hardware).

If the USB port is loose, you can solder it back to its original position. Of course, you need to know how to weld, never do anything when you don't know anything.

Also, check for dirt in the USB ports, especially those around the back of your PC, where dust often gets on. Dust is your PC's enemy, so keep your system in a dust-free environment for increased performance. Since dust can enter your PC through the USB slots, take time to keep these ports clean. Use a can of compressed air to push dirt out.

Can you return your USB device? If it's new, maybe it's okay. The problem is, unless it is clearly labeled to run under Linux, it is unlikely the retailer would accept the return.

4. Restart Linux to fix the USB port

In some cases - for example if you're using a laptop - power problems can affect its ability to detect USB devices. The autosuspend setting is designed to reduce power usage on Linux laptops, but it can be counterproductive.

So what can you do?

First, check if autosuspend is causing the problem. You can do this by restarting your computer. If the USB device is working, then the USB port is receiving power. The problem occurs when the power management software decides to stop supplying power to the USB port.

The next step is to make sure this doesn't happen again. On Ubuntu 20.04, you can open a Terminal and type:

udisksctl power-off -b / dev / sdX

If you are using an older version of Ubuntu, other commands are required. Open a Terminal window and enter:

cat / sys / module / usbcore / parameters / autosuspend

This will return the value 2, which means that autosuspend is enabled.

Fix USB not working in Linux Picture 3Fix USB not working in Linux Picture 3

You can fix this by editing the grub file. Import:

sudo nano / etc / default / grub

Here, find: GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash" and change it to

GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash usbcore.autosuspend = -1".

Fix USB not working in Linux Picture 4Fix USB not working in Linux Picture 4

Press Ctrl + X to save the file and exit. Next, update grub:

sudo update-grub

When the update is complete, restart Ubuntu.

After the reboot, log into your account and re-enter the cat command:

cat / sys / module / usbcore / parameters / autosuspend

This time, the return value must be -1. You have turned off the autosuspend feature, so USB devices connected to the laptop will not fail due to a power issue.

5. Check the USB device driver on Linux

In the old days, USB devices often did not work in Linux. Only devices made by OEMs interested in Linux (perhaps they used it for development) provide Linux drivers.

Today, things are very different, most manufacturers provide Linux drivers. In most cases, the driver will be available in your Linux operating system, through the kernel. You don't need to install any USB drivers.

If there is no driver available, you can find it by contacting the manufacturer of the USB device.

4.1 ★ | 168 Vote