Steve mitchell in Side notes 4 minutes

How to bind to the right USB storage driver

The article How to Configure Raspbian Linux discussed using the usb-storage.quirks parameter to bind to the right storage manager. This side note goes on to explain usb-storage.quirks in more detail.

Some posts I read about booting from SSD mentioned usb-storage.quirks. I began to worry that I had missed an important step. The issue is that in certain situations, the Linux “uas” storage driver disables SAT transfers. You can see which storage driver is in use with the lsusb command or dmesg command as shown below.

Checking the Storage Drive type with lsusb
Checking the Storage Drive type with lsusb
Checking the Storage Driver type using dmesg
Checking the Storage Driver type using dmesg

As you can see above, Raspbian uses the “uas” storage driver, not the older “usb_storage” driver. We need to keep the mSATA from binding to the uas storage driver with the usb-storage.quirks setting.

The usb-storage.quirks parameter, e.g. “usb-storage.quirks=045b:3483:u”, is documented on the Kernel Parameters page. It documents that the “u” on the end instructs the kernel NOT to bind that vendor and part to the uas storage driver, thus avoiding the compatibility problems.

u = IGNORE_UAS (don’t bind to the uas driver)

All you have to do is figure out the vendor and part number to use. To learn that, and a lot more, about your Raspberry Pi, you can install hwinfo.

1
2
sudo apt-get install hwinfo
hwinfo --scsi

The output shows my INDMEM mSATA is bound to the “uas” storage driver, but Vendor and Device are not hexadecimal numbers. To get those, I had to find my USB to mSATA converter.

mSATA attached to uas Storage Driver (which is not what we want)
mSATA attached to uas Storage Driver (which is not what we want)

I ran the hwinfo specifying “–all” and then I searched for “mSATA.” I found the renkforce mSATA Adapter.

1
hwinfo --all
USB to mSATA Converter
USB to mSATA Converter

To verify that was what I needed, I went over to the Linux USB Id directory, http://www.linux-usb.org/usb.ids, and looked up “renkforce”.

Vendor and Part from http://www.linux-usb.org/usb.ids
Vendor and Part from http://www.linux-usb.org/usb.ids

Feeling confident that I had the correct information, I made a backup of /boot/cmdline.txt, and then added the usb-storage.quirks parameter.

console=serial0,115200 console=tty1 root=/dev/sda rootfstype=ext4 elevator=deadline fsck.repair=yes rootwai usb-storage.quirks=045b:0229:u

After rebooting, I used hwinfo again to verify that the change had worked.

The Drive Module is now usb_storage instead of uas
The Drive Module is now usb_storage instead of uas

Alternatively, I could have verified it worked with the lsusb command:

The Drive Module is now usb_storage instead of uas
The Drive Module is now usb_storage instead of uas

That’s it. You should now avoid any USB SATA compatibility issues caused by the “uas” storage driver.


References