The issue to which I refer has been talked about a bit elsewhere on the internet:
- https://www.reddit.com/r/linuxquestions/comments/sbpt23/usb_flash_drive_read_speed_much_slower_in_linux/
- https://forums.linuxmint.com/viewtopic.php?t=328360
- https://www.youtube.com/watch?v=AbNNs-oyuTQ
- https://www.reddit.com/r/linuxquestions/comments/ujwlmn/slow_read_speed_with_samsung_fit_plus_drive_on/
However, it doesn't seem that anyone has found a solution.
I am fairly sure this is not a "Windows is lying/Linux is telling the truth" kind of issue. It is not a drive health issue, as the same drive works 5x as fast under Windows than on Linux on the same computer, in the same port.
I also do not think it's related to the filesystem the drive is formatted with, for reasons shown below.
I think there is something wrong in the way that Linux (and/or the drivers) is communicating with these drives that causes them not to reach their full capability.
In my particular case, the drive is a Samsung USB Type-C™ Flash Drive 128GB (MUF-128DA/AM).
In Windows, using CrystalDiskMark, it's possible to get sequential read speeds on the order of 400MB/s:
In Linux, this is the best read speed I could get:
$ dd iflag=direct if=/dev/sda of=/dev/null bs=128k count=15001500+0 records in1500+0 records out196608000 bytes (197 MB, 188 MiB) copied, 2.3547 s, 83.5 MB/s
I tried various block sizes and count. I also tried fio
and hdparm
. Both returned similar speeds of around 84 MB/s. Also note that this is reading directly from /dev/sda, and not a partition or even a file on the drive (I get similar speeds, though, when reading from a file).
Here are some details of the drive:
$ lsusb -t... |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M$ lsusb -d 090c:1000 -vBus 002 Device 002: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) Flash DriveDevice Descriptor: bLength 18 bDescriptorType 1 bcdUSB 3.10 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 9 idVendor 0x090c Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) idProduct 0x1000 Flash Drive bcdDevice 11.00 iManufacturer 1 Samsung iProduct 2 Type-C iSerial 3 xxxxxxxxxxxxxxxx bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x002c bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 304mA 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 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 0 bMaxBurst 8 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x82 EP 2 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0400 1x 1024 bytes bInterval 0 bMaxBurst 8Binary Object Store Descriptor: bLength 5 bDescriptorType 15 wTotalLength 0x0016 bNumDeviceCaps 2 USB 2.0 Extension Device Capability: bLength 7 bDescriptorType 16 bDevCapabilityType 2 bmAttributes 0x00000002 HIRD Link Power Management (LPM) Supported SuperSpeed USB Device Capability: bLength 10 bDescriptorType 16 bDevCapabilityType 3 bmAttributes 0x00 wSpeedsSupported 0x000c Device can operate at High Speed (480Mbps) Device can operate at SuperSpeed (5Gbps) bFunctionalitySupport 2 Lowest fully-functional device speed is High Speed (480Mbps) bU1DevExitLat 4 micro seconds bU2DevExitLat 4 micro secondscan't get debug descriptor: Resource temporarily unavailableDevice Status: 0x000c (Bus Powered) U1 Enabled U2 Enabled
What would be the best way to approach getting to the bottom of this issue?