USB 端口不工作 - 如何检查驱动程序和诊断问题?

USB 端口不工作 - 如何检查驱动程序和诊断问题?

我的 USB 端口以前可以工作,但现在停止工作了。我想重新安装 ubuntu,但我不想这样做,直到我可以备份我的数据,而在我的 USB 端口修好之前我无法备份数据。我如何检查 ubuntu 是否可以看到 USB 驱动程序,如果可以看到,我该如何诊断问题?

答案1

  1. 检查dmesg日志

    dmesg | grep -i USB或者less /var/log/dmesg

    上述日志可能暗示发现 USB 大容量存储设备:

    [    1.871577] Initializing USB Mass Storage driver...
    [    1.871749] scsi6 : usb-storage 3-2:1.0
    [    1.871807] usbcore: registered new interface driver usb-storage
    [    1.871808] USB Mass Storage support registered.
    
  2. 检查是否找到 USB HDD

    sudo fdisk -l
    
    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x5738799d9
    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x573879d9
    

    第一个驱动器的分区表

    Disk /dev/sdb: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xef4535bb
    
  3. 磁盘可能被检测到,但 UDEV 无法挂载它,因为规则可能存在问题。在插入/移除 USB 驱动器时运行以下命令,看看是否可以看到类似的输出。

    sudo udevadm monitor
    
    UDEV  [5301.797498] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0 (scsi)
    UDEV  [5301.798939] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/scsi_disk/7:0:0:0 (scsi_disk)
    UDEV  [5301.799263] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/scsi_device/7:0:0:0 (scsi_device)
    KERNEL[5301.799286] add      /devices/virtual/bdi/8:16 (bdi)
    UDEV  [5301.799490] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/bsg/7:0:0:0 (bsg)
    UDEV  [5301.799696] add      /devices/virtual/bdi/8:16 (bdi)
    UDEV  [5301.799745] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/scsi_generic/sg2 (scsi_generic)
    KERNEL[5301.862793] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb (block)
    KERNEL[5301.862808] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb1 (block)
    KERNEL[5301.862825] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb2 (block)
    KERNEL[5301.862833] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb3 (block)
    UDEV  [5302.204799] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb (block)
    UDEV  [5302.664236] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb3 (block)
    UDEV  [5302.664315] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb1 (block)
    UDEV  [5302.762447] add      /devices/pci0000:00/0000:00:1c.3/0000:03:00.0/usb3/3-2/3-2:1.0/host7/target7:0:0/7:0:0:0/block/sdb/sdb2 (block)
    

答案2

在 ubuntu 中,您不需要为 USB 端口安装特殊驱动程序 - 多年来,这一直是基本安装的一部分。但是,您可以检查您的 ubuntu 是否识别 USB 端口:

  1. 打开终端
  2. 输入lsusb(不带引号)
  3. 查看是否至少列出了一项。

响应看起来应该是这样的:

总线 001 设备 001:ID 1d6b:0002 Linux Foundation 2.0 根集线器

总线 002 设备 001:ID 1d6b:0002 Linux Foundation 2.0 根集线器

总线 001 设备 002:ID 8087:0020 Intel 公司集成速率匹配集线器

如果 lsusb 没有列出任何内容,那么可能是您缺少一些基本软件包。

相关内容