How to Read SMART Log from NVMe Device on Linux

23302
Share:
how-to-read-smart-log-from-nvme-device-on-linux

After convincing myself that it's worth the price, I took the courage to get an NVMe SSD and install it to my PC. I've considered two strong candidates: Samsung 970 Evo Plus and Adata XPG SX8200. Adata has cheaper price and I'm going to take it, but in last minutes I choose Samsung one because it has bigger TBW so I hope it will be last longer.

NVM Express (NVMe) or Non-Volatile Memory Host Controller Interface Specification (NVMHCIS) is an open logical device interface specification for accessing non-volatile storage media attached via PCI Express (PCIe) bus.

The acronym NVM stands for non-volatile memory, which is often NAND flash memory that comes in several physical form factors, including solid-state drives (SSDs), PCI Express (PCIe) add-in cards, M.2 cards, and other forms. NVM Express, as a logical device interface, has been designed to capitalize on the low latency and internal parallelism of solid-state storage devices.

So I go to computer shop nearby and grabbed Samsung 970 Evo Plus 500GB, open the package and install it to my PC's M.2 slot. Then install Linux Mint 19.3 as my primary Operating System. The OS installation process itself were already quicker than installing on SATA SSD.

When it boots for the first time, I'm so amazed by how quick my PC booted up. The difference from SATA SSD is unbelievable. At a glance, using SATA SSD took 14-16 seconds to boot Linux Mint 19 while using NVMe SSD only took 6-7 seconds. I guess I can justify the extra price because I can't stop smiling when I pressed power button and my PC is ready in no time.

From what I read, the chip on Samsung could runs hot, especially when large I/O operation occurs in the background. Due my big curiosity, one time I want to check if this is the case. I was surprised when I want to check the normal or idle temperature, the "SMART Data & Self-Test" menu wasn't available on gnome-disk-utility.

SMART Data & Self Test menu available on Samsung 860 EVO

SMART Data & Self Test menu unavailable on Samsung 970 EVO Plus

So, how to read SMART Data for NVMe drive on Linux? It turns out you just need to install a tool called nvme-cli. The nvme-cli installation itself is just like any other installation process on Linux:

  1. Open your favorite terminal
  2. Install nvme-cli using your package management tool
  3. Check if it's installed correctly by running nvme smart-log command

Distribution Specific Installation

Ubuntu and Debian based:

$ sudo apt install nvme-cli

Fedora

$ sudo dnf install nvme-cli

CentOS

$ sudo yum install nvme-cli

OpenSUSE

$ sudo zypper install nvme-cli

Arch

$ sudo pacman -S nvme-cli

Read SMART Status

Once the installation process finished, we can read our device SMART Status using this command:

$ sudo nvme smart-log /dev/nvme0

Please note: If you have multiple NVMe devices, adjust your /dev/nvme0 device as needed.

It should output something like this:

nvm smart-log

Final Words

I hope that you now know how to Read SMART Log from NVMe Device on Linux. If you run into any issues or have any feedback feel free to drop a comment below.

Tags
Share:

1 comment

  1. could you please explain what is happening here and why people need to know.

    for example NON!-of the new Ubuntu 18-22 work!

    all load but their are error messages unlike Ubuntu 16 or lower!

    these fall under this category.

    In any Ubuntu 16.22 LTS desktop and all others, when the system starts there is a purple screen, then a blue screen, then a black screen with messages or errors.

    Normally, it states the size and name of your disk drive it is starting and uses the word "CLEAR."

    This happens in less than 1 second and now you will not be able to see these messages using SSD.

    but if you had an old hard drive using a slower rating like SATA 2 instead of 3, then the message would be more readily apparent and last longer on the screen.

    It also displays this at the end when you shut down and is more clearly viewable.

    What is it?
    Where is it stored?
    How do I get a copy of what it's saying?
    it is an error message it is trying to tell me something is wrong but it flashes so fast its unreadable!
    you need a camera to film this to see it!

Leave a reply

Your email address will not be published. Required fields are marked *