Work around a flaky USB/SD disk: usb-storage and sdhci quirks
Disable UAS for a USB disk with usb-storage.quirks and reload sdhci with a quirk flag.
Some USB-attached SSDs and SD/eMMC controllers misbehave on Linux (disk not mounted, I/O errors). Kernel quirks can work around it.
SD/eMMC controller (sdhci)
Reload the sdhci modules with a debug quirk flag:
rmmod sdhci_pci
rmmod sdhci
modprobe sdhci debug_quirks2="0x80000000"
modprobe sdhci_pci
USB disk on Raspberry Pi: disable UAS
Some USB-SATA bridges are unstable with the UAS driver. Forcing the plain usb-storage driver fixes it.
-
Clear the kernel log, plug in the disk, and read its vendor and product ids:
sudo dmesg -Cusb 2-1: New USB device found, idVendor=2109, idProduct=0715, bcdDevice=a0.00 usb 2-1: SerialNumber: 0000000000 scsi host0: uas sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/112 GiB) -
Edit
/boot/cmdline.txtas root and add, at the start of the parameter line,usb-storage.quirks=aaaa:bbbb:u, whereaaaais the idVendor andbbbbthe idProduct. For the device above:usb-storage.quirks=2109:0715:uFor several devices, separate the
vid:pid:utriplets with commas:usb-storage.quirks=0123:4567:u,2109:0715:u. -
Reboot.
-
Check that the quirk is applied:
usb 2-1: UAS is blacklisted for this device, using usb-storage instead usb-storage 2-1:1.0: USB Mass Storage device detected usb-storage 2-1:1.0: Quirks match for vid 2109 pid 0715: 800000 scsi host0: usb-storage 2-1:1.0
Notes
- References: Arch Linux forum thread and Raspberry Pi forum thread.