Introduction to hdparm
What is hdparm?
Why Use hdparm to Measure Disk Speed?
Simple and Easy to Use
Accurate and Reliable
Ability to Check Multiple Aspects
Available on Most Linux Systems
How to Measure Disk Speed on Ubuntu 20.04 VPS Using the hdparm Command
Identify the Disk to Test
lsblk

Install hdparm on Ubuntu
sudo apt update
sudo apt install hdparm -y
- sudo apt update: Updates the package list to ensure you have the latest information about available packages.
- sudo apt install hdparm -y: Installs the hdparm package.

Measure Disk Read Speed
Once you’ve identified the disk, you can use the hdparm command to measure the disk’s read speed. The syntax for performing the test is:
sudo hdparm -Tt /dev/sda
Explanation of the Parameters
T: Tests the disk’s cache speed.
t: Tests the actual read speed from the disk.
/dev/sda
Distinguishing Cached Reads vs. Buffered Disk Reads
- Cached Reads: This is the speed of reading data from the system’s cache, not directly from the physical disk.
- Buffered Disk Reads: This measures the actual read speed from the physical disk.
Example for Singapore VPS at VPSWindows.com:

Timing cached reads: 24690 MB in 1.98 seconds = 12455.38 MB/sec
HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device
Timing buffered disk reads: 1252 MB in 3.01 seconds = 416.57 MB/sec
Common Errors and How to Fix Them When Using the hdparm Command
While using the hdparm command, you may encounter some common issues. Knowing how to resolve these errors will help improve your experience with this tool.
“command not found” Error When Running hdparm
sudo apt-get install hdparm
“permission denied” Access Error
sudo hdparm -t /dev/sda
Disk Device Not Found Error
- High system load: Other running applications may interfere.
- Actual disk type: Your VPS might use “virtual SSDs” or outdated SSD technology.
- Provider limitations: Some VPS providers enforce I/O speed limits.
- Try rerunning the command during off-peak hours.
- Check system load with htop or top.
- Contact your VPS provider to ask about the disk type and any I/O limitations.
- Use other tools like fio for more comprehensive testing.
- Use the smartctl command to check the disk’s health and troubleshoot potential issues.