Linux nvme-cli Is To Aid NVME SSD Management
March 26, 2024 Leave a comment
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
nvme id-ctrl
nvme id-ns
nvme smart-log
nvme error-log
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.