Phone :  +370 (5) 204-1903
Email :  sales@1gbits.com
  1. Dedicated server
  2. Blog
  3. How to obtain disk speed data in Linux?

How to obtain disk speed data in Linux?

Everyone was able to see how much of a difference a quicker storage disk can make, thanks to the invention of SSD. There is also the issue of gauging disk speed when it comes to speed. 

Linux Tutorial Jul 27, 23 by Nisal N 4 min Read
How to obtain disk speed data in Linux?

List of content you will read in this article:

You can use this tutorial to evaluate disk speed for various reasons, such as evaluating your PC storage device or determining whether your VPS provider genuinely provides SSD storage as promised.

Test disk speed in Linux via commands

There are several ways to accomplish this, and you can choose any of them.

dd

dd is a built-in utility in Linux that may show an operation's overall completion time. 

Launch the shell prompt or use ssh to access a distant server. To gauge server throughput (write speed), use the dd command:

dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync

The dd command can also be used to gauge server latency:

dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync

hdparm

Another program you may use to check your Linux disk speed is HDParm. Although it lacks a GUI and is not as user-friendly as Gnome Disk Utility, it is nonetheless just as beneficial. 

Not all Linux operating systems come with the HDParm application pre-installed, although many do. Run the hdparm -help command in a terminal window to see if HDParm is installed on your machine.

Press Ctrl + Alt + T on the keyboard to launch a terminal window on the Linux desktop if HDParm is not installed on your Linux computer. 

Then, follow the installation instructions.

To test disk speed in Linux after installing HDParm on your PC, adhere to the detailed procedures below.

  • Step 1: Use the lsblk command to get a list of all the system's attached hard disks. Locate the hard drive you want to test by looking through. We'll test /dev/sda in this case. 
  • Step 2: To start the test, run the hdparm -Tt command on the hard disk (sudo hdparm -Tt /dev/sda).

The test results will appear on the screen after it is finished.

fio

The earlier benchmarks solely consider measurements of sequential read/write speed. Random access patterns are more frequently used for read/write interactions with disks. 

This disqualifies sequential-based techniques from determining a disk's write/read speed in actual use. "fio" has been created to address this flaw.

Although "fio" is not included by default in Linux, it is simple to install. To set up this tool, you can use the following command. 

sudo apt-get install fio

Then use it to test disk speed in Linux.

Linux disk speed test via the Graphical Method

Use the built-in Linux Disk utility to run disk speed tests without inputting commands into the Terminal. Most Linux distributions feature the same utility, which we'll use as an example here with Ubuntu 21.

1. Open the Disk Utility 

Quickly launch the Disk Utility by typing "Disk" into the program menu or by looking for it in the menu under System → Administration → Disk Utility.

2. Choose the disk for the test

You may see a list of all the disks installed on your computer on the left panel. You can choose the one you want to test by clicking on it.

3. Run the Benchmark Feature 

To launch Benchmark, locate and click the "Benchmark - Measure Drive Performance" button on the right panel of the Disk Utility.

4. Run the tests

There are two buttons on the new screen with the chart. The first one is called "Start Read-Only Benchmark" and does exactly what it says: it measures how quickly your disk is when you are simply reading from it. 

The "Start Read/Write Benchmark" gauges the performance of both I/O operations, which is inevitably slower than the other one. 

You can select the one you want by clicking on each one.

Conclusion

Disk speed typically restricts performance on a server or a PC used for work. There are different ways to test disk speed in Linux.

This article will demonstrate how to evaluate the disk speed in Linux using the "dd", "hdparm" program, and "fio" methods. The graphical method for testing Linux disk speed was also covered.

People also read: 

author img

Nisal N

Computers has always fascinated me since I was a kid and here we are. I love travelling for 2 reasons: the first one to see a new part of the world and second (the most important one) to experience the rich culture hidden among the country and people. I'm pretty good at cooking but very poor when it comes to baking.

Leave A Comment