Linux nvme-cli Is To Aid NVME SSD Management

Well, modern-day computers come along with a new format, physical and logical, form called nvme1 way. It is no longer in spindle disk form. It is fast and occupies less space inside the chassis. So, the tool to manage this device is quite different than the way people used to handle and manage the disk previously.

nvme-cli2 is the package that ships with all the Linux distributions and might come in handy. So, go ahead and install it fast. You should be getting it from your chosen distribution’s main repository.

Now, I am going to show you some of the commands this package provides. Some of the commands need very careful steps to be performed or not to be used at all if you are not doing the prescribed task. In other words, some of the commands can prove fatal to play with, if there is no solid reason to invoke them.

nvme list

2024-03-26-095840_1920x143_scrot.png

nvme id-ctrl

2024-03-26-100040_775x344_scrot.png

nvme id-ns

2024-03-26-100318_803x271_scrot.png

nvme smart-log

2024-03-26-100512_1920x1200_scrot.png

nvme error-log

2024-03-26-100703_965x1087_scrot.png

I have stripped the screenshots for the sake of brevity and left them for the reader to use on their terminal to see the full output. Because many of the sub-commands produce quite large output, it is not wise to show here.

Let me give you the entire list from the actual document, where all the commands are mentioned:

nvme version    Display the current version
nvme list       Lists all the NVMe SSDs attached: name, serial number, size, LBA format, and serial
nvme id-ctrl    Discover information about NVMe controller and features it supports
nvme id-ns      Discover optimal namespace size, protection information, LBA size
nvme format     Secure erase the data on an SSD, format an LBA size or protection information for end-to-end data protection
nvme sanitize   Securely eliminate all data on device, cannot be stopped. Supports block, crypto, and overwrite
nvme smart-log  Health of the SSD (critical warning info), temperature, endurance, power on hours and error summary
nvme error-log  A log that contains information about errors encountered
nvme reset      Resets the NVMe controller
nvme create-ns  Create a namespace, can be used for overproviosning an SSD
nvme delete-ns  Remove a namespace
nvme device-self-test   Simple test for health of a drive, pass/fail
nvme fw-download, fw-commit     Download firmware to the drive, update the firmware on the drive
nvme help       Lists all the available commands

You can update the firmware of the SSD with the help of a subcommand.