How to disable USB Attached Storage (UAS): Difference between revisions
Created page with "USB Attached Storage (UAS) is now commonly found for USB 3.0 storage devices. However, this sometimes causes issues with non-compliant adapters requiring it to be disabled. Is..." |
|||
| Line 1: | Line 1: | ||
USB Attached Storage (UAS) is now commonly found for USB 3.0 storage devices. However, this sometimes causes issues with non-compliant adapters requiring it to be disabled. Issues with having UAS enabled include slow write performance, or having the device randomly drop off until the USB connection is reset. | USB Attached Storage (UAS) is now commonly found for USB 3.0 storage devices. However, this sometimes causes issues with non-compliant adapters requiring it to be disabled. Issues with having UAS enabled include slow write performance, or having the device randomly drop off until the USB connection is reset. | ||
=== Finding the USB device ID === | ===Finding the USB device ID=== | ||
To disable UAS for a specific USB device, find the USB device associated with the drive. This can be accomplished by either reviewing the <code>dmesg</code> kernel logs or using <code>lsusb</code>. For example, this Seagate expansion drive has the device ID <code>0bc2:3343</code>: | To disable UAS for a specific USB device, find the USB device associated with the drive. This can be accomplished by either reviewing the <code>dmesg</code> kernel logs or using <code>lsusb</code>. For example, this Seagate expansion drive has the device ID <code>0bc2:3343</code>: | ||
{{Highlight | {{Highlight | ||
| Line 9: | Line 9: | ||
}} | }} | ||
=== Disabling UAS === | ===Disabling UAS=== | ||
After knowing the device ID, there are three ways to disable UAS. | After knowing the device ID, there are three ways to disable UAS. In all three ways, the idea is to pass in a <code>quirk</code> parameter to the <code>usb_storage</code> kernel module, telling the module to not use UAS for a specific device. This is done by passing in the USB device ID followed by the <code>u</code> flag.. Other flags that you can use can be found by looking at the kernel source code at https://github.com/torvalds/linux/blob/master/drivers/usb/storage/usb.c#L568. | ||
==== Manually reload the kernel module (temporary) ==== | ====Manually reload the kernel module (temporary)==== | ||
'''A temporary solution''': Temporarily reload the usb-storage kernel module with the quirks. | '''A temporary solution''': Temporarily reload the usb-storage kernel module with the quirks. | ||
| Line 26: | Line 26: | ||
}} | }} | ||
==== Disable permanently with modprobe.d ==== | ====Disable permanently with modprobe.d==== | ||
Create a new file in <code>/etc/modprobe.d/disable-uas.conf</code> with the following contents: | Create a new file in <code>/etc/modprobe.d/disable-uas.conf</code> with the following contents: | ||
{{Highlight | {{Highlight | ||
| code = usb-storage quirks=0bc2:3322:u | | code = options usb-storage quirks=0bc2:3322:u | ||
| lang = text | | lang = text | ||
}} | }} | ||
Reboot the machine. When the kernel module is loaded again, it should be aware of the quirk. | Reboot the machine. When the kernel module is loaded again, it should be aware of the quirk. | ||
==== Disable permanently with kernel cmdline arguments ==== | ====Disable permanently with kernel cmdline arguments==== | ||
Change your bootloader so that the quirk values are passed to the kernel. | Change your bootloader so that the quirk values are passed to the kernel. | ||
Revision as of 03:54, 2 December 2020
USB Attached Storage (UAS) is now commonly found for USB 3.0 storage devices. However, this sometimes causes issues with non-compliant adapters requiring it to be disabled. Issues with having UAS enabled include slow write performance, or having the device randomly drop off until the USB connection is reset.
Finding the USB device ID
To disable UAS for a specific USB device, find the USB device associated with the drive. This can be accomplished by either reviewing the dmesg kernel logs or using lsusb. For example, this Seagate expansion drive has the device ID 0bc2:3343:
# lsusb
Bus 004 Device 002: ID 0bc2:3343 Seagate RSS LLC Desktop
Disabling UAS
After knowing the device ID, there are three ways to disable UAS. In all three ways, the idea is to pass in a quirk parameter to the usb_storage kernel module, telling the module to not use UAS for a specific device. This is done by passing in the USB device ID followed by the u flag.. Other flags that you can use can be found by looking at the kernel source code at https://github.com/torvalds/linux/blob/master/drivers/usb/storage/usb.c#L568.
Manually reload the kernel module (temporary)
A temporary solution: Temporarily reload the usb-storage kernel module with the quirks.
Unload the usb-storage kernel module and re-load it with a quirk parameter specifying which device to not enable UAS on.
# lsusb
Bus 002 Device 005: ID 0bc2:3343 Seagate RSS LLC
# rmmod usb-storage
# modprobe usb-storage quirks=0bc2:3343:u
Re-attach the USB device again. This time, dmesg should say that a quirk was detected for this device:
[947347.271519] usb 2-3.2: New USB device found, idVendor=0bc2, idProduct=3343, bcdDevice= 1.00
[947955.635329] usb-storage 2-3.2:1.0: Quirks match for vid 0bc2 pid 3343: 800000
Disable permanently with modprobe.d
Create a new file in /etc/modprobe.d/disable-uas.conf with the following contents:
options usb-storage quirks=0bc2:3322:u
Reboot the machine. When the kernel module is loaded again, it should be aware of the quirk.
Disable permanently with kernel cmdline arguments
Change your bootloader so that the quirk values are passed to the kernel.
Edit /etc/default/grub and add the following to GRUB_CMDLINE_LINUX:
usb-storage.quirks=0bc2:3322:u
Rebuild the grub configs with grub2-mkconfig -o /boot/grub2/grub.cfg and reboot.