Test Your Storage Drive’s Read Speed

One of the most frequent things you’ll do is read data from disk, so why not test your storage drive’s read speed? In this article, we’ll use an application we’ve used before. This shouldn’t be a very complicated article.

We store data on drives, or disks if you prefer. Most of us don’t use disks as our main storage devices. We do use disks for backups or storing large amounts of data, but we largely use SSDs these days. Some of us even use NVMe M.2 SSDs to store our data. The latter is currently the quickest you’re likely to encounter as a consumer.

The old spinning platters we used (though we’ve used lots of forms of magnetic storage) are typically referred to as HDDs (Hard Disk Drives). The SSDs (Solid State Drives) have no moving parts and are much faster. The NVMe M.2 SSDs are faster still.

If you’re suffering from some bottleneck, you might want to diagnose that. You might just be curious. It is also possible that you just purchased new hardware and want to see if the storage device reaches the advertised speed.

The tool we’ll be using is hdparm. This works fine with USB thumb drives, HDDs, regular SSDs, and even NVMe SSDs. It’s a complex application with a lot of options. I’ve covered some features before.

How To: Show Your Hard Drive Specifications In The Terminal

So then, let’s learn about this hdparm…

hdparm:

It should be noted that this hdparm application should be installed by default. It should also be mentioned that hdparm is a terminal-based application. You can verify that hdparm is installed with the following command:

If you then check the man page (with man hdparm) you’ll see that hdparm is described quite nicely like this:

hdparm – get/set SATA/IDE device parameters

If hdparm is not installed, you can surely find it in your package manager. 

As you can see, hdparm is the right tool for the job assuming you want to test your storage drive’s read speed. It’s also the right tool for a bunch of other jobs, but we’ll just be covering the read speed today.

Test Your Storage Drive’s Read Speed:

As I mentioned above, this hdparm application is something you use in your terminal. I suspect my regular readers will have guessed that. If you’re new to the terminal, more often than not you can open your default terminal by pressing CTRL + ALT + T.

With your terminal open, let’s identify your storage drives with this command:

You’re interested in the bits that start with /dev/<drive_ID> as those are the drives you’ll be able to test. 

NOTE: You should run these tests several times and average them, and you should do so while the system is otherwise idle. That will give you the peak results.

We’re interested in two flags, as they represent two tests. The -t flag tests the read cached. The -T flag tests the drive’s buffered read timings. You’ll often find the first test is fairly similar throughout the different drives and that the cached test shows the most differences. If those two terms, cached and buffered, confuse you, here’s a link about the differences between cache and buffer as far as the hdparm application goes.

You’ll need elevated permissions for this, so the command looks like this:

Or, as an example for many of you, the command might look like this:

That command will test both the cached read speed and the buffered read speed. These tests are important because you’re using a smart operating system that puts things into the cache and buffer that are likely to be read from the drive. So, the command listed will test both. You can split them up of course.

I decided to get you some examples:

Some Quick Read Speed Tests:

This is the internal SSD on a desktop:

Next is a USB 2.0 device plugged into that desktop:

Then we have an external HDD plugged into a USB 2.0 port on that desktop:

For comparison, this is an NVMe M.2 SSD:

As you can see, the internal SSD is quite fast. The thumb drive is the next quickest. This is followed by the external drive that’s just a spinning platter drive. 

Then, of course, you can see that the NVMe M.2 SSD is so much faster. That’s not even the fastest SSD out there. There are faster NVMe M.2 SSDs that don’t cost a lot of money. The prices have come down these days. You can even get a PCIe card that lets you mount an NVMe M.2 SSD if your motherboard doesn’t already support it.

Closure:

Should you want to get some drive benchmarks, you can certainly use hdparm to test your storage drive’s read speed. This isn’t something complicated and most anyone can figure it out. All you need to do is follow the directions carefully and in order. I do try to explain things as I go along.

There’s a lot more to the hdparm application. I encourage you to check the man page. There are probably another half-dozen articles that can be written about hdparm, so you’ll likely see this application again in the future. I doubt I’ll do another one too soon, as I like to space things out and not get too repetitive. 

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Show Your Hard Drive Specifications In The Terminal

In today’s article, we’re going to explore one way that you can show your hard drive hard drive specifications in the terminal. There’s nothing too challenging in this article, so even new people can follow along.

To be clear, I’m using the phrase ‘hard drive’. In this instance, I’m speaking both of mechanical hard drives (HDD) and solid state drives (SSD). I could probably come up with something better, but we’ll just stick with ‘hard drive’.

You may want to know your hard drive specifications to ensure you got what you paid for. You might also want to know what features it supports – and how long at least one of those features is expected to take. For instance, there’s a secure erase feature on many drives and this takes time. The command we’ll be using may tell you how much time it will take to securely erase the disk.

We’ll be showing the hard drive specifications in the terminal and the biggest tool we’ll be using is ‘hdparm’. It does what it says on the tin and describes itself like:

hdparm – get/set SATA/IDE device parameters

You should find hdparm installed and shouldn’t need to install anything. If you want confirmation that hdparm is installed, run:

You’ll find that there’s a lot to learn about hdparm, but don’t worry about that. You can check the manual if you want:

See also:

Check Disk Speed In The Terminal

So then, let’s just jump into the article…

Show Your Hard Drive Specifications:

As the title suggests, we’ll be using the terminal for this exercise. Open you terminal now. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, let’s find your disk drives with the following command.

Your drive should look something like this:

lsblk output
You’re looking on the left, at the base directory – such as ‘sda’ or ‘sdb’.

At this point, you want to note the base – the parent disk drive. In the above image, you see two of them. You see both ‘sda’ and ‘sdb’. Your results can be wildly different, but that’s the information you need.

Now it’s time to show the hard drive specifications. To do that, you’ll want to use a command that looks a lot like this:

An example of that command would look like:

The output is pretty verbose and you can learn a great deal about your hard drive specifications by using the hdparm command. As suggested above, don’t be afraid to run man hdparm to learn more because hdparm is a rather robust application..

Closure:

There you have it, you have another article! This time, you’ll have learned a bit about one way to show your hard drive specifications in the Linux terminal. Pretty sweet! So far we’ve been able to maintain that ‘every other day’ schedule.

Anyhow, please don’t frivolously click ads on the site. Google’s just taking the clicks away and is probably taking away some legitimate clicks while doing so. That’s not helpful! I appreciate it, I appreciate that you’ve whitelisted the site, but Google’s convinced I have invalid traffic and there’s not much I can do about it.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Check Disk Speed In The Terminal

In today’s article, we’re going to learn how to check the disk speed in the terminal. When I say ‘disk’ I also mean drives, like SSDs. I could use ‘storage drive’, or perhaps just ‘drive’, but the word ‘disk’ is what I’m going with. So, if you have any questions about other devices – the answer is that it should work just fine if you want to speed test them. 

I should point out that we’ll only be checking disk read speeds. We won’t do any write tests today. We’re just going to see how fast we can read data from the disks we have installed.

There’s a number of ways to check the speed of your disks. You can do so with tools like Gnome Disks or HardInfo, for example. If you’d rather, you can do a full-blown benchmark of your Linux system with GeekBench. This article will explain how to check disk speed in the terminal, because why not? The GUI tools may provide more data, but you don’t always need more data.

The tool we’ll be using for this ‘hdparm’ and it’s available for any major distro out there. In fact, it may be installed by default. So, if you want to get a head start, check to see if you have it installed. If not, go ahead and install it – just like you’d install any other software.

Anyhow, the tool describes itself as:

hdparm – get/set hard disk parameters

Which sums it up nicely. If you check the man page with man hdparm, you’ll see it’s actually pretty complicated. Fortunately, we’ll just be using it to check the disk speed. It can be used to do all sorts of stuff, as you can see from the man page. Perhaps we’ll cover some of that in a future article?

Anyhow, there’s not a whole lot that goes into this. So, let’s jump right in.

Check The Disk Speed In The Terminal:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With the terminal open, you should first identify the disk you’re looking to test. You can list all your attached drives with:

Once you identify the drive you’re looking to check, you’ll almost certainly want to add a /dev/ in front of it – because that’s really where it’s mounted. So, if the disk you want to check is sda1, you’d use /dev/sda1. Even if it says something like /media/<user>/<drive_name>, you’ll still be using /dev/<disk>.

Now, to check the disk speed, you’ll use the following:

That gives you a good example result, including things like buffer and cache. If you want, you can actually check the direct disk speed as well. That just requires the --direct flag. It looks like this:

That’ll give you some results as though you were reading directly from the disk without a buffer involved. It’s an option to check, should you want to. But, you can get a good look at what your disk reads are going to be.

Closure:

That’s actually all there is to it. ‘Snot very difficult. Sure, hdparm is this big complicated application – but you can still use it to check the disk speed in the terminal. You don’t actually have to master all the options of these complicated applications in order to use them. You can still use them, learning more and more options as you use their features as needed.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.