NVMe command is a helpful that can print useful hardware status and information from installed NVMe devices. Will list a few common use of this command here. You will need to be root to both install and use these commands.
Installation
CentOS
sudo yum install nvme-cli
Ubuntu
sudo apt install nvme-cli
Full list of commands, you can use 'nvme -h'
List NVMe devices
List NVMe devices
#I purposely 'x'ed out the last 5 digits in each SN# listed root@exx:/home/exx# nvme list Node SN Model Namespace Usage Format FW Rev ---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- /dev/nvme0n1 1936242xxxxx Micron_2200_MTFDHBA512TCK 1 512.11 GB / 512.11 GB 512 B + 0 B P1MU003 /dev/nvme1n1 1936242xxxxx Micron_2200_MTFDHBA512TCK 1 512.11 GB / 512.11 GB 512 B + 0 B P1MU003
This is not exclusive to NVMe, but here is also a command example to quickly view ALL installed drives and partitions:
lsblk
root@exx:/home/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 /
NVMe smart-log output
You can find current NVMe device temperature and critical warnings as long as you know which NVMe device you need the output from.
You need to run these with 'root' permission.
If CentOS
su <root password>
If Ubuntu
sudo bash <root password>
Then target your NVMe device with this command:
Example
sudo nvme smart-log <device name> sudo nvme smart-log /dev/nvme0n1