How to check serial number of NVMe disk?

23,844

Solution 1

The nvme tool provides options to obtain NVME device information, for example, to install the tool, list the NVME devices and look at the id control fields on /dev/nvme0n1, one would use:

sudo apt-get install nvme-cli
sudo nvme list
sudo nvme id-ctrl /dev/nvme0n1

Solution 2

Note that there are 2 kinds of M.2 drives - the NVME and the MSATA - and they present completely different interfaces.

This is as evidenced by the completely different dev device name: /dev/sd? for MSATA, and /dev/nvme0n1 for NVMe.

If you download smartmontools 6.6, it has experimental NVME support built in and can show serial number as I remember. (smartctl -a, again IIRC).

Otherwise, for NVMe drives you indeed need the nvme-cli tools to be able to do anything more than smartctl can do.

Share:
23,844

Related videos on Youtube

Hash Doe
Author by

Hash Doe

Updated on September 18, 2022

Comments

  • Hash Doe
    Hash Doe over 1 year

    How to check serial number of NVMe disk?

    To check serial number for sda and sdb I used:

    sudo lsblk --raw -o name,type,serial
    

    However it does not work for NVMe disks (nvme0n0, nvme0n1 etc). No information about serial number is provided.

    • VZ.
      VZ. about 4 years
      Note that newer versions of lsblk (e.g. mine is from util-linux 2.33.1) do return the serial number for NVMe disks too.
  • Hash Doe
    Hash Doe almost 8 years
    I am able to check serial for sda and sdb. I cannot check for nvme disks (nvme0n1 , nvme1n1 etc)
  • Amias
    Amias almost 8 years
    is there an error message ?
  • Hash Doe
    Hash Doe almost 8 years
    No, there is only information about name and type, serial number is not provided.
  • Amias
    Amias almost 8 years
    ok it looks like they don't support this mechanism , it could be because they are they own controllers. maybe lspci might help , the more -v's you give it the more info it gives you.
  • Ashish Ratan
    Ashish Ratan over 3 years
    /dev/nvme0n1: HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device HDIO_GET_IDENTITY failed: Inappropriate ioctl for device
  • Amias
    Amias over 3 years
    edlib: nvme is a bit different from MSATA , it doesn't pretend to be hard disk so its likely doesn't support SMART , maybe lspci