Today’s article is going to just be a nice and easy article, one that shows you how to test your drive speed in the Linux terminal. It’s easier than you might think and even easy enough that a new Linux user can figure this one out.
Why would you want to do this? Why would you want to test your drive speed in the Linux terminal?
Well, while there are surely GUI ways to accomplish this, you might want to verify that you’re getting the disk speed you paid for. You might also just want to know your drive’s speeds or perhaps you want to post your drive speed on a forum for bragging rights? These terminal commands will also be pretty much universal, across all distros.
It doesn’t matter why you want to test your drive speed, it just matters that you can test it – and that you’ll now know how. And, you know what they say? Knowledge is power!
So, what will we be doing?
Well, we’ll be using the Linux terminal to check how fast we can read and write data to your drives, no matter if they’re spinning platter hard disk drives or solid state drives. The commands will be the same for all drive types and are fairly easy to learn.
So, with all that said and done, let’s get into the article…
Test Your Drive Speed In The Linux Terminal:
Of course, this article will require an open terminal. On Linux-Tips we do a lot in the terminal. It’s fun and fairly universal. If you don’t know how to open the terminal, you can do so with your keyboard – just press
With your terminal open, you’ll want to run the following command to identify the drive you want want to test. That’s nice and easy, just run:
You’re looking for something like
/dev/sda1 or something like
/dev/nvme0n1p1 and the
lsblk command might help you narrow down which drive it is you want to test.
Once you have identified the drive you want to speed test, you can begin testing. You can first try testing the write speed, that is how fast you can write data to the drive. To do that, you’re command would look like:
sudo dd if=/dev/zero of=/drive/path bs=4k count=10000000
For example, if you had ‘
sda1‘, your command would look like:
sudo dd if=/dev/zero of=/dev/sda1 bs=4k count=10000000
That will tell you how quickly you can write data to your drive, a pretty handy number to know. However, that’s only half of the equation…
You might also want to know how fast you can read data to the drive, the other half of the equation. The command to find the read speed is pretty similar to the command to read the write speed – and that command would look a little something like this:
sudo dd if=/drive/path of=/dev/null bs=4k count=1000000
Or, again, if you want an example of how to test the speed at which you can read data from your drive, an example command would look a little like this:
sudo dd if=/dev/sda1 of=/dev/null bs=4k count=1000000
Note the difference between the commands. In the latter command, we’re writing data from the disk (reading it) and sending it to the bit bucket. With the write command, we’re going the opposite direction. In one case you’re writing from
/dev/null and in another case you’re writing to
/dev/null. Pretty easy, huh?
There it is! This is actually the 301st article written for Linux-Tips.US! This time around we learned how to test your drive speed in the Linux terminal. I told you that it wasn’t too complicated and I stand by it. If you just follow the directions, you’ll learn how to test your drive speed and have another tool in your toolbox.
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.