USB Drive benchmark test on Linux

If you want to perform a benchmark test on a USB thumb drive or other external USB hard drive, the procedure is quite similar to doing a benchmark test on an ordinary, internal storage device. All that we need to do is measure the read and write speed of the USB drive. In this tutorial, you will see how to benchmark test a USB drive via command line and GUI on a Linux system.

In this tutorial you will learn:

  • How to install hdparm and Bonnie++ on major Linux distros
  • How to install GNOME disks utility
  • How to use hdparm, Bonnie++, and GNOME disks to perform benchmark test
USB Drive benchmark test on Linux
USB Drive benchmark test on Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software hdparm, Bonnie++, GNOME Disks
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

USB Drive benchmark test on Linux step by step instructions




We have a few different methods available to benchmark test a USB drive on Linux. This includes the hdparm and Bonnie++ utilities, which are both command line tools, and the GNOME disks utility which is, of course, a GUI application. You can choose your preferred method and follow the steps below.

USB benchmark test with hdparm

hdparm is a handy command line tool which is usually installed by default on most Linux systems. The only problem with using it for this test is that it will not measure write speed, only read speed. If you only care about getting the read speed, then feel free to use this tool.

  1. Get started by installing hdparm in case you do not already have it:
    Ubuntu, Debian, and Linux Mint:
    $ sudo apt install hdparm
    
    Red Hat, Fedora, CentOS, AlmaLinux:
    $ sudo dnf install hdparm
    
    Arch Linux and Manjaro:
    $ sudo pacman -S hdparm
    
  2. Next, we will use the -t flag to perform a test and the --direct option to bypass and system cache with the hdparm command. You must also specify the block path to your USB storage device:
    $ sudo hdparm -t --direct /dev/sdb1
    
    The results in hdparm show that our USB drive gets 19.64 MB/sec read speed
    The results in hdparm show that our USB drive gets 19.64 MB/sec read speed

USB benchmark test with Bonnie++

Bonnie++ will perform a thorough test to determine the read and write speed of our USB storage device. This will give you a very accurate result, but it will take much longer to perform the test when compared to hdparm.

  1. Get started by installing hdparm in case you do not already have it:
    Ubuntu, Debian, and Linux Mint:
    $ sudo apt install bonnie++
    
    Red Hat, Fedora, CentOS, AlmaLinux:
    $ sudo dnf install bonnie++
    
    Arch Linux and Manjaro:
    $ sudo pacman -S bonnie++
    
  2. Use the -d option to instruct Bonnie++ on where to perform its read and write test. Obviously this should point to some directory on your USB drive.
    $ bonnie++ -d /media/linuxconfig/UBUNTU\ 22_0/
    

USB benchmark test with GNOME Disks




This last method is for users that wish to use a GUI to perform their benchmark test. GNOME comes with the Disks utility, which gives users easy access to a great benchmark feature. If you do not already have GNOME as your desktop environment, you can still install the necessary utility as shown in the steps below.

  1. Get started by installing GNOME Disks in case you do not already have it:
    Ubuntu, Debian, and Linux Mint:
    $ sudo apt install gnome-disk-utility
    
    Red Hat, Fedora, CentOS, AlmaLinux:
    $ sudo dnf install gnome-disk-utility
    
    Arch Linux and Manjaro:
    $ sudo pacman -S gnome-disk-utility
    
  2. The next step is to open up the GNOME Disks application:
    Opening GNOME Disks
    Opening GNOME Disks
  3. Locate your USB drive in the left pane, then click Benchmark Disk in the right pane.
    Click on Benchmark Test for your USB drive
    Click on Benchmark Test for your USB drive
  4. Click on Start Benchmark. In the next menu, you can optionally choose to check the “perform write benchmark” box if you want to also test the write speed in addition to the read speed. Then, click on Start Benchmarking…
    Begin benchmark testing your USB drive in GNOME Disks
    Begin benchmark testing your USB drive in GNOME Disks
  5. You must enter your root password to continue.
    Enter root password credentials
    Enter root password credentials
  6. The benchmark will commence. All you need to do is wait for a few minutes or less.
    Benchmark test is currently being performed
    Benchmark test is currently being performed
  7. The benchmark test has completed and you will see your results as shown in the screenshot below.



    Average read rate, write rate, and average access time as displayed by GNOME Disks
    Average read rate, write rate, and average access time as displayed by GNOME Disks

Closing Thoughts

In this tutorial, we saw how to benchmark test a USB drive on a Linux system. This included using two command line utilities and a GUI application. Testing the read and write speed of a USB device is basically the same process as testing a hard drive or solid state drive. This should give you a good idea of the kind of speed that your thumb drive or external hard drive is capable of.



Comments and Discussions
Linux Forum