未在 USB 3 上检测到 Raspberry Pi 4 debian HDD,但可在 USB2 上运行

Respberry Pi 4 debian HDD not detected on USB3 but works on USB2

我有一个全新的 Raspberri Pi 4,在 SD 上加载了 NextCloudPi_11-27-20 映像,它似乎可以完美启动和运行。系统信息告诉我发行版是:Debian GNU/Linux10 \n\l
我是一个 linux 菜鸟,但认为 debian 导致了以下问题。

我有一个 4tb 硬盘驱动器,USB3.0 外壳 (DELOCK 42613) 应该支持 UASP
如果我将 HDD 连接到 USB3,它不会显示在 sudo fdisk -l 如果我连接到 USB2,它工作正常。

我可以从哪里开始调查这个问题? 如何让它在 USB3.0 端口上工作?

编辑 2020-12-14 17:05: sudo dmesg输出(部分,字符限制30000):

pi@nextcloudpi:~ $ sudo dmesg
[ 1423.007653] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1423.020119] scsi host0: uas
[ 1423.026589] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0508 PQ                                                                                                                                                             : 0 ANSI: 6
[ 1423.027759] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1423.029003] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3.                                                                                                                                                             64 TiB)
[ 1423.029017] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1423.029705] sd 0:0:0:0: [sda] Write Protect is off
[ 1423.029720] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 1423.030162] sd 0:0:0:0: [sda] Disabling FUA
[ 1423.030175] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does                                                                                                                                                             n't support DPO or FUA
[ 1423.031003] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a mult                                                                                                                                                             iple of physical block size (4096 bytes)
[ 1423.060421]  sda: sda1
[ 1423.063607] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1423.243629] BTRFS info (device sda1): disk space caching is enabled
[ 1423.243638] BTRFS info (device sda1): has skinny extents
[ 1429.361794] usb 2-2: USB disconnect, device number 6
[ 1429.364055] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1429.410539] btrfs_dev_stat_print_on_error: 17 callbacks suppressed
[ 1429.410558] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 1, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.410641] BTRFS error (device sda1): error reading free space cache
[ 1429.410661] BTRFS warning (device sda1): failed to load free space cache for                                                                                                                                                              block group 30408704, rebuilding it now
[ 1429.413058] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 2, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.413142] BTRFS error (device sda1): error reading free space cache
[ 1429.413161] BTRFS warning (device sda1): failed to load free space cache for                                                                                                                                                              block group 1104150528, rebuilding it now
[ 1429.413300] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 3, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.413389] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 4, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.413528] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 5, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.414158] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 6, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.417529] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 7, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.419569] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 8, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.419721] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 9, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1429.422261] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 10, flus                                                                                                                                                             h 0, corrupt 0, gen 0
[ 1429.434640] BTRFS: error (device sda1) in btrfs_commit_transaction:2280: errn                                                                                                                                                             o=-5 IO failure (Error while writing out transaction)
[ 1429.434694] BTRFS info (device sda1): forced readonly
[ 1429.434865] BTRFS warning (device sda1): Skipping commit of aborted transacti                                                                                                                                                             on.
[ 1429.434964] BTRFS: error (device sda1) in cleanup_transaction:1832: errno=-5                                                                                                                                                              IO failure
[ 1429.435003] BTRFS info (device sda1): delayed_refs has NO entry
[ 1429.435065] BTRFS error (device sda1): commit super ret -5
[ 1429.609779] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=                                                                                                                                                             0x07 driverbyte=0x00
[ 1429.934124] usb 2-2: new SuperSpeed Gen 1 USB device number 7 using xhci_hcd
[ 1429.955630] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcd                                                                                                                                                             Device= 5.08
[ 1429.955638] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1429.955643] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1429.955648] usb 2-2: Manufacturer: JMicron
[ 1429.955653] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1429.963062] scsi host0: uas
[ 1429.964088] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0508 PQ                                                                                                                                                             : 0 ANSI: 6
[ 1429.964904] scsi 0:0:0:0: Attached scsi generic sg0 type 0
[ 1429.967036] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3.                                                                                                                                                             64 TiB)
[ 1429.967045] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1429.967258] sd 0:0:0:0: [sda] Write Protect is off
[ 1429.967265] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 1429.971214] sd 0:0:0:0: [sda] Disabling FUA
[ 1429.971224] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does                                                                                                                                                             n't support DPO or FUA
[ 1429.972135] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a mult                                                                                                                                                             iple of physical block size (4096 bytes)
[ 1429.999874]  sda: sda1
[ 1430.002411] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1430.137855] BTRFS info (device sda1): disk space caching is enabled
[ 1430.137863] BTRFS info (device sda1): has skinny extents
[ 1431.729784] usb 2-2: USB disconnect, device number 7
[ 1431.735147] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1431.751329] BTRFS error (device sda1): error reading free space cache
[ 1431.751341] BTRFS warning (device sda1): failed to load free space cache for                                                                                                                                                              block group 30408704, rebuilding it now
[ 1431.752415] BTRFS error (device sda1): error reading free space cache
[ 1431.752426] BTRFS warning (device sda1): failed to load free space cache for                                                                                                                                                              block group 1104150528, rebuilding it now
[ 1431.764016] BTRFS: error (device sda1) in btrfs_commit_transaction:2280: errn                                                                                                                                                             o=-5 IO failure (Error while writing out transaction)
[ 1431.764042] BTRFS info (device sda1): forced readonly
[ 1431.764050] BTRFS warning (device sda1): Skipping commit of aborted transacti                                                                                                                                                             on.
[ 1431.764056] BTRFS: error (device sda1) in cleanup_transaction:1832: errno=-5                                                                                                                                                              IO failure
[ 1431.764070] BTRFS info (device sda1): delayed_refs has NO entry
[ 1431.764095] BTRFS error (device sda1): commit super ret -5
[ 1431.973817] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=                                                                                                                                                             0x07 driverbyte=0x00
[ 1432.298081] usb 2-2: new SuperSpeed Gen 1 USB device number 8 using xhci_hcd
[ 1432.319407] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcd                                                                                                                                                             Device= 5.08
[ 1432.319415] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1432.319420] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1432.319425] usb 2-2: Manufacturer: JMicron
[ 1432.319429] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1432.326883] scsi host0: uas
[ 1432.327907] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0508 PQ                                                                                                                                                             : 0 ANSI: 6
[ 1432.328999] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1432.329458] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3.                                                                                                                                                             64 TiB)
[ 1432.329465] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1432.329658] sd 0:0:0:0: [sda] Write Protect is off
[ 1432.329664] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 1432.330349] sd 0:0:0:0: [sda] Disabling FUA
[ 1432.330358] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does                                                                                                                                                             n't support DPO or FUA
[ 1432.331041] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a mult                                                                                                                                                             iple of physical block size (4096 bytes)
[ 1432.367646]  sda: sda1
[ 1432.370047] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1432.507942] BTRFS info (device sda1): disk space caching is enabled
[ 1432.507950] BTRFS info (device sda1): has skinny extents
[ 1461.210242] usb 2-2: USB disconnect, device number 8
[ 1461.212707] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1461.261515] btrfs_dev_stat_print_on_error: 44 callbacks suppressed
[ 1461.261529] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 1, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.261584] BTRFS error (device sda1): error reading free space cache
[ 1461.261597] BTRFS warning (device sda1): failed to load free space cache for                                                                                                                                                              block group 30408704, rebuilding it now
[ 1461.263394] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 2, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.263451] BTRFS error (device sda1): error reading free space cache
[ 1461.263464] BTRFS warning (device sda1): failed to load free space cache for                                                                                                                                                              block group 1104150528, rebuilding it now
[ 1461.263572] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 3, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.263632] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 4, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.263727] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 5, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.264137] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 6, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.265950] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 7, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.267334] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 8, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.267450] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 9, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1461.268909] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 10, flus                                                                                                                                                             h 0, corrupt 0, gen 0
[ 1461.276797] BTRFS: error (device sda1) in btrfs_commit_transaction:2280: errn                                                                                                                                                             o=-5 IO failure (Error while writing out transaction)
[ 1461.276837] BTRFS info (device sda1): forced readonly
[ 1461.276849] BTRFS warning (device sda1): Skipping commit of aborted transacti                                                                                                                                                             on.
[ 1461.276860] BTRFS: error (device sda1) in cleanup_transaction:1832: errno=-5                                                                                                                                                              IO failure
[ 1461.276882] BTRFS info (device sda1): delayed_refs has NO entry
[ 1461.276925] BTRFS error (device sda1): commit super ret -5
[ 1461.450357] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=                                                                                                                                                             0x07 driverbyte=0x00
[ 1461.778707] usb 2-2: new SuperSpeed Gen 1 USB device number 9 using xhci_hcd
[ 1461.800117] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcd                                                                                                                                                             Device= 5.08
[ 1461.800136] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1461.800148] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1461.800159] usb 2-2: Manufacturer: JMicron
[ 1461.800170] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1461.817993] scsi host0: uas
[ 1461.819782] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0508 PQ                                                                                                                                                             : 0 ANSI: 6
[ 1461.821059] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1461.823080] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3.                                                                                                                                                             64 TiB)
[ 1461.823097] sd 0:0:0:0: [sda] 4096-byte physical blocks
[ 1461.823586] sd 0:0:0:0: [sda] Write Protect is off
[ 1461.823603] sd 0:0:0:0: [sda] Mode Sense: 53 00 00 08
[ 1461.824346] sd 0:0:0:0: [sda] Disabling FUA
[ 1461.824364] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, does                                                                                                                                                             n't support DPO or FUA
[ 1461.825347] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a mult                                                                                                                                                             iple of physical block size (4096 bytes)
[ 1461.858003]  sda: sda1
[ 1461.861222] sd 0:0:0:0: [sda] Attached SCSI disk
[ 1462.037017] BTRFS info (device sda1): disk space caching is enabled
[ 1462.037025] BTRFS info (device sda1): has skinny extents
[ 1468.382334] usb 2-2: USB disconnect, device number 9
[ 1468.390236] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[ 1468.437584] btrfs_dev_stat_print_on_error: 17 callbacks suppressed
[ 1468.437603] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 1, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.437705] BTRFS error (device sda1): error reading free space cache
[ 1468.437724] BTRFS warning (device sda1): failed to load free space cache for                                                                                                                                                              block group 30408704, rebuilding it now
[ 1468.440437] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 2, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.440526] BTRFS error (device sda1): error reading free space cache
[ 1468.440544] BTRFS warning (device sda1): failed to load free space cache for                                                                                                                                                              block group 1104150528, rebuilding it now
[ 1468.440706] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 3, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.440801] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 4, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.440943] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 5, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.441490] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 6, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.441599] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 7, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.443710] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 8, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.443844] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 9, flush                                                                                                                                                              0, corrupt 0, gen 0
[ 1468.446474] BTRFS error (device sda1): bdev /dev/sda1 errs: wr 0, rd 10, flus                                                                                                                                                             h 0, corrupt 0, gen 0
[ 1468.453787] BTRFS: error (device sda1) in btrfs_commit_transaction:2280: errn                                                                                                                                                             o=-5 IO failure (Error while writing out transaction)
[ 1468.453843] BTRFS info (device sda1): forced readonly
[ 1468.453861] BTRFS warning (device sda1): Skipping commit of aborted transacti                                                                                                                                                             on.
[ 1468.453877] BTRFS: error (device sda1) in cleanup_transaction:1832: errno=-5                                                                                                                                                              IO failure
[ 1468.453910] BTRFS info (device sda1): delayed_refs has NO entry
[ 1468.454426] BTRFS error (device sda1): commit super ret -5
[ 1468.650318] sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=                                                                                                                                                             0x07 driverbyte=0x00
[ 1468.978696] usb 2-2: new SuperSpeed Gen 1 USB device number 10 using xhci_hcd
[ 1468.999948] usb 2-2: New USB device found, idVendor=152d, idProduct=0578, bcd                                                                                                                                                             Device= 5.08
[ 1468.999957] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1468.999962] usb 2-2: Product: USB to ATA/ATAPI Bridge
[ 1468.999967] usb 2-2: Manufacturer: JMicron
[ 1468.999972] usb 2-2: SerialNumber: 0123456789ABCDEF
[ 1469.007193] scsi host0: uas
[ 1469.008256] scsi 0:0:0:0: Direct-Access     JMicron  Generic          0508 PQ                                                                                                                                                             : 0 ANSI: 6
[ 1469.009373] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 1469.009815] sd 0:0:0:0: [sda] 7814035055 512-byte logical blocks: (4.00 TB/3.                                                                                                                                                             

显然这是一个已知问题: STICKY: If you have a Raspberry Pi 4 and are getting bad speeds transferring data to/from USB3.0 SSDs, read this
如果在 SO

上有类似的问题,我不会感到惊讶

简而言之:与 USB 和 UAS 的 SATA 适配器中的芯片有关。 (如果我没记错的话)
请转到上面的 link 查看完整故事。快速解决方案:

  • 通过断开适配器获取 idVendor=xxxx 和 idProduct=xxxx,运行 sudo dmesg -C,重新连接并 运行 dmesg
  • sudo nano /boot/cmdline.txt 并在参数行的开头添加 'usb-storage.quirks=[idVendor]:[idProduct]:u'
  • 在我的例子中,从我问题中的代码片段来看,它看起来像这样 usb-storage.quirks=152d:0578:u
  • 重启
  • 检查 dmesg | grep usb-storage,您应该会看到类似这样的内容:
[    2.495725] usb 2-1: UAS is blacklisted for this device, using usb-storage instead
[    2.512739] usb 2-1: UAS is blacklisted for this device, using usb-storage instead
[    2.531823] usb-storage 2-1:1.0: USB Mass Storage device detected
[    2.549642] usb-storage 2-1:1.0: Quirks match for vid 2109 pid 0715: 800000
[    2.566177] scsi host0: usb-storage 2-1:1.0