Linux find devices usb

Как посмотреть USB устройства Linux

При подключении USB флешки или любого другого USB устройства к компьютеру создается набор файлов, с помощью которых вы можете получить к ним доступ. Когда вы работаете в файловом менеджере все достаточно просто, но как только дело доходит до консоли все становится намного труднее.

Каждому новичку важно уметь идентифицировать подключенные устройства, будь то usb флешки, SD карты или жесткие диски чтобы не записать что-либо не туда или не отформатировать не тот диск. В этой статье мы рассмотрим несколько способов как посмотреть usb устройства Linux, подключенные к компьютеру.

Список подключенных устройств Linux

В операционной системе Linux используется особенная философия управления. Все объекты, в том числе и устройства считаются файлами. При подключении какого-либо устройства к системе для него создается файл в каталоге /dev/.

Обычно, после того, как вы подключили любую USB флешку или другой накопитель к системе с установленным окружением рабочего стола, устройство автоматически монтируется в папку /media/имя_пользователя/метка_устройства/, а затем вы можете получить доступ к файлам из устройства в этой папке. Тем не менее, бывают ситуации, когда вам нужно вручную монтировать USB и тогда такой вариант не поможет.

Файлы всех устройств находятся в каталоге /dev/. Здесь вы можете найти файлы sda, hda, которые представляют из себя жесткий диск, а также файлы sda1 или hda1, которые позволяют получить доступ к разделам диска. Мы уже подробно рассматривали это все в статье работа с устройствами Linux. Вы можете посмотреть список всех устройств в каталоге /dev/ с помощью команды:

usb0

Теперь осталось понять какие из этих файлов устройств принадлежат USB устройствам и каким устройствам именно.

Как посмотреть USB устройства Linux

Чтобы узнать более подробную информацию о каждом устройстве, подключенном к вашей системе и посмотреть список устройств linux, можно использовать команду df. Она используется для просмотра свободного места на диске:

usb

По общему размеру и занятому пространству вы можете определить какое из устройств является вашей флешкой, но этот способ посмотреть устройства linux не очень удобен и работает он только с уже смонтированной флешкой, есть еще несколько, дающих более точную информацию.

Команда lsblk отображает список всех блочных устройств, подключенных к вашему компьютеру. Утилита отображает не только их размер, но и тип (диск/раздел) а также старший и младший номер устройства. Тут уже немного проще найти флешку, мы видим два диска, и если первый с размером 698 гигабайт это жесткий диск, то второй, — точно флешка:

usb1

Есть еще один способ, это утилита fdisk. Она позволяет посмотреть таблицу разделов на всех блочных устройствах, подключенных к компьютеру. Но утилиту нужно выполнять от имени суперпользователя:

usb2

Также, узнать о подключенном USB устройстве можно посмотрев очередь сообщений ядра dmesg. Здесь хранится информация обо всех операциях, которые происходят в ядре. В том числе здесь будет отображено имя флешки, только что подключенной к компьютеру. Для просмотра сообщений ядра выполните:

Читайте также:  Название линукса в терминале

usb3

Чтобы посмотреть какие из sd устройств относятся к USB используйте такую команду:

usb4

Попытаться идентифицировать свою флешку в системе через терминал можно с помощью утилиты blkid. Она выводит UUID идентификаторы всех подключенных устройств, а также файловую систему:

usb6

Выводы

В этой статье мы рассмотрели как посмотреть usb устройства linux, а также как узнать имя своей usb флешки в системе. Вы можете использовать любую из команд, которая вам понравилась, или же сразу несколько. Но теперь вы знаете как точно определить имя файла своей флешки.

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

List USB Devices Linux

In the world of USB computer peripherals, almost everyone uses some sort of USB devices in their computer. These days there are USB webcams, USB hard drives, USB stick also known as PenDrive etc. Almost every device has a USB version of it. So if you’re using Linux, listing what USB device is connected to your system might be necessary at some point.

There are many programs and many ways to list USB devices on Linux.

In this article, I will show you how to list USB devices on Linux. I am using Ubuntu 18.04 Bionic Beaver for the demonstration, but these commands are available on every Linux distribution. So let’s get started.

Listing USB Devices using lsusb Command

The widely used lsusb command can be used to list all the connected USB devices in Linux.

As you can see from the output of the lsusb command in the screenshot below, all the connected USB device is listed. The Bus ID, Device ID, USB ID, and a title is displayed in the output of lsusb command.

As you can see in the marked section of the screenshot below, Realtek Semiconductor Corp. with ID 0bda:57cb, this is my USB Webcam.

You can’t tell that it’s a Webcam by looking at the output of lsusb command, Can you? Nope! So how do I know this? It’s because I checked the output of the lsusb command before and after connecting the USB Webcam and once I compared the outputs, the newly added row is the USB device I connected. Plain! But there are ways to find out what the USB device is.

You can use the dmesg command to find out more information about the connected USB devices. The last connected USB device is the easiest to find with dmesg command. It is more widely used for debugging purpose. You will shortly see why.

You run dmesg command as follows:

As you can see in the yellow marked box in the screenshot below, these are information about the USB device I connected last, which was my USB Webcam. You can see in one of the blue marked box, the USB device I connected is a HD UVC WebCam and its ID is 0bda:57cb.

By now you may have found out that the output of dmesg command is system log messages. Well yes, it is.

You can also search for a specific USB device by its ID in the dmesg system log.

Run the following command to open the output of dmesg command with less text pager:

You should see the following window:

Now to search for a string, press / key on your keyboard. And you should the a / appear on the bottom of terminal window as marked in the screenshot below.

Читайте также:  Просмотр установленных пакетов linux centos

Now type in the USB device ID. For example, earlier when I listed the connected USB devices with lsusb command, one of the USB device had ID 0bda:57cb

Type in the USB Device ID and press . As you can see in the marked section of the screenshot below, the search string is marked white.

You may press and arrow keys to navigate up and down and read through it. You should find a lot of information about that USB device as you can see in the marked section of the screenshot below.

Listing USB devices with usb-devices Command

You can run the following command to list all the connected USB devices of your system:

As you can see in the screenshot below, all the connected USB devices are listed. we can find out pretty much the same information as before with usb-devices command.

Listing Block USB Devices

If you want to list all the USB block storage devices, that is all the USB storage devices, then you can use the lsblk or fdisk command to do so.

Listing USB block storage devices with lsblk:

As you can see in the screenshot below, all the available block storage devices (including the USB block storage devices) are listed.

You can get almost the same information as lsblk command with blkid command. But you have to run it as root as follows:

You can also use fdisk command to list all the USB block storage devices as follows:

As you can see in the screenshot below, the connected block storage devices (including the USB devices) are listed.

That’s how you list all the USB devices on Linux. Thanks for reading this article.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.

Источник

linux find usb device

When you connect your USB stick to your computer, it should ideally turn on automatically with flashing lights on the unit indicating activity. Some units have a dedicated power cable, or physical power button that you have to turn on manually, for your computer to detect it.

How do I access a USB drive in Linux terminal?

  1. Find what the drive is called. You’ll need to know what the drive is called to mount it. .
  2. Create a mount point (optional) This needs to be mounted into the filesystem somewhere. .
  3. Mount! sudo mount /dev/sdb1 /media/usb.

How do I find my USB on Ubuntu?

  1. lsusb , example: .
  2. or this powerful tool, lsinput , .
  3. udevadm , with this command line, you need to unplug the device before using the command and then plug it to see it:

How do I manually detect a USB device?

  1. Open Device Manager and then disconnect the USB device from your computer. Wait a few moments and then reconnect the device. .
  2. Connect the USB device to another USB port.
  3. Connect the USB device to another computer.
  4. Update the USB device drivers.

How do I get Windows to recognize a USB device?

  1. Five Steps to Get USB Recognized.
  2. 1 — Check If the USB Device is Recognized on Another Laptop.
  3. 2 — Run Device Troubleshooter.
  4. 3 — Uninstall and re-install USB controllers.
  5. 4 — Disable USB selective suspend setting.
  6. 5 — Recover data and reformat the USB drive to make it recognized.
Читайте также:  Утилиты системного администратора linux

How copy file Linux to USB?

  1. List the Mount device: lsblk.
  2. Create a mount point : This needs to be mounted into the filesystem somewhere. .
  3. Mount! sudo mount /dev/sdb1 /media/usb.
  4. Copy rsync -av /home/android/Testproject/ /media/usb/
  5. 5.Un-Mount. When you’re done, just fire off: sudo umount /media/usb.

How do I access USB from command prompt?

After you open Command Prompt, you can type the drive letter of the external removable drive, be it USB flash drive or external hard drive, and type a colon after it. Hit Enter key on the keyboard, and you will access the external drive from Command Prompt.

How use USB in Kali Linux?

Plug your USB drive into an available USB port on your Windows PC, note which drive designator (e.g. “F:») it uses once it mounts, and launch Etcher. Choose the Kali Linux ISO file to be imaged with “select image” and verify that the USB drive to be overwritten is the correct one. Click the “Flash!” button once ready.

How do I know if I have USB 3.0 Linux?

  1. Look at the output of lsusb. Note what the bus number is of the USB 2.0 and USB 3.0 ports. In the article, BUS 1 and BUS 2 are USB 2.0, and BUS 3 is USB 3.0.
  2. Plug a USB device into one of the ports.
  3. Use lsusb again. Note the bus number that the device is plugged into.

How do I get VirtualBox to recognize my USB?

Open up VirtualBox, right-click on the virtual machine that needs access to USB, and click Settings. In the VM settings window, click USB. You should see that USB is now available. Click on the + button under USB Device Filters to add a new device (Figure B).

Can detect USB but Cannot open?

If your USB appear in Disk Management but it is not accessible, then it means that drive got corrupted or there is error in the disk. In this case, follow the below steps to fix this problem: Click Start> type msc in search bar and hit ENTER. This will open Computer Management.

Why is my USB not showing up?

If you connected a USB drive and Windows doesn’t show up in the file manager, you should first check the Disk Management window. To open Disk Management on Windows 8 or 10, right-click the Start button and select “Disk Management”. On Windows 7, press Windows+R to open the Run dialog, type diskmgmt.

How do I fix unrecognized USB?

  1. Select Start, then type device manager in the Search box, and then select Device Manager.
  2. Expand Universal Serial Bus controllers. Press and hold (or right-click) a device and select Uninstall. .
  3. Once complete, restart your computer. Your USB controllers will automatically install.

Linux

Meet The New Linux Logo. If you followed the timeline of Linux, you know that ever since Tux, a penguin, has been chosen as the mascot of Linux projec.

How to Install vsFTPd with TLS on CentOS/RHEL 7/6

Vsftpd

How to Install vsFTPd with TLS on CentOS/RHEL 7/6 & Fedora 30-25Step 1 – Install VsFTPd. The vsftpd server packages are available under CentOS/RHE.

Python String replace() Function

String

What does replace () do in Python?How do I replace a string in a string in python?How do I replace a string in Python 3?How do you change a string in .

Latest news, practical advice, detailed reviews and guides. We have everything about the Linux operating system

Источник

Оцените статью
Adblock
detector