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.
You can use this tutorial to test Linux hard drive speed for various reasons, such as evaluating your PC storage device or determining whether your VPS provider genuinely provides SSD storage as promised.
Linux Disk Speed Test via Commands
There are several ways to check disk speed in linux, and you can choose any of them.
1. dd command
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
2. hdparm Command
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 following command in a terminal window to see if HDParm is installed on your machine.
hdparm -help
To test disk performance 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.
lsblk
- 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.
3. fio command
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
Linux 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 hard disk speed in Linux using the "dd", "hdparm" program, and "fio" methods. The graphical method for testing Linux disk speed was also covered. For those using a Linux VPS, understanding and optimizing disk speed is crucial for maintaining server performance and reliability. Whether you're using a VPS for web hosting, application development, or data storage, the methods outlined in this guide will help ensure your system runs efficiently.
People also read: