How to Measure Disk Speed in Linux

Cloudzy ☁️
Cloudzy Blog
Published in
3 min readSep 8, 2023

In the age of SSDs, disk speed has become a crucial factor in determining the performance of your Linux system. Whether you’re a sysadmin or a developer, knowing how to measure disk speed can help you make informed decisions about hardware upgrades or cloud service selection.

This article will guide you through various methods to test disk speed in Linux, from command-line tools like dd, hdparm, and fio to graphical utilities.

Before diving into the methods, it’s essential to understand why disk speed is vital. Faster storage not only speeds up file transfers but also improves the overall system performance. It’s not just about getting a single ‘speed’ number; we aim to measure real-world performance metrics for different types of storage devices, including HDDs and SSDs.

Command-Line Methods

Using dd

The dd command is a built-in Linux tool primarily used for converting and copying files. To measure write speed, you can use the following command:

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

For read speed, you’ll need to clear the cache and re-run tests. The dd method is straightforward but not the most accurate for real-world scenarios.

Using hdparm

The hdparm utility is another command-line tool that provides a simple way to conduct sequential read speed tests. To install it:

On CentOS, RHEL:

sudo yum install hdparm

On Ubuntu, Debian:

sudo apt-get install hdparm

Run the test with:

sudo hdparm -Tt /dev/sda

Using fio

For a more comprehensive test that includes random read/write operations, fio is your go-to tool. Install it and run various tests to measure both SSD and HDD performance.

For a more comprehensive test that includes random read/write operations, fio is your go-to tool. Install it and run various tests to measure both SSD and HDD performance.

Graphical Method

If you’re not a fan of the command line, Linux also offers graphical utilities for disk speed tests. You can use the Disk Utility to run benchmark tests on your storage devices.

Improving Disk Speed

The article also touches upon using NVMe drives to improve disk speed, offering a significant performance boost over traditional SSDs and HDDs.

Conclusion

Measuring disk speed in Linux is not just a number game. It involves understanding the types of operations your system performs and selecting the right tool for the job. Whether you’re testing the promises of your VPS provider or planning a hardware upgrade, these methods provide a robust framework for assessing disk speed.

If you’re serious about optimizing your Linux system’s performance, the original article on Cloudzy is a treasure trove you can’t afford to overlook. It dives deep into the nitty-gritty of disk speed testing, offering a buffet of tools and methods that cater to different needs and scenarios. Whether you’re a sysadmin, a developer, or just a Linux enthusiast, this comprehensive guide arms you with the knowledge to make data-backed decisions about your storage solutions. So why settle for subpar performance? Head over to the article now and elevate your Linux game to the next level. Trust me, your future self will thank you.

Source: How to test disk speed in Linux

--

--

Cloudzy ☁️
Cloudzy Blog

Instantly create High-Performance Cloud VPS services worldwide with NVMe SSD storage and 10Gbps connections at a fraction of cost.