Today’s article aims to answer a simple question, simply is your storage drive an SSD or an HDD? This is not something most folks will have trouble knowing, but it’s still something worth knowing how to do. After all, you never know when you’ll be attached to a remote computer with disks of different types.
And, yes, due to expense and sizes, HDDs still exist and are still in use all over the place. Not everything has been converted to an SSD.
We’ve relied on spinning media for quite some time. We used this in hard disk drives. They were the norm for many years. SSDs (solid-state drives) are more common in end-user computers these days. If you can, you might even have an NVME SSD which is exceptionally fast.
We’re only going to use one command in this article, so it will be quite short. That’s not a bad thing. Not every article needs to be all that long.
We’ll simply be using the cat command. We’ve used this command many times in the past because it’s a handy command to use!
The cat command is a command used in the terminal. We want to read a file and cat is the correct tool for the job. The cat command reads a file and sends the output to the terminal. You won’t need to install anything.
Let’s check the man page (with man cat) to see:
cat – concatenate files and print on the standard output
See? If we want to read a file to the terminal, this is the correct tool for the job. Again, you won’t need to install anything.
Like oh so many articles, you will need an open terminal. Just press CTRL + ALT + T and your default terminal should open.
With your terminal open, let’s see if you’ve got an SSD or an HDD.
First, identify your drives with this command:
lsblk
Now, ignoring the partitions, you can run the following command:
cat /sys/block/<drive_ID>/queue/rotational
So, for example, you’d run this command:
cat /sys/block/sda/queue/rotational
And here’s an example output:
$ cat /sys/block/sda/queue/rotational 0
The zero means that it’s an SSD.
If we run this command against a drive that I know is an HDD (a plugged-in external HDD that’s used for backups and storage):
$ cat /sys/block/sdb/queue/rotational 1
The 1 means that it is a spinning HDD.
So, if you have both you can now distinguish between an SSD and an HDD.
So, now you know how to tell if your device is an SSD or an HDD. This is something easily determined. If you have questions about your storage, this will help answer those questions. I’m not sure that I’d memorize this command, but it’s worth adding to your notes.
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.
Today we'll cover one way to enable or disable your network interface in the Linux…
Today's exercise is a nice and simple exercise where we check your NIC speed in…
Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…
I think I've covered this before with the ls command but this time we'll count…
Today we'll be learning about a basic Linux command that's known as 'uname' and it…
If you've used hardinfo in the past, it may interest you to know that hardinfo…