NVMe Command

Nam Luong
Nam Luong
  • Updated

Document Scope

The NVMe command is a helpful tool that can print useful hardware status and information from installed NVMe devices. This troubleshooting data would be the NVMe equivalent of SMART testing for SATA drives. This article will list a few common uses of this command.

Prerequisites

Please note that you will need root privileges to both install and use these NVMe commands. This can be done as root directly or using sudo. For this guide, all commands will assume sudo.

Installation

CentOS
sudo yum install nvme-cli
Ubuntu
sudo apt install nvme-cli
For a full list of all available sub-commands as well as usage, you can run:
nvme help
List NVMe devices
exx@exx:~$ sudo nvme list
Node SN Model Namespace Usage Format FW Rev
--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1 VB1234-56789 ORCL-VBOX-NVME-VER12 1 10.74 GB / 10.74 GB 512 B + 0 B 1.0
/dev/nvme0n2 VB1234-56789 ORCL-VBOX-NVME-VER12 2 10.74 GB / 10.74 GB 512 B + 0 B 1.0
exx@exx:~$
The 'lsblk' command can be utilized to promptly view all installed drives and partitions.
exx@exx:~$ lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0         7:0    0 55.4M  1 loop /snap/core18/1944
loop1         7:1    0 69.9M  1 loop /snap/lxd/19188
loop2         7:2    0 31.1M  1 loop /snap/snapd/10707
loop3         7:3    0 55.5M  1 loop /snap/core18/1988
loop4         7:4    0 32.3M  1 loop /snap/snapd/11107
sda           8:0    0 12.8T  0 disk
└─sda1        8:1    0 12.8T  0 part /data
nvme0n1     259:0    0  477G  0 disk
└─nvme0n1p1 259:2    0  477G  0 part /scr
nvme1n1     259:1    0  477G  0 disk
├─nvme1n1p1 259:3    0  512M  0 part /boot/efi
├─nvme1n1p2 259:4    0  500M  0 part /boot
├─nvme1n1p3 259:5    0   10G  0 part [SWAP]
└─nvme1n1p4 259:6    0  466G  0 part /
exx@exx:~$

NVMe smart-log output

To obtain the current temperature and critical warnings for a specific NVMe device, execute the below command as root. For example, for an NVMe device with name nvme0n1:
exx@exx:~$ sudo nvme smart-log /dev/nvme0n1
Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning : 0x6
temperature : -273 C (0 Kelvin)
available_spare : 0%
available_spare_threshold : 0%
percentage_used : 0%
endurance group critical warning summary: 0
data_units_read : 2,596,063,919,927,509,106,584,251,910,848,512
data_units_written : 2,596,063,919,927,509,106,724,989,399,203,840
host_read_commands : 2,596,063,919,928,117,849,279,421,814,407,168
host_write_commands : 2,596,063,919,927,509,106,724,989,399,203,840
controller_busy_time : 140,732,907,095,087
power_cycles : 0
power_on_hours : 0
unsafe_shutdowns : 110
media_errors : 0
num_err_log_entries : 202,914,184,810,805,067,968
Warning Temperature Time : 4294967295
Critical Composite Temperature Time : 4294967295
Temperature Sensor 5 : 397 C (670 Kelvin)
Thermal Management T1 Trans Count : 568935010
Thermal Management T2 Trans Count : 32516
Thermal Management T1 Total Time : 4294967295
Thermal Management T2 Total Time : 32766
exx@exx:~$

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.