Get Your NVMe SSD Information

If you’re using a modern computer, you might be using an NVMe SSD and you might want to know your NVMe information. The standard and older tools may not be all that helpful, even though NVMe SSDs have been around for a while. This article will help you with that, should you want to get your NVMe SSD information.

Let me see if I can explain this…

You’ll often see “NVMe M.2 SSD”, which is a mouthful.

NVMe stands for Non-Volatile Memory Express which is just a specification.

M.2 is another specification for expansion cards.

The device that is used for NVMe is an SSD – Solid State Drive.

SSD, which has been around for quite a while now, differs from previous generations of storage in that it’s electronic and not magnetic. 

We humans have a long history of trying to record things. We’ve used everything from words to pictures, from dots on paper to grooves on wire, from symbols to magnetic, and more…

For computers, a long time was in the magnetic storage age. From spinning drums holding mere bytes of data to complicated spinning platters that hold terabytes of data… We’ve made good use of the magnetic storage mediums over the years.

Solid-state drives don’t use magnets. Data is stored on memory chips that retain their memory (non-volatile) even if the power is disconnected. An SSD is quite common today.

Less common, but growing in popularity, is the NVMe M.2 SSD. This is a much smaller format than the early SSDs (which even came in the 3.5″ format, and surely some obscure formats that I’m overlooking). This is also on a faster bus lane, meaning the read and write speeds far exceed the storage medium before it – including the aforementioned larger SSDs that connect via IDE or (preferably) SATA.

The current consumer options are pretty great and an NVMe SSD is much faster than a regular SSD. The standard SATA SSD is quite common still, while the NVMe M.2 SSD is the latest and greatest.

With me so far?

Well, an NVMe M.2 SSD is a very different architecture and, as such, there are special tools to use. If you want to find the temperature of your NVMe SSD, the normal tools (like hdparm) may not yet work. Instead, there are other tools that you’d want to use.

In this article, we’ll be talking about a tool known as ‘nvme-cli’…

About nvme-cli:

You almost certainly don’t have nvme-cli installed by default. If you did, you’d be able to check the man page. Doing so would show that nvme-cli is described like this:

nvme – the NVMe storage command line interface utility (nvme-cli)

It should be important to know (and we’ll get to the installation step in just a minute) that you’ll be installing the package with one name but referring to, that is using, the application with another name.

For example, it’s man nvme to access the man page. 

NOTE: You will want to read the man page. There’s a whole lot of options and we’re just going to cover one basic command. We’ll learn stuff like the operating temperature of your NVMe. We won’t be worried about the various other options, of which there are many.

Find Your NVMe Information:

If you want to find your NVMe information in the terminal, you can do that. You’ll first need to install a tool known as nvme-cli. To do this, you’ll want an open terminal. You can usually open a terminal by just pressing CTRL + ALT + T

With your terminal now open, you must first install nvme-cli. You’ll find that packages are available for many distros, as they should be as the format is becoming more and more popular. 

Follow one of the basic installation methods below, specifically the one suitable for your distro’s package management system.

Debian/Ubuntu/etc:

SUSE/OpenSUSE/etc:

Fedora/Asahi/etc:

RHEL/CentOS/etc (those with yum available still):

Arch/Manjaro/etc:

I’m pretty sure there’s an nvme-cli package available for all the major Linux distros. If not, I linked to the project page above and you can check there for a package or to compile nvme-cli from source.

Find Your NVMe’s Absolute Path:

You’re going to need the absolute path to where your drive is mounted. That’s a part of the command, so you’ll need that. Just to mix things up a little bit, we’ll use the ‘df’ command. You should have df installed automatically on any major distro. The man page will helpfully describe the df application like so:

df – report file system disk space usage

We don’t care about all that. We just care about the absolute path. This usually starts with /dev/ and ends with the device ID. In an NVMe’s case, it will usually include nvme in the title, which is quite helpful.

So, let’s get that information…

You’ll get an output similar to this one:

It should be obvious that the absolute path for this would be /dev/nvme0n1p1 and that’s the data we’re going to need.

Now, to find your NVMe information, the syntax would be like so:

Using the output from above, an example of that would be:

This will then give you an output like so:

nvme status in the terminanl
There you go, you now have your NVMe Information. It’s not too difficult to do.

Of course, you can pipe this output to other commands. Let’s say you wanted to know the current temperature of your NVMe SSD. You’d do that with the grep command. An example would be:

If you want to know the number of times you’ve powered the device on, you can do that by piping the output to grep again. For example:

So, you can use the nvme-cli application (the nvme command) for quite a bit. You can do a whole lot more with it, so be sure to check the man page if you’re interested in doing more than checking the temperature or how many times you’ve cycled the power on that device.

As NVMe SSDs get more common, you’ll likely start seeing this package installed by default. From what I can see right now, no major distro is including this by default. If you’re using an NVMe M.2 SSD, you might just want to install it. If nothing else, it’s yet another tool that might come in handy.

Closure:

Today’s article is a bit longer than some but I think it’s worth reading. If I didn’t think it was worth reading, I wouldn’t have written as much! There’s so much that I could have covered but I didn’t. Articles have to have only so many words before people lose interest.

I’d have loved to cover the history of computer memory (or perhaps even more about how we humans have recorded stuff) but that didn’t seem prudent. I figured I’d limit the number of words to 1,200, but I still managed to exceed that – though not by too many. Seriously, it’s a pretty fascinating bit of history. You should use Google (and/or YouTube) to see learn about all the different ways we’ve stored data, and that’s just scratching the surface!

Fascinating stuff, I tell you! Fascinating!

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.

Monitor Disk Usage With GDU

I probably shouldn’t say ‘disk’ but I think we’ll all agree that we know what I mean and today we’ll monitor disk usage with ‘gdu’. It’ll be fun! It won’t even be all that complicated! Read on and learn how to monitor disk usage with gdu. It won’t hurt!

If you’re using your storage, you might want to monitor your disk usage. If you’re running low on disk space,  you might want to find out what’s using your disk space so that you can address that. Suffice it to say, that Linux is less than happy when you run low on disk space. Running out of disk space may even prevent system booting and you’ll have to go about it with a live instance, which nobody likes doing.

Oh, I’m sure I’ve covered this before. There are all sorts of tools you can use to monitor disk usage. Some are faster than others and gdu is not one of them. No, no… It’s not fast. But, it’s an option!

Speaking of options to monitor your disk usage, I’ve covered this before!

Show Disk Usage With ‘ncdu’
How To: Check Disk Usage With ‘df’
A Few Ways To Visualize Disk Usage In Linux
How To: Find Large Files Using ‘ncdu’

You might ask yourself why I’m covering this again. The answer is that I like to give you choices. The goal is to bring you up to speed, making you more efficient with your Linux usage. I want to make Linux more approachable for the novice (while still sharing stuff with the experienced users) and one of the ways to do that is to show you the variety of tools available. That way you can pick and choose among the choices. You can pick which works best for you.

In this case, we’ll be using an application known as GDU.

More On GDU:

The tool we’ll be using is known as ‘gdu‘. I’ll explain how to install gdu in Debian-based distros (like Ubuntu or Linux Mint), but you can find packages to install gdu easily. It’s easy to install, trust me.

I assume ‘gdu’ stands for ‘Go disk usage’, with ‘Go’ referring to the programming language and not for a space on a Monopoly board. It is a supposition because the man page and repository say nothing on the matter.

Once you do have gdu installed, you’ll be able to check the man page. Doing so will show you that gdu is described like so:

I might argue the ‘pretty fast’ bit but I’m too lazy to compare and provide actual data. It took quite a while when I ran the application with instructions to scan my entire system (complete with external drives). I got distracted but this is a timed output:

I don’t think it’s all that speedy – but it’s neat. So, there’s that. Which is nice.

Still, it’s the correct tool for the job. Well, it’s a correct tool for the job. As you can see from the links above, there are many correct tools for the job. This is just one of them.

So then, let’s get this installed and use it…

Monitor Disk Usage With GDU:

You know it’s true. This application is terminal-based so you’ll need an open terminal. As I’m writing this for Debian distributions, you can usually just press CTRL + ALT + T to open up your default terminal.

Your command will differ if you’re not using apt. If you’re using apt, you can install gdu with this command:

When you’ve installed gdu, you can navigate to a directory and run the command like this:

You can also run gdu with a specified directory.

An example output would look like this:

Checking disk space with gdu...
This is gdu in the terminal. You can probably figure it out from here. Yes, I have weird stuff.

You use your arrow keys to navigate. If you have any questions, press the question mark. There’s nothing advanced to it. If you wish to exit gdu, press CTRL + C and gdu will terminate properly.

Closure:

There you have it. You’re now using gdu to monitor disk usage. Well, you’re doing so in Debian-based distros. You’ll have to figure it out for your distro but they have packages and binary files available for others. It’s a pretty handy application, even though it’s not all that speedy.

Granted, as far as speed goes, I didn’t compare it with other applications. It doesn’t seem to be all that quick, but it does do the job as intended. It’s a handy way to visualize disk usage in the terminal and a tool worth testing.

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.

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.

Monitor USB Bandwidth

Most of us use USB devices regularly, even using USB thumb drives to install Linux, and today we’ll learn how to monitor USB bandwidth. What we don’t tend to do is monitor the bandwidth of our USB devices. Today, we’ll be doing that and just that. It shouldn’t be a long article.

When I say bandwidth, you could also say throughput, I speak of the speeds at which data moves from one place to another. In this case, it’s the speeds supported by your USB devices.

When you move data from one place to another, it does so at various speeds. These days, you have better speeds with USB devices, now that we have USB 3.1 and USB C. Those are pretty speedy.

If you don’t know, USB stands for Universal Serial Bus and USB has been around since 1996. There are a number of standards for transferring things across the bus lines and USB is just one of them. USB is a ratified standard that gives us uninversal connections shared among manufacturers. There’s even USB4 that I’m entirely unfamiliar with.

I suppose I don’t really need to explain this. We all understand USB well enough, I’d think. Still, we may not know some of the details and we may have never thought about monitoring USB bandwidth. Well, that’s what we’re doing and we’ll be doing it in the terminal.

What will we be using?

usbtop:

We’ll be using a nifty application known as ‘usbtop’ for this exercise. While there’s a tiny bit more to it than we’ll cover, we’ll at least use it to monitor USB bandwidth. If the ‘top’ aspect looks familiar, it should. This usbtop is familiar in the sense of top, htop, or atop. All of which are applications I should cover but haven’t. If you’re already familiar with those, you’ll have the right sort of expectations.

The usbtop application runs in the Linux terminal. I know that it’s available for more than just the Ubuntu family, but I’ll be testing this in Linux Mint. That’s just the device I’m using at the moment, though I’d normally be using Lubuntu.

If you’re using Linux Mint (or Debian, Ubuntu, Lubuntu, or even ElementaryOS) you can install usbtop easily. I had to refer to the Arch AUR page for this article, so I’m sure this is available elsewhere – though I think it might be in AUR for Arch derivatives like Mandriva.

But, seeing as we’re using Linux Mint, you can install usbtop with this command:

(Don’t try running it just yet. It won’t work properly.)

Once installed, you can type man usbtop to read the manual but that doesn’t appear to do a darned thing. No, I do not know why. If you want, you can try something like gibberish – like usbtop -help which won’t actually work but will be kind enough to spit out the two options you have with this usbtop application.

Monitor USB Bandwidth:

Well, I’ll assume you were able to run the installation command above. It’s run in the terminal. If you go this far, you didn’t need help opening the terminal. See? You’re getting better with this Linux stuff already!

Now, it’s not going to run. Feel free to try it. If you try, it will spit out an error that looks remarkably similar to this:

No USB bus can be captured thanks to libpcap. Check your name filter and make sure relevent permissions are set !

Don’t blame me. I’m just the messenger. Instead, start with this command:

Now you can run the following command:

Yes, you want elevated permissions to run usbtop.

With usbtop now up and running, you can try transferring something to a USB drive, or something from one USB drive to another USB drive, or anything involving your USB drive. You can even start up a USB webcam and monitor the bandwidth that uses.

I took a crappy screenshot… You’re welcome!

monitor USB bandwidth with usbtop
See? It’s easy enough to monitor USB bandwidth with usbtop. It’s not too difficult to use.

If you want to exit that screen, press CTRL + C. For some reason, the Q doesn’t quit. Then again, what do you expect from a project that can’t even sort out their man page. So, it is what it is. Again, don’t blame me. I’m just the messenger!

Nah, it’s a perfectly usable application. It doesn’t do much. You can expect it to do what it says and just what it says. If you checked the fake help page above, you’ll see that you can monitor a single device and you can list the devices. Those can be monitored individually, but you might as well monitor USB bandwidth on all the devices at once. It’s not too confusing, I swear.

Closure:

Well, now you know how to monitor USB bandwidth. I’m sure the application is available for other distros, but I did not test that. If you do test that, feel free to leave comments so that other people can learn from your labor. It’s a community, so share the wealth of knowledge in a comment.

I promise, it won’t be used as a way to spam you. I’ve been almost 500 articles and I’ve never spammed anyone so far – even with hundreds of comments and a bunch of people signed up to the newsletter. I just don’t see me violating that trust. If I ever do have a commercial message, it’ll just get attached to the newsletter – like a sponsor or something like that.

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.

Reboot From The Terminal

The weather has had a bit of an impact on my internet connection, so this is just going to be a quick article about how you reboot from the terminal. I want to schedule this as soon as possible, so it’ll be a fairly low-effort article. This should not take long!

There are times when you may want to know how to reboot from the terminal. Then, there are times when you can’t access a GUI, and using the terminal is the cleanest method of rebooting your computer. Knowing how to reboot from the terminal might be a skill worth having. I’ll show you a couple of quick and easy ways to do this.

As the title says, this is going to take place in the terminal. You can usually just press CTRL + ALT + T to open your default terminal. You could otherwise reboot with REISUB.

So, with your terminal open…

Reboot With systemd:

The first command we’ll use to reboot your computer. We’ll be using systemd. This will only work if you’re using a distro with systemd.

Reboot With shutdown:

It should be fairly obvious that the shutdown command can be used to reboot your computer. This is one of the generic utilities, so you won’t need to install anything.

(Check the man page because there are a lot of options available.)

Reboot With reboot:

Finally, we’ll use the reboot command to reboot your computer. This might be the easiest to remember and you shouldn’t need to install anything new. You need the following command:

In some distros, you can drop the ‘now’ and the command will still reboot your computer immediately. 

Closure:

So, there you have it. You have a new article and it should even be published on time. It’s not a long article. The subject is easy enough. You’ll never know when you need to reboot from the terminal, and now you do.

Ah well…

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.