I had a problem where copying from one USB disk to another was slow, averaging 10.5MBytes/s. The source disk seemed fast enough but while the destination should do 100 MBytes/s it was one tenth that. The problem is it was connected with a USB 2.0 cable at 480 Mbit/s. With better cables it goes fast like expected. Still I should be getting 60MBytes/s out of it, or at least over 30.
I discovered every single USB C-to-A cable I have is USB 2.0 and limited to 480 Mbits/s. I diagnosed this with lsusb -t to see the interface speeds (480, 5000, or 10000) and hdparm -t to test throughput (100 MBytes/s or more when working well.)
Good USB 3 C-to-A cables do exist and can do at least 5000Mbits/s but they cost more. I’m going to have to buy some. There’s no easy way to tell a slow USB 2 cable apart from a fast USB 3 cable, but usually the USB 3 Type A cables have blue connectors or are marked SS or SS+ for “SuperSpeed”.
Update: good cables to buy
I bought a bunch of cables on Amazon and tested them. All of these advertise 10Gbps and tested fine at 10Gb/s. They all have blue connectors but only the Monoprice cable has “10 SS” printed on the connector. I did not test the power on max charging.
- Monoprice USB 3.1 Gen 2 cables. These are my favorite because they are well labeled. Shortest length is 3 feet.
- LDLrui, a generic USB 3.2 Gen 2 cable. These seem to work fine and come in 1 foot length.
- Monoprice USB 3.1 Gen 2 adapter. The only adapter I’ve seen that works at SuperSpeed in both orientations, no “flip for super speed”. No idea if that means it can’t do high power charging. Note this adapter is big, much longer than the flip-style.
I also tried this Ugreen “up to 10Gbps” adapter. It’s one of those “flip to act differently” designs that I think are confusing. Also while I could connect at 5Gbps once, mostly it was connecting at 480Gbps no matter which of 4 orientations I tried. I’m returning them.
Lots of detail
Below is a deep dive on my troubleshooting and some theoretical disk speeds for consumer hardware. But first…
Good USB C-to-A cables
The cable matters! For some reason there’s a bunch of bad cheap C-to-A cables and adapters out there. The good ones cost more, should be marked “super speed”, and probably have blue connectors.
SuperSpeed C-to-A cables exist from name brands like Anker or Monoprice. They cost more. I’ve ordered these and these.
SuperSpeed C-to-A adapters are harder to find and are usually female on the USB-A end. But that’s not what I need, I need a male A plug to stick into the A receptacle on the mini-PC. There’s lots of generic adapters in this configuration but precious few name-brand ones. I ordered these from UGREEN and this Monoprice. (There’s also lots of USB 2.0 C-to-male-A adapters but that’s what I’m trying to replace!)
I am curious about this specific C-to-A jack adapter from XAOSUN. It has a strange design, the docs say “The Type-C female port allows you to switch between USB 3.1 speed and USB 2.0 speed with a simple flip of the Type C plug.” Why would you do that?! One reviewer says “Be aware that devices like this support high-speed charging and high-data transport from USB-C to USB-A 3.0 and above are not symmetrical on the USB-C end. One side of the USB-C supports single-lane USB 3.1 Gen 2 data and low-power charging. The other side of the USB-C supports USB 2.0 data transfer and up to 100W 20V 5A charging.” So maybe that’s it? I did notice the name brand C-to-A adapters talked about maxing out at 3A. Maybe they’re trying to fake non-standard 100W charging on a USB-A port which requires weird wiring incompatible with 10Gbit/s data? Anyway “works differently when flipped” sounds like a confusing mess so I’d rather get something that just does high speed data. All my fast charging devices now are USB-C and USB-PD anyway.
Update: almost all C-to-A small adapters have this flip-for-superspeed design. This discussion says the whole concept of C-to-A adapters is problematic.
Disk medium, SATA, and PCIe speeds
Modern spinning disk media can transfer at least 100MByte/s, more like 150 or even more if you have a high performance disk. SSDs are much faster, like 3000MByte/s or more.
Older disks are interfaced via SATA. SATA 3.0, from 2008, is 6 Gbit/s = 750MByte/s. That’s faster than any spinning disk but slower than modern SSDs. New SSDs interface via M.2 / NVME which runs at PCI bus speeds. That’s very fast, even the oldest PCIe 3.0 with 4 lanes is almost 4000MBytes/s. I’m not clear on whether these SATA and PCIe speeds are shared between devices or not. In practice any PCIe interface is fast enough for any SSD and SATA is fast enough for spinning disks but not SSDs.
Bottom line, here’s a low estimate of speeds of typical disks on modern hardware:
- Spinning disk via SATA: 100MByte/s
- SSD via SATA: 500MByte/s
- SSD via M.2: 3000MByte/s
USB 2 and USB 3 speeds
A proper PC connects to the drives directly via SATA or M.2. But mini-PCs often use USB instead and you have a drive enclosure with SATA or M.2 input and USB output. Modern USB enclosures support at least 5Gbit/s (625MByte/s) which is just about as fast as any SATA drive (HDD or SSD) but will limit an M.2 SSD.
USB comes in multiple flavors, this is a good reference. USB 2.0 is “high speed”, ie: slow. It means 480 Mbit/s (60 MByte/s). USB 3.0 dates to 2008 and is 5Gbit/s (625MByte/s). USB 3.1 is 10Gbit/s and USB 3.2 2×2 is 20Gbit/s. Sometimes you see USB 3 stuff advertised as “SuperSpeed” or “SuperSpeed+” but these days it’s more common to just publish the number. Everything in the last 10 years or so should be supporting at least 5Gbit/s on USB 3, 10Gbit/s is common. 20 is rare.
Note these speeds are shared between all devices on the same USB bus. So if you have two drives plugged in to a 480Mbit/s USB bus the max throughput copying from one to the other is going to be 480 / 2 = 240Mbit/s or 30MByte/s (I think?).
Cables also matter. I think USB-A maxes out at 10Gbps, it can’t do the x2 part required for 20Gbps. Older USB-A cables may be limited to 5Gbps. And old, cheap, or bad cables are limited to 480Mbps USB 2. Look for a blue block inside the connector, that’s the branding for at least 5Gbps. Or the words “SuperSpeed” or “SS”.
USB-C is better. I think most USB-C cables are SuperSpeed but there are probably some cheap “charging cables” out there that aren’t.
Unfortunately, mini-PCs mostly still have USB-A ports on them. So you need a C-to-A adapter or cable. That’s where I got in trouble, turns out a lot of those are not SuperSpeed but limited to USB 2 speeds.
I think mixing USB 2 and USB 3 devices on the same bus is OK and that the USB 3 devices can operate at their faster speeds. Not positive though. (Reference.)
Bottom line theoretical speeds from USB:
- USB 2.0: 60MByte/s, half that if transferring between two drives
- USB 3.0 5GBps: 625MByte/s
- USB 3.1 10GBps: 1250MByte/s
- USB 3.2 2×2 20GBps: 2500MByte/s
In practice USB 3.1 10Gbps is faster than any SATA interface and even 5Gbps is close to SATA speeds. But USB 2.0 is slow, slower even than spinning disks. It is a bottleneck to be avoided.
Cable testing
I decided to try a bunch of cables with a Samsung SSD 860 EVO 1TB SSD in a UGREEN SATA enclosure. It has a USB-C port. The USB interface is 10Gbit/s, the SATA is 6Gbit/s, and this old SSD drive can do about 500MByte/s. The disk is the bottleneck then, but should be capable of 500MByte/s.
With a USB C-to-C connection to the USB-C port on the BOSgame, lsusb -t shows 10000M speed and hdparm -t measures 500MBytes/s. Great! (I also tested a spinning rust 1TB disk at about 90MBytes/s with this same C-to-C cable. Yay!)
With a blue USB C-to-A cable sold with a hard drive as SuperSpeed, lsusb -t shows 5000M speed and hdparm -t measures 410MBytes/s. Still quite good but it’s interesting the C-to-A connection speed is half the C-to-C and that is reflected in actual throughput. In theory 5000Mbit/s should still deliver 500Mbyte/s transfers but in practice, it gets knocked down to 410MBytes/s.
With various other C-to-A cables: cheap ones, fancy Anker ones that are actually USB 2, the good C-to-C cable plugged into a cheap C-to-A adapter, every other cable I tried it connected at 480Mbps. And the drive measured out about 16MBytes/s. Turns out these are all USB 2.0 cables, WTF? They are garbage but I guess they are common because they are cheaper.
I don’t understand why I’m getting 16MBytes/s with USB 2.0 connections and not the theoretical 60MBytes/s. Maybe the Mini-PC’s USB 2.0 implementation is not very good?
Mini PC speeds
I have a BOSGAME B100 I bought in December 2023. The Amazon marketing page picture says the USB-A ports in back are USB3.2 Gen 1*2 and the USB-A ports in front are “USB3.2 Gen 2*2”. (Note this says “*2” which I think means two ports, not the USB x2 double speed ports.) There is also a USB-C port on front. The Bosgame site spec page also says four USB 3.2 ports but it suggests the front ones are the slower 5Gbit/s and the back are 10Gbit/s. Testing confirms this is true: the back ports are 10Gbit/s, the front ports are 5Gbit. But all these ports should be USB 3 and capable of at least 5Gbit/s = 625MByte/s, faster than any 2.5″ SATA disk. (There is also room for an internal SATA drive.)
I also bought a Beelink S12 Pro Mini PC. According to the Beelink sale page it has 4 USB3.2 Gen2(10Gbps) ports. Good! It also has room for an internal SATA drive.
The good disk
The USB disk I was copying from is an old WD Passport I bought in 2012 and use mostly as a backup drive. It is an honest USB 3.0 drive. lsusb -t shows 5000Mbit/s and hdparm -t tests out at about 100MB/s. I get this using either a USB-A port in the front or the back or the BOSGAME. It’s using a short cable with USB-A on one side (colored blue) and Micro USB 3.0 Micro-B connector on the drive side.
The bad disk
Actually no disks are bad. If I connect them with C-to-C cables, they all test at 100MBytes/s. The badness comes from the crappy C-to-A cables, not the disk.
But the destination disk that was slow for my copy is a WD Blue 2.5″ SATA spinning disk in a cheap Orico enclosure. The disk can do up to 150MB/s and the enclosure claims 10Gbps USB 3.2 Gen2 so should not be a bottleneck. smartctl doesn’t show any obvious errors, the drive has 32,000 hours on it but no errors. It should be capable of 150MByte/s. In practice I get 100MByte/s with a good cable.
The test disk
Described above in cable testing: a 860 EVO in a SATA enclosure. Gets 500MBytes/s with a proper cable.
The best disk
I have an SSD in a UGREEN M.2 enclosure that says it does 10Gbits/s via USB-C. (The SSD itself is a 970 Evo that can do 3000MByte/s, or faster than the USB.) So I should get an honest 1250MByte/s with this device. Just for fun I tried it with a C-to-C cable. It connects at 10,000 Mbit/s. hdparm -t shows just about 1000 MBytes/s, or close to the USB speed. The SSD is capable of 3x that speed but that’s too fast for USB 3. In theory I might get double the speed if I could manage a USB 3.2 2×2 connection at 20Gbit/s.
Observed bad copy behavior
Notes from the slow copy using a bad C-to-A cable. I’m using rsync -a --partial --append --progress to copy a 700GB file from one USB disk to another. It’s slow, it copied at 10.5MBytes/second. the rsync outpput:
699,404,892,160 100% 10.51MB/s 17:37:25 (xfr#1, to-chk=0/2)
That’s terrible. Even worst case (both drives on USB 2.0) I should expect nearly three times this speed.
Watching the rsync progress it fluctuates between 20MB/s to as slow as 2MB/s. iotop doesn’t show me anything interesting, this copy is the only major I/O.
Linux diagnostics: USB
The thing that got me started looking at all this in detail was this output from lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 10000M
|__ Port 3: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
|__ Port 4: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 6: Dev 5, If 0, Class=Mass Storage, Driver=uas, 480M
|__ Port 7: Dev 4, If 0, Class=Mass Storage, Driver=uas, 480M
|__ Port 8: Dev 2, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 8: Dev 2, If 1, Class=Wireless, Driver=btusb, 12M
That’s telling me two disks (dev 4 and dev 5) are running at 5000Mbit/s. Good! But two are running at 480Mbit/s. Bad! Even so, I should still get at least 30MByte/s (or more), but something’s not right.
Device 5 is the slow Orico disk I’m writing to. dmesg tells me “usb 3-6: new high-speed USB device number 5 using xhci_hcd”. But lsusb says it’s running at 480Mbit, because of the bad cable.
Device 4 is the 2.5″ SATA SSD in a Ugreen enclosure. Also connected at 480Mbit/s because of the cable.
Note the slow disks are connected with the UAS driver. That should be good, that’s more capable than the older usb-storage driver. These enclosures are newer and support the newer UAS protocol.
Linux diagnostics: hdparm throughput
Not much to say here, just hdparm -t /dev/sdd is a quick test of max throughput on a disk. Something like fio is better for real disk I/O benchmarking but hdparm is useful for seeing if it’s basically working right.