Transferring large 4GB file over network causing repeated USB resets

I have a SATA hdd (adequate power supply) plugged into USB port 3. I have it mounted as an NFS share, using the potato as a server. When I try to transfer a large 4GB video file to a client, dmesg produces the following output:

[ 8874.854537] usb 1-2: cmd cmplt err -2

[ 8874.991677] usb 1-2: reset high-speed USB device number 3 using xhci-hcd

[ 8875.146702] scsi host0: uas_eh_device_reset_handler success

[ 8879.529943] mt7601u 1-1.3:1.0**: Warning: mt7601u_mcu_wait_resp retrying**

[ 8938.311972] sd 0:0:0:0: [sda] tag#1 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD

[ 8938.312005] sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x8a 8a 00 00 00 00 00 02 aa 76 38 00 00 02 08 00 00

[ 8969.035249] sd 0:0:0:0: [sda] tag#0 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD

[ 8969.035325] sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x35 35 00 00 00 00 00 00 00 00 00

[ 8969.055161] scsi host0: uas_eh_device_reset_handler start

[ 8969.055244] usb 1-2: cmd cmplt err -2

[ 8969.185041] usb 1-2: reset high-speed USB device number 3 using xhci-hcd

[ 8969.344985] scsi host0: uas_eh_device_reset_handler success

[ 9032.518005] sd 0:0:0:0: [sda] tag#12 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD

[ 9032.518189] sd 0:0:0:0: [sda] tag#12 CDB: opcode=0x8a 8a 00 00 00 00 00 02 ab 12 a0 00 00 02 08 00 00

[ 9063.233528] sd 0:0:0:0: [sda] tag#27 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD

[ 9063.233705] sd 0:0:0:0: [sda] tag#27 CDB: opcode=0x35 35 00 00 00 00 00 00 00 00 00

[ 9063.249141] scsi host0: uas_eh_device_reset_handler start

and, ofc, I’m also unable to transfer the file after a long time

This is an issue with the drive. complt err -2 means the drive did not respond within io_timeout. Either the controller needs a firmware update, the drive has IO errors, or a power issue.

Your first bet is to try disabling UAS. Second try it on another computer to see if you can duplicate the issue.

Smartctl wasn’t showing any issues with it — should I expect to see problems here?

When you mention the controller, what’s a good googling starting point? Western Digital HDD controller firmware?

I don’t have another Linux box, so I’m not sure how I could go about replicating it elsewhere

btrfs check output:

cakedayy@potato:~$ sudo btrfs check /dev/first_volume/first_logical_volume
Opening filesystem to check...
Checking filesystem on /dev/first_volume/first_logical_volume
UUID: 959dca44-ee55-4731-a510-4ac2b8665286
[1/7] checking root items
[2/7] checking extents
[3/7] checking free space tree
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups skipped (not enabled on this FS)
found 18964230144 bytes used, no error found
total csum bytes: 18494748
total tree bytes: 25608192
total fs tree bytes: 2408448
total extent tree bytes: 1015808
btree space waste bytes: 4191376
file data blocks allocated: 18938621952
referenced 18930692096

smartctl output…

cakedayy@potato:~$ sudo smartctl -a -d sat -H /dev/sda
smartctl 7.2 2020-12-30 r5155 [aarch64-linux-6.1.89-15498-gf9afb0b2911b] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Device Model:     WDC WD40EZAX-00C8UB0
Serial Number:    WD-WX52DC39W3NZ
LU WWN Device Id: 5 0014ee 2162bc74d
Firmware Version: 01.01A01
User Capacity:    4,000,787,030,016 bytes [4.00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5400 rpm
Form Factor:      3.5 inches
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Wed May  8 01:04:48 2024 UTC
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART Status not supported: Incomplete response, ATA output registers missing
SMART overall-health self-assessment test result: PASSED
Warning: This result is based on an Attribute check.

General SMART Values:
Offline data collection status:  (0x00)	Offline data collection activity
					was never started.
					Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever 
					been run.
Total time to complete Offline 
data collection: 		(41940) seconds.
Offline data collection
capabilities: 			 (0x7b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 ( 436) minutes.
Conveyance self-test routine
recommended polling time: 	 (   5) minutes.
SCT capabilities: 	       (0x3031)	SCT Status supported.
					SCT Feature Control supported.
					SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   206   206   021    Pre-fail  Always       -       2683
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       108
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       146
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       14
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       3
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       1666
194 Temperature_Celsius     0x0022   119   112   000    Old_age   Always       -       28
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   100   253   000    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.


Looks like no issues…

Do you have the full dmesg log? It looks like the MT7601U could not get a response as well meaning something is hanging on the USB bus since two devices seem to have issues. Also provide a picture of your setup.

How many times have you tried the copy?

first one at around:
[ 2706.416822]

power details from left to right-ish:
4TB WD blue hdd – this SATA adapter – power (to hdd) directly from 12V 5A supply (via 4-way splitter) – 5V step down to power potato – potato

Test this on a PC as this is your most likely culprit.

ty for the pointers – is there a reliable way to go for these kinds of adapters and the USB 2.0 on the potato?

You can use USB 3 ones. It is backwards compatible. Buy the first non-sponsored result should be OK.