Answers:
要检测您的USB设备,请在终端中尝试:
lsusb
,例如:
$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 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 001 Device 002: ID 046d:0809 Logitech, Inc. Webcam Pro 9000
Bus 003 Device 002: ID 046d:c016 Logitech, Inc. Optical Wheel Mouse
或者这个强大的工具,lsinput
,
第一次安装它,然后尝试它,它列出了所有输入设备,包括USB设备:
sudo apt-get install input-utils
lsinput
例:
$ lsinput
/dev/input/event0
...
/dev/input/event1
...
/dev/input/event2
...
/dev/input/event3
bustype : BUS_USB
vendor : 0x46d
product : 0xc016
version : 272
name : "Logitech Optical USB Mouse"
phys : "usb-0000:00:1d.1-2/input0"
uniq : ""
bits ev : EV_SYN EV_KEY EV_REL EV_MSC
udevadm
,使用此命令行,您需要在使用命令之前先拔掉设备的电源,然后将其插入才能看到它:
$ udevadm monitor --udev
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
UDEV [1915.787445] add /devices/pci0000:00/0000:00:1d.3/usb5/5-2 (usb)
UDEV [1915.796226] add /devices/pci0000:00/0000:00:1d.3/usb5/5-2/5-2:1.0 (usb)
但这可能行不通。就我而言,我试图使Leapfrog Tag在Ubuntu上运行没有成功。
如果相关设备是软件保护加密狗,则可能不是大容量存储设备。
可能要实现的替代设备是以太网控制器。该软件可以通过网络适配器与设备通信,该适配器不会显示为驱动器。或者该设备可以实现一个串行端口,或者另一个驱动程序包含在操作系统中的设备。
无论如何,这都不是一个适当的论坛,即使您尝试使用Ubuntu来绕过Windows软件上的复制保护。
如果要检测USB设备的装载方式(具有出色的粒度),可以采用以下两种方法:
udevadm monitor
:这将显示正在加载的USB设备的USB总线看到它。
udevadm
是udev
18.04 LTS上默认软件包的一部分;无需安装。
但是,udevadm monitor
在插入USB设备之前执行。
标本输出加载如下所示的USB闪存驱动器。跳到最后一行,您甚至可以查看它作为(sda1)加载的设备:
udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[969.010067] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[969.010367] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[969.018769] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0 (scsi)
KERNEL[969.018849] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/scsi_host/host0 (scsi_host)
KERNEL[969.018934] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
KERNEL[969.019049] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [969.024995] add /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
UDEV [969.031390] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [969.036362] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0 (scsi)
UDEV [969.041258] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/scsi_host/host0 (scsi_host)
UDEV [969.046202] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0 (usb)
UDEV [969.051734] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1 (usb)
KERNEL[970.051706] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0 (scsi)
KERNEL[970.052068] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0 (scsi)
KERNEL[970.052215] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0 (scsi_disk)
KERNEL[970.052435] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0 (scsi)
KERNEL[970.052585] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/scsi_device/0:0:0:0 (scsi_device)
KERNEL[970.052774] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/scsi_generic/sg0 (scsi_generic)
KERNEL[970.052963] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0 (bsg)
UDEV [970.060833] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0 (scsi)
KERNEL[970.061634] add /devices/virtual/bdi/8:0 (bdi)
UDEV [970.069006] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0 (scsi)
UDEV [970.071467] add /devices/virtual/bdi/8:0 (bdi)
UDEV [970.075852] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/scsi_disk/0:0:0:0 (scsi_disk)
KERNEL[970.079839] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/block/sda (block)
KERNEL[970.079989] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda1 (block)
UDEV [970.083556] bind /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0 (scsi)
UDEV [970.091288] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/scsi_device/0:0:0:0 (scsi_device)
UDEV [970.091755] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/scsi_generic/sg0 (scsi_generic)
UDEV [970.106807] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/bsg/0:0:0:0 (bsg)
UDEV [970.339976] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/block/sda (block)
UDEV [970.519549] add /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda1 (block)
。
dmesg
(打印出内核环形缓冲区)还将使您对USB设备的加载有更细致的了解。
但是,dmesg
与相比,从内核的角度向udevadm monitor
您展示了如何加载外部USB设备。
样品输出dmesg
-这次是从USB外部CD驱动器输出-如下所示。“ 1-2 ”表示其在USB总线上的位置:第一条总线,第二个端口。如果我将CD驱动器连接到另一个端口,它将报告“ 1-1 ”:
[ 55.296482] usb 1-2: new high-speed USB device number 4 using xhci_hcd
[ 55.453715] usb 1-2: New USB device found, idVendor=1c6b, idProduct=a222
[ 55.453730] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 55.453740] usb 1-2: Product: Mass Storage Device
[ 55.453749] usb 1-2: Manufacturer: USB2.0 External
[ 55.453758] usb 1-2: SerialNumber: 2010100500000000174
[ 55.525860] usb-storage 1-2:1.0: USB Mass Storage device detected
[ 55.527273] scsi host0: usb-storage 1-2:1.0
[ 55.530031] usbcore: registered new interface driver usb-storage
[ 55.545215] usbcore: registered new interface driver uas
[ 56.553073] scsi 0:0:0:0: CD-ROM slimtype eTDU108 1 SL46 PQ: 0 ANSI: 0