
ユニバーサルシリアルバスまたはUSBは、キーボード、ポインティングデバイス、プリンター、デジタルカメラ、ポータブルメディアプレーヤー、ディスクドライブ、ネットワークアダプターなどのコンピューター周辺機器の接続を標準化するように設計されています。」-出典:Wikipedia
業界標準になったため、今ではUSBポートのないコンピュータを見るのは困難です。 USBフラッシュディスクの使用はそれをより人気があります。 Linuxでは、USBデバイスとそのプロパティを一覧表示するlsusbがあります。
lsusbとは
マニュアルページから、lsusbは次のように定義されています。
システム内のUSBバスとそれに接続されているデバイスに関する情報を表示するためのユーティリティ。
lsusbを実行する方法
lsusbを実行するには、コンソールから直接lsusbと入力します。
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 17ef:4811 Lenovo Integrated Webcam [R5U877]
Bus 008 Device 002: ID 0a5c:217f Broadcom Corp. Bluetooth Controller
lsusb システムに内部的に接続されているドライバとデバイスが表示されます。
これが出力の読み方です。上記の出力から最後の行を取得します:
バス008デバイス002:ID 0a5c:217f BroadcomCorp.Bluetoothコントローラー
- バス008: デバイスが接続されている場所を意味します
- デバイス002: これが接続する2番目のデバイスであることを意味します
- ID: このデバイスのID番号を意味します
- Broadcom Corp. Bluetoothコントローラー: メーカー名とデバイス名を意味します
また、システムにはUSB2.0ルートハブドライバーとUSB1.1ルートハブドライバーが接続されていることもわかります。
これは、dmesgコマンドを使用して表示されます。これがその例です。
$ dmesg |grep -i usb
[ 0.353138] usbcore: registered new interface driver usbfs
[ 0.353150] usbcore: registered new interface driver hub
[ 0.353182] usbcore: registered new device driver usb
[ 0.730026] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.730116] ehci_hcd 0000:00:1a.7: new USB bus registered, assigned bus number 1
[ 0.748019] ehci_hcd 0000:00:1a.7: USB 2.0 started, EHCI 1.00
[ 0.748169] hub 1-0:1.0: USB hub found
[ 0.748336] ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 2
[ 0.768019] ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00
[ 0.768147] hub 2-0:1.0: USB hub found
[ 0.768236] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.768251] uhci_hcd: USB Universal Host Controller Interface driver
USBの詳細を一覧表示する方法
-v
を使用する それを行うためのパラメータ。これがそのサンプルです。
$ lsusb -v
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 5
bNumEndpoints 2
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 1 Bluetooth
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 1
Transfer Type Isochronous
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
接続されているUSBデバイスの数を確認する
それを見つけるには、このコマンドを使用します
$ find /dev/bus
次に、次のような出力が得られます:
/dev/bus
/dev/bus/usb
/dev/bus/usb/008
/dev/bus/usb/008/002
/dev/bus/usb/008/001
/dev/bus/usb/007
/dev/bus/usb/007/001
/dev/bus/usb/006
/dev/bus/usb/006/001
/dev/bus/usb/005
/dev/bus/usb/005/001
/dev/bus/usb/004
/dev/bus/usb/004/001
/dev/bus/usb/003
/dev/bus/usb/003/001
/dev/bus/usb/002
/dev/bus/usb/002/004
/dev/bus/usb/002/003
/dev/bus/usb/002/001
/dev/bus/usb/001
/dev/bus/usb/001/001
lsusbコマンドを使用して-D
と組み合わせる パラメータを使用すると、特定のデバイスの詳細を印刷できます。 BroadcomBluetoothデバイスを表示するためのサンプルを次に示します。
$ lsusb -D /dev/bus/usb/008/002
Device: ID 0a5c:217f Broadcom Corp. Bluetooth Controller
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 224 Wireless
bDeviceSubClass 1 Radio Frequency
bDeviceProtocol 1 Bluetooth
bMaxPacketSize0 64
idVendor 0x0a5c Broadcom Corp.
idProduct 0x217f Bluetooth Controller
bcdDevice 3.60
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
大容量記憶装置を探す
lsusb -v
以降 私たちに非常に詳細な情報を教えてください、あなたは何かを読むのを見逃すかもしれません。 grepコマンドを使用して特定の情報に焦点を当てることができます。ここにいくつかのサンプルがあります。
大容量記憶装置にはベンダー名とIDがあります。出発点として使用できます。
$ lsusb -v |grep -Ei '(idVendor|Mass\ Storage)'
idVendor 0x1005 Apacer Technology, Inc.
bInterfaceClass 8 Mass Storage
Apacer Technology、Inc.のシステムにUSBマスストレージが1つ接続されていることがわかります。
物理USBデバイス階層をツリーとしてダンプします
-t
を使用します この目的を達成するためのパラメータ。
$ lsusb -t
/: Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
|__ Port 1: Dev 4, If 0, Class=stor., Driver=usb-storage, 480M
|__ Port 6: Dev 3, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
|__ Port 6: Dev 3, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
数12Mおよび480M USBタイプの転送速度を示しています。
- 12Mは、USB 1.0/1.1タイプの12Mbit/sを意味します
- 480Mは、USB2.0タイプである480Mbit/sを意味します
5.0Gを見つけた場合は、USB3.0タイプを使用していることを意味します。転送速度は5.0Gbit/sです。 Linuxは、「/ var / lib / usbutils/usb.ids」からUSBデバイスの詳細を認識します。 Linux-USB.orgにアクセスして、USB IDの最新リスト、またはユニバーサルシリアルバスの実用的なガイドを入手できます。
日常のlsusbコマンドについては以上です。 lsusbコマンドを使用して、システム上のUSBデバイスに関する診断アクティビティを実行できます。いつものように、lsusbのマニュアルページを読むことで詳細を調べることができます。 man lsusbと入力するだけで、マニュアルページが表示されます。