Article 6NNC6 USB disconnected, device offline

USB disconnected, device offline

by
celexa
from LinuxQuestions.org on (#6NNC6)
Hello,

I am not very good when it comes to linux and I really need help with an issue that bugs me for some time already.

I have an intel nuc on Ubuntu 22.04.4 with nvme storage on it, attached to USB i have 1x 2.5 Toshiba hard drive 1TB in an enclosure and to another USB port I have a Seagate 6TB expansion.

Every 1-12 hours, the USB for the Toshiba external enclosure gets randomly disconnected. That's what I'm trying to fix or understand why it happens.

Running journalctl --since "2024-06-20 11:36"

Code:iun 20 11:39:41 nucPC kernel: usb 3-3: USB disconnect, device number 2
iun 20 11:39:41 nucPC kernel: device offline error, dev sda, sector 0 op 0x1:(WRITE) flags 0x800 phys_seg 0 prio class 2
iun 20 11:39:41 nucPC kernel: EXT4-fs (sda1): shut down requested (2)
iun 20 11:39:41 nucPC kernel: Aborting journal on device sda1-8.
iun 20 11:39:41 nucPC kernel: Buffer I/O error on dev sda1, logical block 121667584, lost sync page write
iun 20 11:39:41 nucPC kernel: JBD2: I/O error when updating journal superblock for sda1-8.
iun 20 11:39:41 nucPC systemd[1]: Stopped target Local File Systems.
iun 20 11:39:41 nucPC systemd[1]: Unmounting /media/imgbkp...
iun 20 11:39:41 nucPC kernel: sd 0:0:0:0: [sda] Synchronizing SCSI cache
iun 20 11:39:41 nucPC systemd[1]: media-imgbkp.mount: Deactivated successfully.
iun 20 11:39:41 nucPC systemd[1]: Unmounted /media/imgbkp.
iun 20 11:39:41 nucPC kernel: sd 0:0:0:0: [sda] Synchronize Cache(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
iun 20 11:39:41 nucPC kernel: usb 3-3: new SuperSpeed USB device number 4 using xhci_hcd
iun 20 11:39:41 nucPC kernel: usb 3-3: New USB device found, idVendor=174c, idProduct=1153, bcdDevice= 1.00
iun 20 11:39:41 nucPC kernel: usb 3-3: New USB device strings: Mfr=2, Product=3, SerialNumber=1
iun 20 11:39:41 nucPC kernel: usb 3-3: Product: Ugreen Storage Device
iun 20 11:39:41 nucPC kernel: usb 3-3: Manufacturer: Ugreen
iun 20 11:39:41 nucPC kernel: usb 3-3: SerialNumber: 26A1EE836330
iun 20 11:39:41 nucPC kernel: scsi host2: uas
iun 20 11:39:41 nucPC kernel: scsi 2:0:0:0: Direct-Access TOSHIBA MQ01ABD100V 0 PQ: 0 ANSI: 6
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: Attached scsi generic sg0 type 0
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: [sdc] 1953525168 512-byte logical blocks: (1.00 TB/932 GiB)
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: [sdc] 4096-byte physical blocks
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: [sdc] Write Protect is off
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: [sdc] Mode Sense: 43 00 00 00
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: [sdc] Preferred minimum I/O size 4096 bytes
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: [sdc] Optimal transfer size 33553920 bytes not a multiple of preferred minimum block size (4096 bytes)
iun 20 11:39:41 nucPC kernel: sdc: sdc1
iun 20 11:39:41 nucPC kernel: sd 2:0:0:0: [sdc] Attached SCSI disk
iun 20 11:39:42 nucPC systemd-udevd[397820]: sdc: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/sdc' failed with exit code 1.
iun 20 11:39:42 nucPC systemd-udevd[397820]: sdc1: Process '/usr/bin/unshare -m /usr/bin/snap auto-import --mount=/dev/sdc1' failed with exit code 1.Running lsblk

Code:...
loop22 7:22 0 476K 1 loop /snap/snapd-desktop-integration/157
loop23 7:23 0 452K 1 loop /snap/snapd-desktop-integration/83
sdb 8:16 0 5,5T 0 disk
sdb1 8:17 0 5,5T 0 part /mnt/seagate
sdc 8:32 0 931,5G 0 disk
sdc1 8:33 0 931,5G 0 part
nvme0n1 259:0 0 465,8G 0 disk
nvme0n1p1 259:1 0 512M 0 part /boot/efi
nvme0n1p2 259:2 0 465,3G 0 part /var/snap/firefox/common/host-hunspellBefore the USB disconnect, the Toshiba drive was mounted on /media/imgbkp under /dev/sda -> sda 1, now it shows up without a mounting point in /dev/sdc -> sdc1

Code:/etc/fstab for Toshiba
UUID=91430a17-2801-4d1c-aacf-c29e16a80a98 /media/imgbkp ext4 defaults,noatime 0 0Command sudo dmesg -T | grep usb shows

Code:...
[Mi iun 19 22:51:13 2024] usb 3-3: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[Mi iun 19 22:51:13 2024] usb 3-3: Product: Ugreen Storage Device
[Mi iun 19 22:51:13 2024] usb 3-3: Manufacturer: Ugreen
[Mi iun 19 22:51:13 2024] usb 3-3: SerialNumber: 26A1EE836330
[Mi iun 19 22:51:14 2024] usb 3-4: new SuperSpeed USB device number 3 using xhci_hcd
[Mi iun 19 22:51:14 2024] usb 3-4: New USB device found, idVendor=0bc2, idProduct=2032, bcdDevice= 0.03
[Mi iun 19 22:51:14 2024] usb 3-4: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[Mi iun 19 22:51:14 2024] usb 3-4: Product: Expansion HDD
[Mi iun 19 22:51:14 2024] usb 3-4: Manufacturer: Seagate
[Mi iun 19 22:51:14 2024] usb 3-4: SerialNumber: 00000000NT172HCF
[Mi iun 19 22:51:14 2024] usbcore: registered new interface driver usb-storage
[Mi iun 19 22:51:14 2024] usbcore: registered new interface driver uas
[Mi iun 19 22:51:16 2024] usbcore: registered new interface driver btusb
[Jo iun 20 11:39:41 2024] usb 3-3: USB disconnect, device number 2
[Jo iun 20 11:39:41 2024] usb 3-3: new SuperSpeed USB device number 4 using xhci_hcd
[Jo iun 20 11:39:41 2024] usb 3-3: New USB device found, idVendor=174c, idProduct=1153, bcdDevice= 1.00
[Jo iun 20 11:39:41 2024] usb 3-3: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[Jo iun 20 11:39:41 2024] usb 3-3: Product: Ugreen Storage Device
[Jo iun 20 11:39:41 2024] usb 3-3: Manufacturer: Ugreen
[Jo iun 20 11:39:41 2024] usb 3-3: SerialNumber: 26A1EE836330At 22:51 last night was the last time it happened before today, this was after a reboot. Ugreen is the 2.5 inch drive enclosure manufacturer. (also seen as AsMedia Technology in lsusb command)

Command lsusb -t shows

Code:/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
|__ Port 3: Dev 4, If 0, Class=Mass Storage, Driver=uas, 5000M
|__ Port 4: Dev 3, If 0, Class=Mass Storage, Driver=uas, 5000M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/11p, 480M
|__ Port 7: Dev 2, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 7: Dev 2, If 1, Class=Wireless, Driver=btusb, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480MCommand lsusb shows

Code:Bus 001 Device 002: ID 8087:8001 Intel Corp. Integrated Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 003: ID 0bc2:2032 Seagate RSS LLC Expansion HDD
Bus 003 Device 004: ID 174c:1153 ASMedia Technology Inc. ASM1153 SATA 3Gb/s bridge
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 8087:0a2a Intel Corp. Bluetooth wireless interface
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubCommand sudo smartctl -a /dev/sdc (because now its /dev/sdc instead of sda) shows

Code:smartctl 7.2 2020-12-30 r5155 [x86_64-linux-6.5.0-41-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family: Toshiba 2.5" HDD MQ01ABD...
Device Model: TOSHIBA MQ01ABD100V
Serial Number: 773SPFIJT
LU WWN Device Id: 5 000039 7e2f0109d
Firmware Version: AX001Q
User Capacity: 1.000.204.886.016 bytes [1,00 TB]
Sector Sizes: 512 bytes logical, 4096 bytes physical
Rotation Rate: 5400 rpm
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ATA8-ACS (minor revision not indicated)
SATA Version is: SATA 2.6, 3.0 Gb/s (current: 3.0 Gb/s)
Local Time is: Thu Jun 20 12:33:46 2024 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 25) The self-test routine was aborted by
the host.
Total time to complete Offline
data collection: ( 120) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No 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: ( 231) minutes.
SCT capabilities: (0x003d) SCT Status supported.
SCT Error Recovery Control 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 0x000b 100 100 050 Pre-fail Always - 0
2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline - 0
3 Spin_Up_Time 0x0027 100 100 001 Pre-fail Always - 1804
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 2143
5 Reallocated_Sector_Ct 0x0033 100 100 050 Pre-fail Always - 0
7 Seek_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0
8 Seek_Time_Performance 0x0005 100 100 050 Pre-fail Offline - 0
9 Power_On_Hours 0x0032 085 085 000 Old_age Always - 6316
10 Spin_Retry_Count 0x0033 142 100 030 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 1535
191 G-Sense_Error_Rate 0x0032 100 100 000 Old_age Always - 5056
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 169
193 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 2144
194 Temperature_Celsius 0x0022 100 100 000 Old_age Always - 33 (Min/Max 22/67)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x0032 200 200 000 Old_age Always - 0
220 Disk_Shift 0x0002 100 100 000 Old_age Always - 0
222 Loaded_Hours 0x0032 093 093 000 Old_age Always - 2994
223 Load_Retry_Count 0x0032 100 100 000 Old_age Always - 0
224 Load_Friction 0x0022 100 100 000 Old_age Always - 0
226 Load-in_Time 0x0026 100 100 000 Old_age Always - 189
240 Head_Flying_Hours 0x0001 100 100 001 Pre-fail Offline - 0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Aborted by host 90% 6303 -
# 2 Short offline Completed without error 00% 6303 -

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.
Command smartctl -x /dev/sdc shows

Device Statistics (GP Log 0x04)
Page Offset Size Value Flags Description
0x01 ===== = = === == General Statistics (rev 2) ==
0x01 0x008 4 1535 --- Lifetime Power-On Resets
0x01 0x010 4 6316 --- Power-on Hours
0x01 0x018 6 20871988693 --- Logical Sectors Written
0x01 0x020 6 112591831 --- Number of Write Commands
0x01 0x028 6 3438474374 --- Logical Sectors Read
0x01 0x030 6 21733572 --- Number of Read Commands
0x02 ===== = = === == Free-Fall Statistics (rev 1) ==
0x02 0x010 4 5056 --- Overlimit Shock Events
0x03 ===== = = === == Rotating Media Statistics (rev 1) ==
0x03 0x008 4 2984 --- Spindle Motor Power-on Hours
0x03 0x010 4 2994 --- Head Flying Hours
0x03 0x018 4 2146 --- Head Load Events
0x03 0x020 4 0 --- Number of Reallocated Logical Sectors
0x03 0x028 4 0 --- Read Recovery Attempts
0x03 0x030 4 0 --- Number of Mechanical Start Failures
0x04 ===== = = === == General Errors Statistics (rev 1) ==
0x04 0x008 4 0 --- Number of Reported Uncorrectable Errors
0x04 0x010 4 17 --- Resets Between Cmd Acceptance and Completion
0x05 ===== = = === == Temperature Statistics (rev 1) ==
0x05 0x008 1 34 --- Current Temperature
0x05 0x010 1 34 N-- Average Short Term Temperature
0x05 0x018 1 31 N-- Average Long Term Temperature
0x05 0x020 1 67 --- Highest Temperature
0x05 0x028 1 22 --- Lowest Temperature
0x05 0x030 1 59 N-- Highest Average Short Term Temperature
0x05 0x038 1 28 N-- Lowest Average Short Term Temperature
0x05 0x040 1 54 N-- Highest Average Long Term Temperature
0x05 0x048 1 29 N-- Lowest Average Long Term Temperature
0x05 0x050 4 67769 --- Time in Over-Temperature
0x05 0x058 1 55 --- Specified Maximum Operating Temperature
0x05 0x060 4 0 --- Time in Under-Temperature
0x05 0x068 1 5 --- Specified Minimum Operating Temperature
0x06 ===== = = === == Transport Statistics (rev 1) ==
0x06 0x008 4 12420 --- Number of Hardware Resets
0x06 0x018 4 0 --- Number of Interface CRC Errors
0x07 ===== = = === == Solid State Device Statistics (rev 1) ==
0x07 0x008 1 10 N-- Percentage Used Endurance Indicator
|||_ C monitored condition met
||__ D supports DSN
|___ N normalized valueThe other hard drive, the Seagate Expansion doesn't disconnect even if it is connected the same way, via USB cable. In all the other hours when this not happens, the drive works flawlessly afaik, no issues until the usb disconnect happens.

What data is on the Toshiba?

It is the UPLOAD_LOCATION set for "immich" directory with 25k photos and 2k small videos. That's all. Drive is only like ~70GB full out of 931.

I have tried
  • changing enclosure for the Toshiba and the USB cable
  • change USB port ( I have 3 USB 3.0 + 1 charging USB port, didn't use this one though)
  • adding usbcore.autosuspend=-1 to /etc/default/grub at the end of GRUB_CMDLINE_LINUX_DEFAULT
Also, would updating the bios help at all, it's a 2016 version atm. Latest is from 2022.

I really need some help here guys, I do not know anyone who can help me IRL and i postponed this post for far too long to be honest. My really limited linux skills can't help me.
Thanks in advance!
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments