![如何读取 dmesg 中的 USB 存储消息?](https://linux22.com/image/132199/%E5%A6%82%E4%BD%95%E8%AF%BB%E5%8F%96%20dmesg%20%E4%B8%AD%E7%9A%84%20USB%20%E5%AD%98%E5%82%A8%E6%B6%88%E6%81%AF%EF%BC%9F.png)
插入 USB 笔式驱动器时,我收到以下消息
[20236.720694] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[20236.721212] scsi host6: usb-storage 1-1.2:1.0
我认为usb-storage
是内核模块的名称。1-1.2
表示 USB 总线 1,在层次结构中位置为 1.2(根集线器在端口 1 上有一个集线器,并且在该集线器上设备位于端口 2 上)。
但是“:1.0”后缀是什么意思呢?
整个 dmesg 输出:
$ sudo dmesg -c
[20236.607122] usb 1-1.2: new high-speed USB device number 28 using ehci-pci
[20236.720003] usb 1-1.2: New USB device found, idVendor=0951, idProduct=1665
[20236.720007] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[20236.720009] usb 1-1.2: Product: DataTraveler 2.0
[20236.720012] usb 1-1.2: Manufacturer: Kingston
[20236.720014] usb 1-1.2: SerialNumber: 08606E6D402EFD91D7025267
[20236.720694] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[20236.721212] scsi host6: usb-storage 1-1.2:1.0
[20237.766610] scsi 6:0:0:0: Direct-Access Kingston DataTraveler 2.0 1.00 PQ: 0 ANSI: 4
[20237.767789] sd 6:0:0:0: Attached scsi generic sg2 type 0
[20237.768454] sd 6:0:0:0: [sdc] 15131636 512-byte logical blocks: (7.75 GB/7.21 GiB)
[20237.769158] sd 6:0:0:0: [sdc] Write Protect is off
[20237.769163] sd 6:0:0:0: [sdc] Mode Sense: 45 00 00 00
[20237.769903] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[20237.774661] sdc: sdc1 sdc2
[20237.777526] sd 6:0:0:0: [sdc] Attached SCSI removable disk
我使用的是 Ubuntu 17.04。