• About

N1nja Hacks

~ Random assortment of solutions, sneaky hacks and technical HOWTOs

N1nja Hacks

Category Archives: linux

Figuring out the speed of your USB stick and USB port

06 Friday Oct 2023

Posted by valblant in linux

≈ Leave a comment

Tags

flash drive, linux, usb, usb stick

Ever wonder why you USB transfer is taking so long? This guide will explain how to definitively understand what you can expect from your USB stick on a Linux computer.

Testing The Speed

First, we should see what transfer rates we are actually getting. We will use the 'dd' utility for this purpose.

Read

dd if=/dev/sdc of=/dev/null bs=1M count=1024
          !^^^!
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 8.64301 s, 124 MB/s

Make sure to replace ‘sdc' with the device name of your USB stick!

Write

dd if=/dev/zero of=/dev/sdc bs=1M count=500
                       !^^^!
500+0 records in
500+0 records out
524288000 bytes (524 MB, 500 MiB) copied, 44.7914 s, 11.7 MB/s

Make sure to replace ‘sdc' with the device name of your USB stick!

This command can take a long time if your write speed is very slow. Consider lowering count=500 down to count=150, for example.

So why is it so slow?

USB Standard

USB 2 is a very slow standard, so if either your computer port or your stick are USB 2, that is the reason for the slow transfer rate.

Checking Version of Computer Port

If the port on the computer is blue, then it’s definitely USB 3.

But if not, then you need to check:

❰val❙~❱✔≻ lsusb | grep 'root hub'
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  <= Yep - we have USB 3
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Checking Version of USB Stick

If the port connector is blue, then it’s definitely USB 3.

But if not, then you need to check. For example, here’s a USB 2 stick:

❰val❙~❱✔≻ lsusb | grep '<name of USB stick>'
Bus 003 Device 075: ID 346d:5678 USB Disk 2.0
    ^^^        ^^^

❰val❙~❱✔≻ lsusb -D /dev/bus/usb/003/075 | grep bcdUSB
                                ^^^ ^^^
  bcdUSB               2.00

And here’s a USB 3 stick:

❰val❙~❱✔≻ lsusb -D /dev/bus/usb/004/006 | grep bcdUSB
                                ^^^ ^^^
  bcdUSB               3.20

Other Reasons for Slowness

File System Format

Some file systems are slower than others. FAT32 is generally much slower than NTFS or EXT4.

Try a Different Port

Rarely, but sometimes, the issue might be with the USB port itself. Try a different one!

Conclusion

For best results, make sure to match USB 3 sticks to USB 3 computer ports, and don’t use FAT32 file system.

Hope this helps.

Blog at WordPress.com.

  • Subscribe Subscribed
    • N1nja Hacks
    • Already have a WordPress.com account? Log in now.
    • N1nja Hacks
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar