Linux上USB3外部存储的连接问题(UAS驱动程序问题)


23

在Ubuntu 15.10上,当我想使用NTFS文件系统格式化通过USB3(在StarTech USB / eSATA硬盘底座上)连接的外部4TO磁盘时,我遇到很多 I / O错误,并且格式化失败。

我尝试了GParted v 0.19,并在最新的实时CD上尝试了GParted gparted-live-0.23.0-1-i586.iso,但存在相同的问题。

之后,在Ubuntu 15.10和相同的USB3连接上使用GParted,我尝试将格式设置为ext4,没有问题。真的很奇怪

因为我不知道mkfs.ext4GParted用来格式化磁盘的工具是否像(或不喜欢)测试磁盘mkntfs,所以我首先假设问题与新磁盘有关。也许此新磁盘引起了问题。因此,我尝试e2fsck -c在此硬盘上运行。在Ubuntu 15.10上,e2fsck -c冻结率为0.45%,我不知道为什么。

因此,在同一台PC上使用另一版本的Ubuntu(15.04),我尝试使用StarTech HDD扩展坞的eSATA连接来连接同一4TO磁盘。这次,e2fsck -c运行正常。

几个小时后,您可以看到结果:

sudo e2fsck -c /dev/sdc1
e2fsck 1.42.12 (29-Aug-2014)
ColdCase : récupération du journal
Vérification des blocs défectueux (test en mode lecture seule) : complété                                             
ColdCase: Updating bad block inode.
Passe 1 : vérification des i-noeuds, des blocs et des tailles
Passe 2 : vérification de la structure des répertoires
Passe 3 : vérification de la connectivité des répertoires
Passe 4 : vérification des compteurs de référence
Passe 5 : vérification de l'information du sommaire de groupe

ColdCase: ***** LE SYSTÈME DE FICHIERS A ÉTÉ MODIFIÉ *****
ColdCase : 11/244195328 fichiers (0.0% non contigus), 15377150/976754176 blocs

我不是badblock输出专家,但是此磁盘上似乎根本没有坏块?

因此,如果问题不是硬盘驱动器,也许可以将问题链接到mkntfs通过USB3使用?我还可以尝试其他哪些测试?

有关USB扩展坞的一些信息:

➜  ~  lsusb
...
Bus 002 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge
...


➜  ~  sudo lsusb -v -d 174c:55aa
Mot de passe [sudo] pour reyman : 

Bus 002 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x174c ASMedia Technology Inc.
  idProduct          0x55aa ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge
  bcdDevice            1.00
  iManufacturer           2 asmedia
  iProduct                3 ASM1053E
  iSerial                 1 123456789012
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          121
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower               36mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           4
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     98 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             16
        Data-in pipe (0x03)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             16
        Data-out pipe (0x04)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              15
        MaxStreams             16
        Status pipe (0x02)
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               0
        Command pipe (0x01)
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat        2047 micro seconds
Device Status:     0x0001
  Self Powered

有关该磁盘的信息: /dev/sdd

➜  ~  sudo fdisk -l /dev/sdd
Disque /dev/sdd : 3,7 TiB, 4000787030016 octets, 7814037168 secteurs
Unités : sectors of 1 * 512 = 512 octets
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: ACD5760B-2898-435E-82C6-CB3119758C9B

Périphérique Start        Fin   Secteurs  Size Type
/dev/sdd1     2048 7814035455 7814033408  3,7T Linux filesystem

dmesg返回有关磁盘的很多错误;看到这个摘录:

[   68.856381] scsi host6: uas_eh_bus_reset_handler start
[   68.968376] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
[   68.989825] scsi host6: uas_eh_bus_reset_handler success
[   99.881608] sd 6:0:0:0: [sdd] tag#12 uas_eh_abort_handler 0 uas-tag 13 inflight: CMD OUT 
[   99.881618] sd 6:0:0:0: [sdd] tag#12 CDB: Write(16) 8a 00 00 00 00 00 e8 c4 08 00 00 00 00 08 00 00
[   99.881856] sd 6:0:0:0: [sdd] tag#5 uas_eh_abort_handler 0 uas-tag 6 inflight: CMD OUT 
[   99.881861] sd 6:0:0:0: [sdd] tag#5 CDB: Write(16) 8a 00 00 00 00 00 cd 01 08 f0 00 00 00 10 00 00
[   99.881967] sd 6:0:0:0: [sdd] tag#4 uas_eh_abort_handler 0 uas-tag 5 inflight: CMD OUT 
[   99.881972] sd 6:0:0:0: [sdd] tag#4 CDB: Write(16) 8a 00 00 00 00 00 cd 01 08 00 00 00 00 f0 00 00
[   99.882085] sd 6:0:0:0: [sdd] tag#3 uas_eh_abort_handler 0 uas-tag 4 inflight: CMD OUT 
[   99.882090] sd 6:0:0:0: [sdd] tag#3 CDB: Write(16) 8a 00 00 00 00 00 cd 01 07 10 00 00 00 f0 00 00
[   99.882171] sd 6:0:0:0: [sdd] tag#2 uas_eh_abort_handler 0 uas-tag 3 inflight: CMD OUT 
[   99.882175] sd 6:0:0:0: [sdd] tag#2 CDB: Write(16) 8a 00 00 00 00 00 cd 01 06 20 00 00 00 f0 00 00
[   99.882255] sd 6:0:0:0: [sdd] tag#1 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD OUT 
[   99.882258] sd 6:0:0:0: [sdd] tag#1 CDB: Write(16) 8a 00 00 00 00 00 cd 01 05 30 00 00 00 f0 00 00
[   99.882338] sd 6:0:0:0: [sdd] tag#0 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD OUT 
[   99.882342] sd 6:0:0:0: [sdd] tag#0 CDB: Write(16) 8a 00 00 00 00 00 cd 01 04 40 00 00 00 f0 00 00
[   99.882419] sd 6:0:0:0: [sdd] tag#11 uas_eh_abort_handler 0 uas-tag 12 inflight: CMD OUT 
[   99.882423] sd 6:0:0:0: [sdd] tag#11 CDB: Write(16) 8a 00 00 00 00 00 cd 00 f9 00 00 00 00 f0 00 00
[   99.882480] sd 6:0:0:0: [sdd] tag#10 uas_eh_abort_handler 0 uas-tag 11 inflight: CMD OUT 
[   99.882483] sd 6:0:0:0: [sdd] tag#10 CDB: Write(16) 8a 00 00 00 00 00 cd 00 f9 f0 00 00 00 f0 00 00
[   99.882530] sd 6:0:0:0: [sdd] tag#9 uas_eh_abort_handler 0 uas-tag 10 inflight: CMD OUT 
[   99.882532] sd 6:0:0:0: [sdd] tag#9 CDB: Write(16) 8a 00 00 00 00 00 cd 00 fa e0 00 00 00 f0 00 00
[   99.882593] sd 6:0:0:0: [sdd] tag#8 uas_eh_abort_handler 0 uas-tag 9 inflight: CMD 
[   99.882596] sd 6:0:0:0: [sdd] tag#8 CDB: Write(16) 8a 00 00 00 00 00 cd 00 fb d0 00 00 00 f0 00 00
[   99.882667] scsi host6: uas_eh_bus_reset_handler start
[   99.994700] usb 2-2: reset SuperSpeed USB device number 2 using xhci_hcd
[  100.015613] scsi host6: uas_eh_bus_reset_handler success
[  135.962175] sd 6:0:0:0: [sdd] tag#5 uas_eh_abort_handler 0 uas-tag 6 inflight: CMD OUT 
[  135.962185] sd 6:0:0:0: [sdd] tag#5 CDB: Write(16) 8a 00 00 00 00 00 cd 40 78 f0 00 00 00 10 00 00
[  135.962428] sd 6:0:0:0: [sdd] tag#4 uas_eh_abort_handler 0 uas-tag 5 inflight: CMD OUT 
[  135.962436] sd 6:0:0:0: [sdd] tag#4 CDB: Write(16) 8a 00 00 00 00 00 cd 40 78 00 00 00 00 f0 00 00
[  135.962567] sd 6:0:0:0: [sdd] tag#3 uas_eh_abort_handler 0 uas-tag 4 inflight: CMD OUT 
[  135.962576] sd 6:0:0:0: [sdd] tag#3 CDB: Write(16) 8a 00 00 00 00 00 cd 40 77 10 00 00 00 f0 00 00
[  135.962682] sd 6:0:0:0: [sdd] tag#2 uas_eh_abort_handler 0 uas-tag 3 inflight: CMD OUT 
[  135.962690] sd 6:0:0:0: [sdd] tag#2 CDB: Write(16) 8a 00 00 00 00 00 cd 40 76 20 00 00 00 f0 00 00
[  135.962822] sd 6:0:0:0: [sdd] tag#1 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD 
[  135.962830] sd 6:0:0:0: [sdd] tag#1 CDB: Write(16) 8a 00 00 00 00 00 cd 40 75 30 00 00 00 f0 00 00
[  160.904916] sd 6:0:0:0: [sdd] tag#0 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD OUT 
[  160.904926] sd 6:0:0:0: [sdd] tag#0 CDB: Write(16) 8a 00 00 00 00 00 00 00 29 08 00 00 00 08 00 00
[  160.905068] scsi host6: uas_eh_bus_reset_handler start

我在此论坛帖子中找到了这些信息,说明UAS和新的Linux内核有问题吗?这个问题似乎互联网上很多地方都知道,USB3 + Linux在许多情况下似乎是有问题的-但对于旧内核。有什么想法可以在更新的内核上解决此问题?

我的内核是:

➜  ~  uname -r 
4.2.0-16-generic

嗯,看来UAS对于不同的USB3芯片都坏了ASMedia Technology Inc.;您可以在此处查看更多信息。

我想这是我的问题,但是我现在该如何解决,在StarTech扩展坞中USB3实现中使用哪种芯片?

Answers:


9

我今天在4.8.0内核上遇到了这个问题。

根据此论坛帖子,可以通过

$ echo options usb-storage quirks=357d:7788:u | sudo tee /etc/modprobe.d/blacklist_uas_357d.conf
$ sudo update-initramfs -u

然后重启。


3
请注意,需要通过来将quirks参数设置为有问题的设备的特定ID lsusb
Boann

14

我在Mint 18上遇到了同样的问题,但是我发现的解决方案可能可以应用于* Ubuntu 15/16以及类似的Linux发行版。但是,对我来说,看到dmesg中的UAS错误后,我很快就获得了不可恢复的系统锁定。

我的机壳上装有ASMedia ASM1053芯片,该内核的UAS模块(通用4.4.0-72)似乎有问题。

有点搜索后,我结合了两种解决方案,我发现:这一个,这YtvwlD提到的这一个

首先,您必须使用lsusb命令获取设备的硬件ID 。完成此操作后,找到外部/机箱/桥接器。它可能显示如下:

Bus 002 Device 002: ID 174c:5136 ASMedia Technology Inc. ASM1053 SATA 6Gb/s bridge

在我的情况下,ID为174c:5136

在那之后,您必须在/etc/modprobe.d/中创建一个文件,以便使用UAS(导致问题)将正确的设备列入黑名单,使用update-initramfs更新initramfs映像,然后重新启动以使更改生效。

$ echo options usb-storage quirks=174c:5136:u | sudo tee /etc/modprobe.d/blacklist_uas.conf
$ sudo update-initramfs -u
$ sudo reboot

当然,将“ 174c:5136”替换为网桥/机柜/外部设备的硬件ID。如果操作正确,则在重新启动设备后连接设备时,应该会从dmesg中看到如下消息:

[   93.985002] usb 4-1: UAS is blacklisted for this device, using usb-storage instead

从那以后我的机箱没有任何问题。


看来我也在Debian 9.4中遇到了这个问题4.14.18-sunxi64。:(
TCB13 '18年

修复了我内核中的问题:unix.stackexchange.com/a/441772/23085。看起来有些内核是usb-storage内置的,而不是作为模块加载的,过程略有不同。
TCB13

1
虽然这种降低性能的骇人听闻技巧适用于每台机器,但确实可以使机箱基本正常工作,但它仍然是必须降低性能的骇人听闻的技巧,必须应用于每台机器。如果我启动Linux Live发行版,希望能够备份或恢复文件怎么办?这种骇客无法在那运作。那我应该向谁报告这个问题?我应该将其报告为Linux内核错误吗?我应该否定标榜与Linux兼容的机箱的负面评价?这是谁的错?
Boann

为我工作的地点是:174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb / s桥,ASM1053E SATA 6Gb / s桥,ASM1153 SATA 3Gb / s桥
Tyrell博士

1
@Boann从技术上讲,内核尝试与UAS协议一起使用的任何无法正常工作的设备都是损坏的硬件。除非硬件确实起作用,否则硬件不应宣传UAS支持。您仍然可以将此报告给Linux内核USB子系统维护者,该维护者列出了一些已知不良的硬件,如果进行特殊处理,这些硬件仍然可以使用。您还可以使用模块的quirks参数选择各种解决方法usb_storage-如果内核开发人员知道此问题,则将自动激活完全相同的操作。性能仍然会降低和/或缺少功能。
Mikko Rantalainen
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.