Gather Storage Disk Information With ‘smartctl’

This will be a fairly universal article, useful for various distros, for those who want to gather storage disk information with smartctl. This is not a very taxing article, and more could be written, but we’ll simply be using smartctl to gather basic storage device information.

Habit means I want to type ‘hard disk’. I’ll refrain from doing so. I guess I could call them ‘storage drives’ but I’m just going to call them ‘storage disks’, or ‘disk’ when I am referring to the singular.

This isn’t going to get you information about the health of your storage disks or anything like that. Depending on the disk, it will give you information about things like the physical size, trim status, serial number, RPM (for spinning disks), and things like that.

The tool we’ll be using is smartctl, but that’s installed by installing smartmontools. This is going to be an easy install for many distros and I’ll try to detail that as best as I am able.

smartctl:

The tool we’ll be using is smartctl and it’s a terminal-based application. This tool is useful for a variety of things. We’ll just be gathering basic information about our storage drives. 

If you had smartctl installed already, you could check the man page. Doing so would reveal that the application is described like so:

smartctl – Control and Monitor Utility for SMART Disks

I suppose this could be considered controlling the drives (they’re not all disks anymore) but it’s definitely the tool for the job. Trust me on this! I wouldn’t steer you wrong, at least not intentionally. Oh, I do make mistakes, but they’re mostly harmless.

We’ve previously used this tool. Here’s a couple of articles for you:

How To: Check A Disk For Errors
How To: Use S.M.A.R.T. To Check Disk Health

So, in the weirdness of weirdness, if you want to use smartctl, you have to first install smartmontools. So, let’s cover that…

smartmontools:

First, you’re going to need to install smartmontools. We’ll cover how to do this, but it will be done via the terminal. You can use your GUI installer or you can (more often than not) just press CTRL + ALT + T and your default terminal will open.

With your terminal now open, pick the correct command to match your distro:

Debian/Ubuntu/etc:

OpenSUSE/SUSE/etc:

RHEL/CentOS/etc:

Arch/Manjaro/etc:

If you use a mainstream distro, one of the above commands should install smartmontools and give you access to smartctl. There are other distros out there, but I think I’ve covered those appropriately.

Find Storage Information In Linux:

From here on out, the rest is pretty easy. With smartmontools installed, you can check the man page with this command:

The flag we’re interested in would be the -i flag.

Before we go any further, we must first identify the disks we want to learn more about. For that, we’ll run the following command: 

Here’s an example output:

We’re not interested in partitions. We’re just interested in physical disks. (Now that I’m this far through the article, I should have stuck with ‘drives’ instead of disks.) 

If you pay attention to the output, you’ll see that the information we’re after is stuff like sda, sdb, or sdc. Those are all in the /dev/ directory which means that we can check storage disk information with this syntax:

Or, to provide an example…

This is a pretty good way to gather storage disk information. Here’s an example of the output from the previous command:

See? All sorts of information is available behind a simple terminal command! This is even something you can memorize in just a few minutes.

Closure:

I’m not sure when you’ll want to know this information, but it’s information and it is information that’s easily available to you. You simply need to install an application and run the commands listed above. I’m sure you can figure this out. 

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.

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