IT

Raspberry Pi 4B 用上SSD還是慢,奇怪

終於可以使用了。但用上SSD還是慢,奇怪。

先來重溫一下目前的配置:

工作中的 Banana Pi Pro (左)、RPi 4B(中)、及 ORICO 2.5”硬碟盒(右)
  • Raspberry Pi 4 Computer Model B 4GB RAM (brought from Element14)
  • 树莓派4B 铝合金散热外壳带双风扇
  • MicroHDMI to HDMI adaptor
  • SD-Slot: TOSHIBA 16GB SD-Card - UC-I Class10 30MB/s
  • USB3 Socket: ORICO 2.5” Enclosure (USB3 - SATA)
    • Intel 2.5" SSD - SSDSA2M080G2GC (Used for 8Yrs)

利用DietPi-Benchmark測試SSD,結果如下:

結果跟USB2 的外置HD差不多,失望

查找原因

據理解,USB3外接硬碟盒如果要作為高速傳送就要有UASP (USB Attached SCSI Protocol)加持(參考1),所以要檢查目前的狀態(參考:How can I check whether USB3.0 UASP (USB Attached SCSI Protocol) mode is enabled in Linux?)。

首先查看USB詳情:

root@badbuta-pi-center:~# lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
root@badbuta-pi-center:~# lsusb
Bus 002 Device 002: ID 357d:7788 Sharkoon QuickPort XT
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@badbuta-pi-center:~# lsusb -v -s 2:2

Bus 002 Device 002: ID 357d:7788 Sharkoon QuickPort XT
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         9
  idVendor           0x357d Sharkoon
  idProduct          0x7788 QuickPort XT
  bcdDevice            0.00
  iManufacturer          10 JMicron
  iProduct               11 USB to ATA/ATAPI Bridge
  iSerial                 3 000012345678
  bNumConfigurations      1
...

ORICO硬碟盒的晶片識別為 ID 357d:7788 Sharkoon QuickPort XT,JMicron 的USB to ATA/ATAPI Bridge

看看interface:

root@badbuta-pi-center:~# lsusb -v -d 357d:7788 | grep -i interface
    bNumInterfaces          1
    Interface Descriptor:
      bInterfaceNumber        0
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
    Interface Descriptor:
      bInterfaceNumber        0
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     98
      iInterface              0

"bInterfaceProtocol 98" 代表這個裝置是支持UASP的。

記得早前為了能使用這個盒子所以在修改了/boot/cmdline.txt,不修正的話RPI4B就辯認不到,用不了。

usb-storage.quirks=357d:7788:u console=tty1 rootdelay=10 root=PARTUUID=7235a13a-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet net.ifnames=0

"usb-storage.quirks=xxxx:yyyy:u" 就是利用quirks修正,看來是因為這個了。利用 dmesg 查看UAS:

root@badbuta-pi-center:~# dmesg | grep "usb"
...
[    2.057052] usb 2-2: New USB device found, idVendor=357d, idProduct=7788, bcdDevice= 0.00
[    2.057058] usb 2-2: New USB device strings: Mfr=10, Product=11, SerialNumber=3
[    2.057063] usb 2-2: Product: USB to ATA/ATAPI Bridge
[    2.057068] usb 2-2: Manufacturer: JMicron
[    2.057072] usb 2-2: SerialNumber: 000012345678
[    2.059043] usb 2-2: UAS is blacklisted for this device, using usb-storage instead
[    2.059082] usb 2-2: UAS is blacklisted for this device, using usb-storage instead
[    2.059087] usb-storage 2-2:1.0: USB Mass Storage device detected
[    2.059272] usb-storage 2-2:1.0: Quirks match for vid 357d pid 7788: 800000
[    2.059324] scsi host0: usb-storage 2-2:1.0

"usb 2-2: UAS is blacklisted for this device, using usb-storage instead" 就是說不用UAS,只用半雙工的usb-storage。

暫時找不到方法,要不用回 Unitek 的盒子,但怕又會弄死一隻SSD,要不另買一個。但當看到Orico 所用晶片的序號時,我想暫時不會再考慮了。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *