Fixing USB Drive Disconnections on Raspberry Pi 4 with Bookworm Update

If you’re using a Raspberry Pi 4 Model B with 8GB RAM with Argon ONE V2 M.2 Expansion Board (NVME), running Raspbian (now upgraded to Debian Bookworm) with OMW (Open Media Vault), you might have faced frustrating USB drive disconnections after updating. This issue can occur especially when using external storage devices like a 2TB Kingston NVMe drive or a 4TB WD USB 3.2 external drive. While the Raspberry Pi worked fine for months or even a year before the update, these disconnections may arise due to a buggy UAS (USB Attached SCSI) driver, particularly when paired with ASMedia controllers.

For those who haven’t updated the firmware of the Argon ONE V2 M.2 Expansion Board check this how to corect the firmware bug: https://www.martinrowan.co.uk/2023/02/argon-one-nvme-board-fixed/

Here’s the story of how I solved the issue after several hours of troubleshooting, and how you can fix it too. Also this can work with any version of  Raspberry Pi 4.

The Problem:

After updating to Debian Bookworm, my external drives began disconnecting after some time or under heavy use. Initially, I suspected it was a power supply issue. However, I had been using the official Raspberry Pi power supply, and the issue didn’t exist before the update. After further research, I discovered the problem was related to the UAS driver, which doesn’t play well with ASMedia controllers.

The Solution:

To fix the problem, you need to disable the UAS driver and enable the older usb-storage driver for your device. Here’s how you can do it.

Step-by-Step Solution:

1. Check if UAS is active:

First, you need to verify if the UAS driver is enabled for your device. Open a terminal and run the following command:

lsusb -t

Look for a line that shows uas in the output. If you see it, then UAS is enabled for your device.

2. Edit the Boot Configuration:

To disable the UAS driver, you will need to edit the boot configuration file. Open the file for editing with this command:

sudo nano /boot/cmdline.txt

This file contains the boot parameters. After the last word in the file (without any spaces), add the following:

usb-storage.quirks=174c:2362:u

It should look like this in the file:

console=tty1 root=PARTUUID=68cab3f9-02 rootfstype=ext4 fsck.repair=yes rootwait usb-storage.quirks=174c:2362:u

This command will disable the UAS driver and enable the older usb-storage driver for your external drive. The 174c:2362 is the device’s ID, and you need to replace it with the appropriate ID for your specific device.

3. Find Your Device ID:

To find the ID of your device, run the following command:

lsusb

This will display a list of connected USB devices. Find the line corresponding to your external drive, and note the ID (in the format 174c:2362 or something similar).

4. Reboot Your Raspberry Pi:

Once you’ve added the usb-storage.quirks line with the correct ID, save the file and reboot your Raspberry Pi:

sudo reboot

5. Verify the Changes:

After rebooting, check if the usb-storage driver is now active. Run the lsusb -t command again. If everything went correctly, you should now see that your external drive is using the usb-storage driver instead of UAS.

Conclusion:

That’s it! The issue should now be resolved, and your external drives should no longer disconnect after prolonged use or heavy activity. The fix disables the UAS driver and forces the system to use the more stable usb-storage driver, which works better with ASMedia controllersalso the speed was better now.

For more details and a broader discussion about this issue, feel free to check out the Raspberry Pi forums.

Disclaimer: Proceed at your own risk. Improper execution may cause issues or even break your OS. Ensure you fully understand the process before attempting it.

Happy computing with your Raspberry Pi 4!

Lasă un răspuns

Adresa ta de email nu va fi publicată. Câmpurile obligatorii sunt marcate cu *

Acest site folosește Akismet pentru a reduce spamul. Află cum sunt procesate datele comentariilor tale.