You are not logged in.

#1 2016-09-07 08:49:58

Markus00000
Member
Registered: 2011-03-27
Posts: 318

[SOLVED] Potential data loss due to disconnects of any USB drives

What happens:

  • USB drives suddenly disconnect

  • Connections last between a few seconds and several hours

  • This has been happening for months. Before that all drives worked flawlessly.

Affected laptop:

  • Dell Latitude E6530

Happens with these USB devices:

  • USB sticks, tested with 10 sticks from different manufacturers, new and old, small and large

  • USB hard drives with or without external power supply, tested with multiple cases and hard drives, IDE and SATA controllers

Does not happen with theses USB devices:

  • USB HUB (e.g. sound card, mouse)

  • USB keyboard

Does not happen with non-USB drives:

  • Internal SSD

  • Internal HDD

Tested operating systems:

  • Arch Linux

  • Ubuntu 16.04 live USB (Even the stick it is running from disconnects. Commands not yet used will give I/O errors. Commands already in RAM will continue to work. It also happens to other USB drives connected during the live session.)

What does not matter:

  • Whether the USB device is mounted or unmounted

  • Whether the USB device is busy or idle

  • Whether the port is USB 2.0 or 3.0 and which one of the 4 ports is used

  • Whether USB power saving is enabled or not

  • The filesystem

  • The kernel version, current or LTS

journalctl:

Sep 07 10:16:06 latitude kernel: usb 3-2: new high-speed USB device number 6 using xhci_hcd
Sep 07 10:16:06 latitude mtp-probe[11903]: checking bus 3, device 6: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2"
Sep 07 10:16:06 latitude mtp-probe[11903]: bus: 3, device: 6 was not an MTP device
Sep 07 10:16:06 latitude kernel: usb-storage 3-2:1.0: USB Mass Storage device detected
Sep 07 10:16:06 latitude kernel: scsi host10: usb-storage 3-2:1.0
Sep 07 10:16:08 latitude dbus[521]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service'
Sep 07 10:16:08 latitude dbus[521]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.
Sep 07 10:16:08 latitude kernel: scsi 10:0:0:0: Direct-Access     Hitachi  HTS545032B9SA02       PQ: 0 ANSI: 6
Sep 07 10:16:08 latitude kernel: sd 10:0:0:0: [sdc] 625142448 512-byte logical blocks: (320 GB/298 GiB)
Sep 07 10:16:08 latitude kernel: sd 10:0:0:0: [sdc] Write Protect is off
Sep 07 10:16:08 latitude kernel: sd 10:0:0:0: [sdc] Mode Sense: 3b 00 00 00
Sep 07 10:16:08 latitude kernel: sd 10:0:0:0: [sdc] No Caching mode page found
Sep 07 10:16:08 latitude kernel: sd 10:0:0:0: [sdc] Assuming drive cache: write through
Sep 07 10:16:08 latitude kernel:  sdc: sdc1
Sep 07 10:16:08 latitude kernel: sd 10:0:0:0: [sdc] Attached SCSI disk
Sep 07 10:16:10 latitude dbus[521]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service'
Sep 07 10:16:10 latitude dbus[521]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.
Sep 07 10:16:38 latitude kernel: XFS (sdc1): Mounting V5 Filesystem
Sep 07 10:16:38 latitude kernel: XFS (sdc1): Starting recovery (logdev: internal)
Sep 07 10:16:39 latitude kernel: XFS (sdc1): Ending recovery (logdev: internal)
Sep 07 10:16:39 latitude udisksd[3484]: Mounted /dev/sdc1 at /media/ext1 on behalf of uid 1000
Sep 07 10:17:27 latitude udisksd[3484]: Cleaning up mount point /media/ext1 (device 8:33 no longer exist)
Sep 07 10:17:27 latitude kernel: usb 3-2: USB disconnect, device number 6
Sep 07 10:17:27 latitude kernel: XFS (sdc1): metadata I/O error: block 0x950b8ab ("xfs_trans_read_buf_map") error 5 numblks 1
Sep 07 10:17:27 latitude kernel: XFS (sdc1): page discard on page ffffea00024dc140, inode 0x10003efe, offset 0.
Sep 07 10:17:27 latitude kernel: XFS (sdc1): metadata I/O error: block 0x3 ("xfs_trans_read_buf_map") error 5 numblks 1
Sep 07 10:17:27 latitude kernel: XFS (sdc1): page discard on page ffffea0005e41d40, inode 0x2f16, offset 0.
Sep 07 10:17:27 latitude kernel: XFS (sdc1): metadata I/O error: block 0x3 ("xfs_trans_read_buf_map") error 5 numblks 1
Sep 07 10:17:27 latitude kernel: XFS (sdc1): page discard on page ffffea0005e41d80, inode 0x2f16, offset 4096.
Sep 07 10:17:27 latitude kernel: XFS (sdc1): metadata I/O error: block 0x3 ("xfs_trans_read_buf_map") error 5 numblks 1
Sep 07 10:17:27 latitude kernel: XFS (sdc1): page discard on page ffffea0005e41dc0, inode 0x2f16, offset 8192.
Sep 07 10:17:27 latitude kernel: XFS (sdc1): metadata I/O error: block 0x3 ("xfs_trans_read_buf_map") error 5 numblks 1
Sep 07 10:17:27 latitude kernel: XFS (sdc1): page discard on page ffffea0005e41e00, inode 0x2f16, offset 12288.
Sep 07 10:17:27 latitude kernel: XFS (sdc1): metadata I/O error: block 0x12a4cbd2 ("xlog_iodone") error 5 numblks 64
Sep 07 10:17:27 latitude kernel: XFS (sdc1): xfs_do_force_shutdown(0x2) called from line 1197 of file fs/xfs/xfs_log.c.  Return address = 0xffffffffa02648da
Sep 07 10:17:27 latitude kernel: XFS (sdc1): Log I/O Error Detected.  Shutting down filesystem
Sep 07 10:17:27 latitude kernel: XFS (sdc1): Please umount the filesystem and rectify the problem(s)
Sep 07 10:17:27 latitude kernel: XFS (sdc1): xfs_log_force: error -5 returned.
Sep 07 10:17:27 latitude kernel: usb 3-2: new high-speed USB device number 7 using xhci_hcd
Sep 07 10:17:27 latitude kernel: usb-storage 3-2:1.0: USB Mass Storage device detected
Sep 07 10:17:27 latitude kernel: scsi host11: usb-storage 3-2:1.0
Sep 07 10:17:27 latitude mtp-probe[14437]: checking bus 3, device 7: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-2"
Sep 07 10:17:27 latitude mtp-probe[14437]: bus: 3, device: 7 was not an MTP device
Sep 07 10:17:28 latitude kernel: scsi 11:0:0:0: Direct-Access     Hitachi  HTS545032B9SA02       PQ: 0 ANSI: 6
Sep 07 10:17:28 latitude kernel: sd 11:0:0:0: [sdd] 625142448 512-byte logical blocks: (320 GB/298 GiB)
Sep 07 10:17:28 latitude kernel: sd 11:0:0:0: [sdd] Write Protect is off
Sep 07 10:17:28 latitude kernel: sd 11:0:0:0: [sdd] Mode Sense: 3b 00 00 00
Sep 07 10:17:28 latitude kernel: sd 11:0:0:0: [sdd] No Caching mode page found
Sep 07 10:17:28 latitude kernel: sd 11:0:0:0: [sdd] Assuming drive cache: write through
Sep 07 10:17:29 latitude kernel:  sdd: sdd1
Sep 07 10:17:29 latitude kernel: sd 11:0:0:0: [sdd] Attached SCSI disk
Sep 07 10:17:29 latitude dbus[521]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service'
Sep 07 10:17:29 latitude dbus[521]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.
Sep 07 10:17:31 latitude dbus[521]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service'
Sep 07 10:17:31 latitude dbus[521]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.
Sep 07 10:17:39 latitude kernel: XFS (sdc1): xfs_log_force: error -5 returned.
Sep 07 10:17:41 latitude kernel: XFS (sdc1): xfs_log_force: error -5 returned.
Sep 07 10:17:41 latitude kernel: XFS (sdc1): Unmounting Filesystem
Sep 07 10:17:41 latitude kernel: XFS (sdc1): xfs_log_force: error -5 returned.
Sep 07 10:17:41 latitude kernel: XFS (sdc1): xfs_log_force: error -5 returned.

Last edited by Markus00000 (2016-09-14 13:55:10)

Offline

#2 2016-09-08 08:47:08

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

Run

# udevadm monitor --subsystem-match=usb

to see what message is shown when the disconnection occurs.

Offline

#3 2016-09-08 14:10:33

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

Output on disconnect with three USB sticks connected:

KERNEL[34466.230463] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0 (usb)
KERNEL[34466.231162] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1 (usb)
UDEV  [34466.231756] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0 (usb)
UDEV  [34466.232033] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1 (usb)
KERNEL[34466.654263] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1 (usb)
KERNEL[34466.654537] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0 (usb)
KERNEL[34466.990747] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0 (usb)
KERNEL[34466.990973] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-2 (usb)
KERNEL[34467.412322] add      /devices/pci0000:00/0000:00:14.0/usb3/3-2 (usb)
KERNEL[34467.412549] add      /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0 (usb)
UDEV  [34467.418051] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1 (usb)
UDEV  [34467.420874] add      /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0 (usb)
UDEV  [34467.431546] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0 (usb)
UDEV  [34467.434421] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-2 (usb)
UDEV  [34467.437401] add      /devices/pci0000:00/0000:00:14.0/usb3/3-2 (usb)
UDEV  [34467.440538] add      /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0 (usb)

Offline

#4 2016-09-08 14:53:35

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

This doesn't tell much than the device is considered removed from a kernel uevent.

Maybe another uevent precedes the disconnection which doesn't appear with this command.
So try with only one usb stick and this command:

# udevadm monitor

Show all the output from the plugging in to the abnormal disconnection of the device.
Don't do anything else during this test to prevent a flood of messages.

Offline

#5 2016-09-08 15:21:11

frostschutz
Member
Registered: 2013-11-15
Posts: 1,417

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

I just got rid of one of my old USB 2 hubs because it caused bus resets / disconnects. One bad USB device can affect others. One bad solder joint somewhere...

If you can't locate a software issue (by switching kernel versions back to whatever worked for you before), and it happens w/o any USB cable / hub / ... connected to the system, just USB stick directly to the laptop port ... if you're unlucky it's the mainboard/host controller...

Offline

#6 2016-09-09 07:31:00

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

@frostschutz I am pretty sure it is not a specific device. The hub is only sporadically connected and any USB drive I have will disconnect sooner or later even if it is the only connected device. I will try an ancient live ISO to see whether it happens with kernels old enough to be sure they were released before the issue first occurred.

@berbae This is with only one USB stick. It was disconnected after a few seconds.

KERNEL[5760.634538] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[5760.634833] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[5760.635321] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11 (scsi)
KERNEL[5760.635352] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/scsi_host/host11 (scsi_host)
UDEV  [5760.638786] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [5760.640633] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
UDEV  [5760.641281] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11 (scsi)
UDEV  [5760.642154] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/scsi_host/host11 (scsi_host)
KERNEL[5761.630929] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0 (scsi)
KERNEL[5761.630981] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0 (scsi)
KERNEL[5761.631025] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/scsi_disk/11:0:0:0 (scsi_disk)
KERNEL[5761.631082] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/scsi_device/11:0:0:0 (scsi_device)
KERNEL[5761.631172] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/bsg/11:0:0:0 (bsg)
UDEV  [5761.632036] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0 (scsi)
UDEV  [5761.632778] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0 (scsi)
UDEV  [5761.634034] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/scsi_disk/11:0:0:0 (scsi_disk)
UDEV  [5761.634473] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/scsi_device/11:0:0:0 (scsi_device)
UDEV  [5761.634547] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/bsg/11:0:0:0 (bsg)
KERNEL[5761.781874] add      /devices/virtual/bdi/8:32 (bdi)
UDEV  [5761.782567] add      /devices/virtual/bdi/8:32 (bdi)
KERNEL[5761.939836] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc (block)
KERNEL[5761.939886] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc/sdc1 (block)
UDEV  [5762.000292] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc (block)
UDEV  [5762.059512] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc/sdc1 (block)
KERNEL[5805.320407] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/bsg/11:0:0:0 (bsg)
KERNEL[5805.320453] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/scsi_device/11:0:0:0 (scsi_device)
KERNEL[5805.320479] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/scsi_disk/11:0:0:0 (scsi_disk)
KERNEL[5805.320616] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc/sdc1 (block)
KERNEL[5805.320721] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc (block)
KERNEL[5805.320760] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0 (scsi)
UDEV  [5805.322020] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/bsg/11:0:0:0 (bsg)
UDEV  [5805.323173] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/scsi_disk/11:0:0:0 (scsi_disk)
UDEV  [5805.323426] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc/sdc1 (block)
UDEV  [5805.324468] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/scsi_device/11:0:0:0 (scsi_device)
UDEV  [5805.324931] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc (block)
UDEV  [5805.327293] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0 (scsi)
KERNEL[5805.370212] remove   /devices/virtual/bdi/8:32 (bdi)
KERNEL[5805.370252] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0 (scsi)
UDEV  [5805.370903] remove   /devices/virtual/bdi/8:32 (bdi)
UDEV  [5805.371175] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0 (scsi)
KERNEL[5805.410234] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/scsi_host/host11 (scsi_host)
KERNEL[5805.410279] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11 (scsi)
UDEV  [5805.411482] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/scsi_host/host11 (scsi_host)
KERNEL[5805.411698] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
UDEV  [5805.412059] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11 (scsi)
UDEV  [5805.412670] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[5805.413029] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [5805.414491] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[5805.834726] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[5805.835052] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[5805.835630] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12 (scsi)
KERNEL[5805.835663] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/scsi_host/host12 (scsi_host)
UDEV  [5805.839701] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [5805.846148] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
UDEV  [5805.846185] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12 (scsi)
UDEV  [5805.846214] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/scsi_host/host12 (scsi_host)
KERNEL[5806.830900] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0 (scsi)
KERNEL[5806.830953] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0 (scsi)
KERNEL[5806.831087] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/scsi_disk/12:0:0:0 (scsi_disk)
KERNEL[5806.831112] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/scsi_device/12:0:0:0 (scsi_device)
KERNEL[5806.831187] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/bsg/12:0:0:0 (bsg)
UDEV  [5806.831991] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0 (scsi)
UDEV  [5806.832913] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0 (scsi)
KERNEL[5806.832945] add      /devices/virtual/bdi/8:32 (bdi)
UDEV  [5806.833781] add      /devices/virtual/bdi/8:32 (bdi)
UDEV  [5806.833898] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/scsi_disk/12:0:0:0 (scsi_disk)
UDEV  [5806.834601] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/scsi_device/12:0:0:0 (scsi_device)
UDEV  [5806.835416] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/bsg/12:0:0:0 (bsg)
KERNEL[5806.841428] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/block/sdc (block)
KERNEL[5806.841477] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/block/sdc/sdc1 (block)
UDEV  [5806.901189] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/block/sdc (block)
UDEV  [5806.959013] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12/target12:0:0/12:0:0:0/block/sdc/sdc1 (block)

Last edited by Markus00000 (2016-09-09 07:37:07)

Offline

#7 2016-09-09 08:49:44

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

UDEV  [5762.059512] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/block/sdc/sdc1 (block)
KERNEL[5805.320407] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host11/target11:0:0/11:0:0:0/bsg/11:0:0:0 (bsg)
...
KERNEL[5805.413029] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [5805.414491] remove   /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[5805.834726] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[5805.835052] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[5805.835630] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/host12 (scsi)
...

43s after sdc1 partition has been detected, a remove kernel uevent occurs from the bsg scsi driver.
Then the device is immediately re-detected.

Can you test with a non scsi usb drive, to see if this is linked with the bsg scsi driver.

The sg3_utils package contains tools for scsi devices (see http://sg.danny.cz/sg/sg3_utils.html ).
Maybe something there could be useful...

And how is your media mounted?

Offline

#8 2016-09-09 12:21:33

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

What would be a non-SCSI USB drive? Everything from ancient IDE drives in USB 2.0 cases to current USB 3.1 sticks shows up as SCSI.

The media was not mounted (but it happens while mounted as well).

Last edited by Markus00000 (2016-09-09 12:22:42)

Offline

#9 2016-09-09 15:27:21

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

You are right it's not possible: USB sticks use the scsi driver; I see it on my machine also.
But I remark a difference when I plug in a USB stick:

KERNEL[1611.745351] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11 (usb)
KERNEL[1611.746499] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0 (usb)
KERNEL[1611.750544] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7 (scsi)
KERNEL[1611.750590] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/scsi_host/host7 (scsi_host)
UDEV  [1611.771061] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11 (usb)
UDEV  [1611.772040] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0 (usb)
UDEV  [1611.772861] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7 (scsi)
UDEV  [1611.773295] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/scsi_host/host7 (scsi_host)
KERNEL[1612.757613] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0 (scsi)
KERNEL[1612.757681] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0 (scsi)
KERNEL[1612.757963] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/scsi_disk/7:0:0:0 (scsi_disk)
KERNEL[1612.757994] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/scsi_device/7:0:0:0 (scsi_device)
KERNEL[1612.759387] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/scsi_generic/sg3 (scsi_generic)
KERNEL[1612.759453] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/bsg/7:0:0:0 (bsg)
UDEV  [1612.760644] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0 (scsi)
UDEV  [1612.761482] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0 (scsi)
UDEV  [1612.764400] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/scsi_disk/7:0:0:0 (scsi_disk)
UDEV  [1612.766771] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/scsi_generic/sg3 (scsi_generic)
UDEV  [1612.766838] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/bsg/7:0:0:0 (bsg)
UDEV  [1612.766910] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/scsi_device/7:0:0:0 (scsi_device)
KERNEL[1613.964499] add      /devices/virtual/bdi/8:32 (bdi)
UDEV  [1613.965657] add      /devices/virtual/bdi/8:32 (bdi)
KERNEL[1613.968626] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/block/sdc (block)
KERNEL[1613.968686] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/block/sdc/sdc1 (block)
UDEV  [1614.082988] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/block/sdc (block)
UDEV  [1614.194638] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/block/sdc/sdc1 (block)

You don't have lines like:

...
UDEV  [1612.766771] add      /devices/pci0000:00/0000:00:14.0/usb3/3-11/3-11:1.0/host7/target7:0:0/7:0:0:0/scsi_generic/sg3 (scsi_generic)
...

Do you have this from lsmod command:

# lsmod|grep sg
sg                     36864  0                                                                                                                                                              
scsi_mod              159744  6 sg,uas,usb_storage,libata,sd_mod,sr_mod

Last edited by berbae (2016-09-09 15:42:06)

Offline

#10 2016-09-09 15:43:24

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

# lsmod | grep sg
# lsmod | grep scsi
scsi_mod              151552  4 uas,usb_storage,libata,sd_mod

Ubuntu 12.04.5 (kernel 3.13) is also affected. 3.13 was released Jan 2014. I wonder if any USB-related backporting occurred as I cannot remember having this problem back then.

Offline

#11 2016-09-10 09:11:38

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

Do you have the same problem, if you manually load the sg kernel module with:

# modprobe sg

before inserting a USB stick?

Offline

#12 2016-09-10 18:00:44

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

Same problem, unfortunately:

KERNEL[38769.950338] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/bsg/10:0:0:0 (bsg)
KERNEL[38769.950516] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/scsi_generic/sg3 (scsi_generic)
KERNEL[38769.950548] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/scsi_device/10:0:0:0 (scsi_device)
KERNEL[38769.950624] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/scsi_disk/10:0:0:0 (scsi_disk)
KERNEL[38769.950786] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/block/sdd/sdd1 (block)
KERNEL[38769.950887] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/block/sdd (block)
KERNEL[38769.950983] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0 (scsi)
UDEV  [38769.951748] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/bsg/10:0:0:0 (bsg)
UDEV  [38769.952822] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/scsi_generic/sg3 (scsi_generic)
UDEV  [38769.952871] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/scsi_device/10:0:0:0 (scsi_device)
UDEV  [38769.952920] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/scsi_disk/10:0:0:0 (scsi_disk)
UDEV  [38769.953511] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/block/sdd/sdd1 (block)
UDEV  [38769.955124] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0/block/sdd (block)
UDEV  [38769.956585] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0/10:0:0:0 (scsi)
KERNEL[38770.000217] remove   /devices/virtual/bdi/8:48 (bdi)
KERNEL[38770.000259] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0 (scsi)
UDEV  [38770.000786] remove   /devices/virtual/bdi/8:48 (bdi)
UDEV  [38770.001230] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/target10:0:0 (scsi)
KERNEL[38770.050208] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/scsi_host/host10 (scsi_host)
KERNEL[38770.050259] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10 (scsi)
KERNEL[38770.050351] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0 (usb)
KERNEL[38770.051213] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1 (usb)
UDEV  [38770.051254] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10/scsi_host/host10 (scsi_host)
UDEV  [38770.051560] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0/host10 (scsi)
UDEV  [38770.051905] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1:1.0 (usb)
UDEV  [38770.052447] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-1 (usb)

Offline

#13 2016-09-10 21:12:31

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

If you boot with a USB drive already plugged in, is a disconnection occurring after some time?

Are you really sure there is no hardware issue? You should verify this in a way or another.
Since you said the disconnections occur at random time, and the device is immediately re-detected, this seems weird for a configuration or software issue.

I'm afraid I cannot do much more, sorry...

Offline

#14 2016-09-11 05:52:23

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

If I connect a stick with a live ISO before powering on, boot from it into the live system, it will still disconnect.

Next, I will make sure it is not happening in Windows. (I would have done it sooner if it was not a huge time sink to install and wait potentially for hours whether a disconnect occurs.)

Thank you so much for your help!

Offline

#15 2016-09-11 10:31:47

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

BTW - this USB drives, that you mentioned above, in the first post, are "pendrives" or normal HDD? Have you checked their SMART?

I had similar behaviour when one of my old hard disk drive had "pending sector cound" and "uncorrectable" aka "badsectors" detected on the surface. I can use it, but when i'm copying over it, and "enter" badblock area, disk either stops working, or just being ditched off from the system.

Last edited by firekage (2016-09-11 10:32:57)

Offline

#16 2016-09-11 13:56:21

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

I have tested this with about 10 USB pendrives and 4 USB HDDs (SMART has been checked). All these devices never disconnect on any other machine and work flawlessly. I am sure it is not caused by faulty USB devices.

The machine ran Windows 7 for about 10 hours without any disconnects. It looks as if the laptop hardware is fine and it is a Linux-specific USB problem.

Offline

#17 2016-09-11 20:52:18

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

I have never seen such random disconnections with USB devices, since I use GNU/Linux machines.
So it's a very peculiar problem you encounter, which doesn't seem to be reported on a general basis.

Have you searched the internet for similar cases?

Offline

#18 2016-09-11 23:34:08

firekage
Member
From: Eastern Europe, Poland
Registered: 2013-06-30
Posts: 617

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

berbae wrote:

I have never seen such random disconnections with USB devices, since I use GNU/Linux machines.
So it's a very peculiar problem you encounter, which doesn't seem to be reported on a general basis.

Have you searched the internet for similar cases?

There are.

I owned a while ago system build on Z97 (HD3P) from Gigabyte and I5-4670K. I could barely use USB because all disks that were connected via USB behaved just similar like the ones from this topic - they were disconnected. What was more funny - my family owned M5A97Evo(+?) and X4-955 and both of theese mainboard used the same USB 3.0 controller chip - ASMT (AS Media Tech as i remember). On my Z97 i had to bought USB 3.0 external controller hub (and the most funny thins - also on ASMT chip...that could not work on my motherboard but as the external hub it workes like a charm!), while my family could use USB 3.0 without external hub - my drives worked for them, while i had to bought what i bought because for all the time they were switched on and off - udevadm showed that they are lost and found, disconnected and reconnected).

If this is an newer Intel machine, especially Haswell/Skylake - i would be not suprised. On my I7-6700K on linux (Arch) i cant use HT with suspend to disk because resuming always freezes machine - on Windows it works.

Last edited by firekage (2016-09-11 23:36:49)

Offline

#19 2016-09-12 07:25:32

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

berbae wrote:

Have you searched the internet for similar cases?

Yes. It is easy to find cases where one stick or HDD randomly disconnects. Causes:

  • an old autosuspend bug (long fixed)

  • autosuspend (I have tried disabling it)

  • damaged drives (my sticks and HDDs work fine everywhere and not all 14 of them are damaged)

  • damaged USB ports (4 of 4 ports are affected and it seems so far that no disconnects occur under Windows)

Finding cases where all USB drives disconnect is hard. I have yet to find a single similar case.

@firekage Dell Latitude E6530 is Ivy Bridge.

Last edited by Markus00000 (2016-09-14 07:23:33)

Offline

#20 2016-09-14 13:54:27

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

After once more running Windows for about 24 hours it finally happened there as well. Afterwards it regularly occurred within minutes. It was just bad luck that it did not occur during previous tests which would have indicated a hardware issue earlier.

The Windows error message is: “Power surge on the USB port – Unknown USB Device needs more power than the port can supply”

I will mark this thread as “solved” – kind of.

Last edited by Markus00000 (2016-09-14 13:55:52)

Offline

#21 2016-09-14 14:21:19

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,769

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

Markus00000 wrote:

The Windows error message is: “Power surge on the USB port – Unknown USB Device needs more power than the port can supply”

I'm a little surprised this happens on 3.0 ports as well.  At a minimum, they should be able to deliver 900mA; considerably more than the 500mA guaranteed on USB 2.0 ports.

Last edited by ewaller (2016-09-14 14:35:33)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#22 2016-09-14 14:34:10

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

I had stumbled upon some such possible explanation for random disconnections, searching the internet.
Far example This link:
Post #2 from blingham:

5. Are these devices powered (meaning do they have their own power cable), or are they getting power from the USB port? If they are getting power from the usb port, what type of devices are they, and what wattage of power supply do you have? Could it be that you're running out of power, and the USB is essentially turning itself off? (this was a personal issue of mind a while ago).

So an insufficient power supply unit can explain such USB device disconnections when they need more power.
This can be a problem from pre-configured machines to keep the price lower.

Last edited by berbae (2016-09-14 14:50:39)

Offline

#23 2016-09-14 15:51:50

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

I just saw it happening with only an unlit USB keyboard connected, which, I would hope, does not draw all that much. It certainly seems as if this “power surge” is not caused by the USB devices.

Offline

#24 2016-09-14 15:58:57

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,769

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

Markus00000 wrote:

I just saw it happening with only an unlit USB keyboard connected, which, I would hope, does not draw all that much. It certainly seems as if this “power surge” is not caused by the USB devices.

Yeah, a keyboard is pretty much guaranteed to be less than 100mA.  Sounds like a hardware problem sad


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#25 2016-09-14 16:07:26

Markus00000
Member
Registered: 2011-03-27
Posts: 318

Re: [SOLVED] Potential data loss due to disconnects of any USB drives

That means buying a new mainboard, replacing it (always interesting in laptops) and hoping that it was actually the cause.

My last desperate move will be to check if it also happens on battery. Maybe it is just the power supply… (That sounds too good to be true.)

Offline

Board footer

Powered by FluxBB