Linux

Odroid XU4:在 USB 3.0 上 10 分鐘後硬碟當機

  • April 11, 2018

我最近通過 USB 3.0 擴展塢將 3 TB 硬碟連接到我的 Odroid XU4。它被正確檢測到,我安裝了它。

但是在寫了大約 10 GB 的數據後,我遇到了很多錯誤。我的 /var/log/syslog 看起來像這樣:

odroid kernel: [410867.640870] usb 4-1.2: new SuperSpeed USB device number 3 using xhci-hcd
odroid kernel: [410867.662186] usb 4-1.2: New USB device found, idVendor=067b, idProduct=2773
odroid kernel: [410867.662217] usb 4-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
odroid kernel: [410867.662240] usb 4-1.2: Product: Quickport Combo U3
odroid kernel: [410867.662262] usb 4-1.2: Manufacturer: SHARKOON
odroid kernel: [410867.662283] usb 4-1.2: SerialNumber: SHARK000000002
odroid kernel: [410867.666319] usb-storage 4-1.2:1.0: USB Mass Storage device detected
odroid kernel: [410867.672956] scsi host0: usb-storage 4-1.2:1.0
odroid mtp-probe: checking bus 4, device 3: "/sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2"
odroid mtp-probe: bus: 4, device: 3 was not an MTP device
odroid kernel: [410867.773185] usbcore: registered new interface driver uas
odroid kernel: [410868.753587] scsi 0:0:0:0: Direct-Access     ST3000DM 001-1CH166       CC29 PQ: 0 ANSI: 0
odroid kernel: [410868.758912] sd 0:0:0:0: [sda] Very big device. Trying to use READ CAPACITY(16).
odroid kernel: [410868.759096] sd 0:0:0:0: Attached scsi generic sg0 type 0
odroid kernel: [410868.760501] sd 0:0:0:0: [sda] 5860533168 512-byte logical blocks: (3.00 TB/2.73 TiB)
odroid kernel: [410868.761937] sd 0:0:0:0: [sda] Write Protect is off
odroid kernel: [410868.762049] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
odroid kernel: [410868.763561] sd 0:0:0:0: [sda] No Caching mode page found
odroid kernel: [410868.767656] sd 0:0:0:0: [sda] Assuming drive cache: write through
odroid kernel: [410868.777812] sd 0:0:0:0: [sda] Very big device. Trying to use READ CAPACITY(16).
odroid kernel: [410868.847735]  sda: sda1 sda2 sda3
odroid kernel: [410868.861331] sd 0:0:0:0: [sda] Very big device. Trying to use READ CAPACITY(16).
odroid kernel: [410868.865234] sd 0:0:0:0: [sda] Attached SCSI disk
odroid systemd[1]: dev-disk-by\x2dpartlabel-Basic\x5cx20data\x5cx20partition.device: Dev dev-disk-by\x2dpartlabel-Basic\x5cx20data\x5cx20partition.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda2
odroid systemd[944]: dev-disk-by\x2dpartlabel-Basic\x5cx20data\x5cx20partition.device: Dev dev-disk-by\x2dpartlabel-Basic\x5cx20data\x5cx20partition.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda3 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda2
odroid systemd[20118]: dev-disk-by\x2dpartlabel-Basic\x5cx20data\x5cx20partition.device: Dev dev-disk-by\x2dpartlabel-Basic\x5cx20data\x5cx20partition.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda2 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda3
odroid kernel: [411003.006383] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
odroid systemd[20118]: dev-disk-by\x2dpartlabel-Basic\x5cx20data\x5cx20partition.device: Dev dev-disk-by\x2dpartlabel-Basic\x5cx20data\x5cx20partition.device appeared twice with different sysfs paths /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda2 and /sys/devices/platform/soc:/soc:usb3-0:/12000000.dwc3:/xhci-hcd.2.auto/usb4/4-1/4-1.2/4-1.2:1.0/host0/target0:0:0/0:0:0:0/block/sda/sda3
odroid kernel: [411443.428924] usb 4-1.2: reset SuperSpeed USB device number 3 using xhci-hcd
odroid kernel: [411443.449604] usb 4-1.2: device firmware changed
odroid kernel: [411444.469255] usb 4-1-port2: cannot disable (err = -110)
odroid kernel: [411444.569096] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
odroid kernel: [411444.569151] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x88 88 00 00 00 00 00 01 c4 13 00 00 00 01 00 00 00
odroid kernel: [411444.569188] blk_update_request: I/O error, dev sda, sector 29627136
odroid kernel: [411444.673957] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
odroid kernel: [411444.673993] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x88 88 00 00 00 00 00 b0 13 88 00 00 00 00 08 00 00
odroid kernel: [411444.674017] blk_update_request: I/O error, dev sda, sector 2954070016
odroid kernel: [411444.679304] EXT4-fs error (device sda3): ext4_wait_block_bitmap:503: comm kworker/u16:0: Cannot read block bitmap - block_group = 96, block_bitmap = 3145728
odroid kernel: [411444.770110] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
odroid kernel: [411444.770145] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x8a 8a 00 00 00 00 00 b0 13 48 00 00 00 08 00 00 00
odroid kernel: [411444.770169] blk_update_request: I/O error, dev sda, sector 2954053632
odroid kernel: [411444.775389] EXT4-fs warning (device sda3): ext4_end_bio:314: I/O error -5 writing to inode 122 (offset 0 size 8388608 starting block 369256960)
odroid kernel: [411444.775430] Buffer I/O error on device sda3, logical block 3143680
odroid kernel: [411444.781543] Buffer I/O error on device sda3, logical block 3143681
odroid kernel: [411444.787798] Buffer I/O error on device sda3, logical block 3143682
odroid kernel: [411444.794033] Buffer I/O error on device sda3, logical block 3143683
odroid kernel: [411444.800266] Buffer I/O error on device sda3, logical block 3143684
odroid kernel: [411444.806506] Buffer I/O error on device sda3, logical block 3143685
odroid kernel: [411444.812743] Buffer I/O error on device sda3, logical block 3143686
odroid kernel: [411444.818985] Buffer I/O error on device sda3, logical block 3143687
odroid kernel: [411444.825237] Buffer I/O error on device sda3, logical block 3143688
odroid kernel: [411444.831461] Buffer I/O error on device sda3, logical block 3143689
odroid kernel: [411444.928916] sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x07 driverbyte=0x00
odroid kernel: [411444.928946] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x8a 8a 00 00 00 00 00 ae 93 88 00 00 00 00 08 00 00
odroid kernel: [411444.928965] blk_update_request: I/O error, dev sda, sector 2928904192
odroid kernel: [411444.934145] Buffer I/O error on dev sda3, logical block 0, lost sync page write
odroid kernel: [411444.941579] EXT4-fs (sda3): Delayed block allocation failed for inode 122 at logical offset 2048 with max blocks 2048 with error 5
odroid kernel: [411444.953239] EXT4-fs (sda3): This should not happen!! Data will be lost

它被解除安裝,我無法再次安裝它。我必須斷開 USB 電纜並重新連接。

所以我檢查了SMART …沒有發現錯誤。事實證明,USB 2.0 可以正常工作。現在複製數據幾個小時沒有錯誤。我在 USB 3.0 上嘗試了不同的 HDD,得到了類似的結果。寫了一段時間就斷網了。

有任何想法嗎?

它可能與 UAS(USB Attached SCSI)模式有關。它僅從 USB 3.0 開始正式提供,因此這可以解釋為什麼 USB 2.0 可以正常工作(未選擇 UAS)。

該問題通常與適配器上可能實施不當的韌體有關,或者與 Linux 驅動程序通信中的互操作性問題有關。硬體/韌體供應商製造的商業驅動程序可能對這些錯誤進行特殊處理,因為供應商知道它們。

如果無法解決問題,有時可以通過禁用某些功能來解決問題。在 Linux 上,至少有 5 個 USB 儲存怪癖標誌來手動禁用 UAS 功能(f、g、j、t、u)。當模型被明確辨識為行為不良時,它們會被添加到內部黑名單中以自動應用這些怪癖。您必須手動添加引導選項或 USB 儲存模組選項。

因此,首先嘗試使用 quirk u 完全禁用 UAS,看看是否能解決問題。稍後看看是否例如使用 t 或 g 選項而不是 u 可能就足夠了。

核心 cmdline 引導選項(使用日誌中的 VID:PID):

usb-storage.quirks=067b:2773:u

模組選項(在 /etc/modprobe.d 中創建一個文件):

options usb-storage quirks=067b:2773:u

UAS 提供的成本更少,否則這應該不是問題。

您應該嘗試使用來自其他供應商的不同適配器(不同 VID)的相同 HDD,以真正查看 UAS 模式下的行為是否存在差異。

引用自:https://unix.stackexchange.com/questions/437036