You are not logged in.

#1 2017-06-13 18:53:52

Thijxx
Banned
Registered: 2013-08-24
Posts: 18

Writing to USB drive slows down system

When I copy a 1GB file to the flash drive all operations go into super slow mode and the transfer to the USB drive goes with a speed of around 10KB's, it's hard to tell because it bounces between 6 bytes per second and 10MB per second. My flash drive is a `Kingston Technology DataTraveler 100 G3/G4/SE9 G2` and I expect is to run at least at 10MB's like it does when I boot into Windows.

This behaviour is tested by me with 3 different USB drives and 3 micro SD cards in 2 different USB adapters and the USB ports on the front and on the back of the PC. I have also switched the source I copy from, tried 2 different SSD drives and an oldskool spinning disk. Als tried to torrent directly to the drive, this works better than rsync, cp or any other writing I did, maybe even reached ~400KB's, haha.

There is nothing about problems with the drives in my logs. dmesg shows some things, included below.

I have spent 10 hours reading the wiki, forum posts and Googling, I cannot find the problem I need to solve.

--

Motherboard: MSI Z87 MPOWER MAX

~ _ free -h                                                                                                                                                                                                                                                  
              total        used        free      shared  buff/cache   available                                                                                                                                                                              
Mem:            15G        5,6G        246M        1,1G        9,8G        8,7G                                                                                                                                                                              
Swap:           14G        107M         14G
~ _ lsusb -s 004:002 -v

Bus 004 Device 002: ID 0951:1666 Kingston Technology DataTraveler 100 G3/G4/SE9 G2
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         9
  idVendor           0x0951 Kingston Technology
  idProduct          0x1666 DataTraveler 100 G3/G4/SE9 G2
  bcdDevice            1.10
  iManufacturer           1 
  iProduct                2 
  iSerial                 3 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           44
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              126mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               3
~ _ lsmod | grep hci
ahci                   36864  7
libahci                28672  1 ahci
libata                196608  2 ahci,libahci
xhci_pci               16384  0
ehci_pci               16384  0
xhci_hcd              159744  1 xhci_pci
ehci_hcd               69632  1 ehci_pci
usbcore               196608  11 uas,snd_usb_audio,uvcvideo,usb_storage,snd_usbmidi_lib,ehci_hcd,ehci_pci,ipheth,usbhid,xhci_hcd,xhci_pci

Seems to be wrong, if iostat was right, I must have written at least 100TB to a 128GB flash drive.

~ _ iostat -d 2
Device:            tps    kB_read/s    kB_wrtn/s    kB_read    kB_wrtn
sde              62,00         0,00      2144,25          0       4288

dmesg when UNplugging the drive

[37784.503559] sde: detected capacity change from 123992014848 to 0
[37793.970544] xhci_hcd 0000:00:14.0: Cannot set link state.
[37793.970548] usb usb4-port2: cannot disable (err = -32)
[37793.970550] usb 4-2: USB disconnect, device number 2

dmesg when plugging the drive in

[37821.379692] scsi 9:0:0:0: Direct-Access     Kingston DataTraveler 3.0 PMAP PQ: 0 ANSI: 6
[37821.380165] sd 9:0:0:0: Attached scsi generic sg4 type 0
[37821.380597] sd 9:0:0:0: [sde] 242171904 512-byte logical blocks: (124 GB/115 GiB)
[37821.381118] sd 9:0:0:0: [sde] Write Protect is off
[37821.381121] sd 9:0:0:0: [sde] Mode Sense: 45 00 00 00
[37821.381674] sd 9:0:0:0: [sde] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[37821.575395]  sde: sde1
[37821.578374] sd 9:0:0:0: [sde] Attached SCSI removable disk
[37821.763518] FAT-fs (sde1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

Offline

#2 2017-06-13 20:43:47

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,887

Re: Writing to USB drive slows down system

I'd trust iostat and look at dmesg when writing, there'll likely be quite some IO errors; try to disable xhci or use a usb 2 port (if available)
Also check lspci for the particular USB controller and ask google for known problems ;-)

Offline

Board footer

Powered by FluxBB