Categories
SysOps

How to display information about NVMe storage device

Display information about NVMe storage device.

You cannot display the identification information for NVMe storage device using hdparm utility.

$ sudo hdparm -i /dev/nvme0n1
/dev/nvme0n1:
 HDIO_GET_IDENTITY failed: Inappropriate ioctl for device

Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.)

Install smartmontools package.

$ sudo apt install smartmontools

Display smartcl version.

$ smartctl --version
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.0-23-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

smartctl comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are welcome to redistribute it under
the terms of the GNU General Public License; either
version 2, or (at your option) any later version.
See http://www.gnu.org for further details.

smartmontools release 7.2 dated 2020-12-30 at 16:48:30 UTC
smartmontools SVN rev 5155 dated 2020-12-30 at 16:49:18
smartmontools build host: x86_64-pc-linux-gnu
smartmontools build with: C++17, GCC 11.2.0
smartmontools configure arguments: '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--build=x86_64-linux-gnu' '--host=x86_64-linux-gnu' '--prefix=/usr' '--sysconfdir=/etc' '--mandir=/usr/share/man' '--with-initscriptdir=no' '--docdir=/usr/share/doc/smartmontools' '--with-attributelog=/var/lib/smartmontools/attrlog.' '--with-drivedbdir=/var/lib/smartmontools/drivedb' '--with-exampledir=/usr/share/doc/smartmontools/examples/' '--with-savestates=/var/lib/smartmontools/smartd.' '--with-smartdplugindir=/etc/smartmontools/smartd_warning.d' '--with-smartdscriptdir=/usr/share/smartmontools' '--with-systemdenvfile=/etc/default/smartmontools' '--with-systemdsystemunitdir=/lib/systemd/system' '--with-libsystemd=auto' '--with-selinux' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CXXFLAGS=-g -O2 -ffile-prefix-map=/build/smartmontools-7teSgE/smartmontools-7.2=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -Wall' 'LDFLAGS=-Wl,-Bsymbolic-functions -flto=auto -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CFLAGS=-g -O2 -ffile-prefix-map=/build/smartmontools-7teSgE/smartmontools-7.2=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fsigned-char -Wall'

Display help information.

$ smartctl --help
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.0-23-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

Usage: smartctl [options] device

============================================ SHOW INFORMATION OPTIONS =====

  -h, --help, --usage
         Display this help and exit

  -V, --version, --copyright, --license
         Print license, copyright, and version information and exit

  -i, --info
         Show identity information for device

  --identify[=[w][nvb]]
         Show words and bits from IDENTIFY DEVICE data                (ATA)

  -g NAME, --get=NAME
        Get device setting: all, aam, apm, dsn, lookahead, security,
        wcache, rcache, wcreorder, wcache-sct

  -a, --all
         Show all SMART information for device

  -x, --xall
         Show all information for device

  --scan
         Scan for devices

  --scan-open
         Scan for devices and try to open each device

================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS =====

  -j, --json[=cgiosuvy]
         Print output in JSON or YAML format

  -q TYPE, --quietmode=TYPE                                           (ATA)
         Set smartctl quiet mode to one of: errorsonly, silent, noserial

  -d TYPE, --device=TYPE
         Specify device type to one of:
         ata, scsi[+TYPE], nvme[,NSID], sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N], usbprolific, usbsunplus, sntjmicron[,NSID], sntrealtek, intelliprop,N[+TYPE], jmb39x[-q],N[,sLBA][,force][+TYPE], jms56x,N[,sLBA][,force][+TYPE], marvell, areca,N/E, 3ware,N, hpt,L/M/N, megaraid,N, aacraid,H,L,ID, cciss,N, auto, test

  -T TYPE, --tolerance=TYPE                                           (ATA)
         Tolerance: normal, conservative, permissive, verypermissive

  -b TYPE, --badsum=TYPE                                              (ATA)
         Set action on bad checksum to one of: warn, exit, ignore

  -r TYPE, --report=TYPE
         Report transactions (see man page)

  -n MODE[,STATUS], --nocheck=MODE[,STATUS]                     (ATA, SCSI)
         No check if: never, sleep, standby, idle (see man page)

============================== DEVICE FEATURE ENABLE/DISABLE COMMANDS =====

  -s VALUE, --smart=VALUE
        Enable/disable SMART on device (on/off)

  -o VALUE, --offlineauto=VALUE                                       (ATA)
        Enable/disable automatic offline testing on device (on/off)

  -S VALUE, --saveauto=VALUE                                          (ATA)
        Enable/disable Attribute autosave on device (on/off)

  -s NAME[,VALUE], --set=NAME[,VALUE]
        Enable/disable/change device setting: aam,[N|off], apm,[N|off],
        dsn,[on|off], lookahead,[on|off], security-freeze,
        standby,[N|off|now], wcache,[on|off], rcache,[on|off],
        wcreorder,[on|off[,p]], wcache-sct,[ata|on|off[,p]]

======================================= READ AND DISPLAY DATA OPTIONS =====

  -H, --health
        Show device SMART health status

  -c, --capabilities                                            (ATA, NVMe)
        Show device SMART capabilities

  -A, --attributes
        Show device SMART vendor-specific Attributes and values

  -f FORMAT, --format=FORMAT                                          (ATA)
        Set output format for attributes: old, brief, hex[,id|val]

  -l TYPE, --log=TYPE
        Show device log. TYPE: error, selftest, selective, directory[,g|s],
        xerror[,N][,error], xselftest[,N][,selftest], background,
        sasphy[,reset], sataphy[,reset], scttemp[sts,hist],
        scttempint,N[,p], scterc[,N,M], devstat[,N], defects[,N], ssd,
        gplog,N[,RANGE], smartlog,N[,RANGE], nvmelog,N,SIZE

  -v N,OPTION , --vendorattribute=N,OPTION                            (ATA)
        Set display OPTION for vendor Attribute N (see man page)

  -F TYPE, --firmwarebug=TYPE                                         (ATA)
        Use firmware bug workaround:
        none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid

  -P TYPE, --presets=TYPE                                             (ATA)
        Drive-specific presets: use, ignore, show, showall

  -B [+]FILE, --drivedb=[+]FILE                                       (ATA)
        Read and replace [add] drive database from FILE
        [default is +/etc/smart_drivedb.h
         and then    /var/lib/smartmontools/drivedb/drivedb.h]

============================================ DEVICE SELF-TEST OPTIONS =====

  -t TEST, --test=TEST
        Run test. TEST: offline, short, long, conveyance, force, vendor,N,
                        select,M-N, pending,N, afterselect,[on|off]

  -C, --captive
        Do test in captive mode (along with -t)

  -X, --abort
        Abort any non-captive test on device

=================================================== SMARTCTL EXAMPLES =====

  smartctl --all /dev/sda                    (Prints all SMART information)

  smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda
                                              (Enables SMART on first disk)

  smartctl --test=long /dev/sda          (Executes extended disk self-test)

  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda
                                      (Prints Self-Test & Attribute errors)
  smartctl --all --device=3ware,2 /dev/sda
  smartctl --all --device=3ware,2 /dev/twe0
  smartctl --all --device=3ware,2 /dev/twa0
  smartctl --all --device=3ware,2 /dev/twl0
          (Prints all SMART info for 3rd ATA disk on 3ware RAID controller)
  smartctl --all --device=hpt,1/1/3 /dev/sda
          (Prints all SMART info for the SATA disk attached to the 3rd PMPort
           of the 1st channel on the 1st HighPoint RAID controller)
  smartctl --all --device=areca,3/1 /dev/sg2
          (Prints all SMART info for 3rd ATA disk of the 1st enclosure
           on Areca RAID controller)

Display device identification data.

$ sudo smartctl --info /dev/nvme0n1
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.0-23-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       SAMSUNG MZVLB512HBJQ-000L7
Serial Number:                      S4ENNX0R210637
Firmware Version:                   5M2QEXF7
PCI Vendor/Subsystem ID:            0x144d
IEEE OUI Identifier:                0x002538
Total NVM Capacity:                 512,110,190,592 [512 GB]
Unallocated NVM Capacity:           0
Controller ID:                      4
NVMe Version:                       1.3
Number of Namespaces:               1
Namespace 1 Size/Capacity:          512,110,190,592 [512 GB]
Namespace 1 Utilization:            34,063,511,552 [34.0 GB]
Namespace 1 Formatted LBA Size:     512
Namespace 1 IEEE EUI-64:            002538 8211b67f9f
Local Time is:                      Thu Jan  6 21:45:32 2022 CET

Display health status.

$ sudo smartctl --health /dev/nvme0n1 
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.0-23-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

Display generic SMART capabilities.

$ sudo smartctl --capabilities /dev/nvme0n1 
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.0-23-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Firmware Updates (0x16):            3 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Log Page Attributes (0x03):         S/H_per_NS Cmd_Eff_Lg
Maximum Data Transfer Size:         512 Pages
Warning  Comp. Temp. Threshold:     84 Celsius
Critical Comp. Temp. Threshold:     85 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     8.00W       -        -    0  0  0  0        0       0
 1 +     6.30W       -        -    1  1  1  1        0       0
 2 +     3.50W       -        -    2  2  2  2        0       0
 3 -   0.0760W       -        -    3  3  3  3      210    1200
 4 -   0.0050W       -        -    4  4  4  4     2000    8000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0

Display vendor specific SMART Attributes.

$ sudo smartctl --attributes /dev/nvme0n1 
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.0-23-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF SMART DATA SECTION ===
SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        32 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    0%
Data Units Read:                    77,639 [39.7 GB]
Data Units Written:                 184,980 [94.7 GB]
Host Read Commands:                 740,935
Host Write Commands:                1,388,541
Controller Busy Time:               7
Power Cycles:                       40
Power On Hours:                     11
Unsafe Shutdowns:                   4
Media and Data Integrity Errors:    0
Error Information Log Entries:      98
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Temperature Sensor 1:               32 Celsius
Temperature Sensor 2:               29 Celsius

Display the summary SMART error log.

$ sudo smartctl --log error /dev/nvme0n1 
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.0-23-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF SMART DATA SECTION ===
Error Information (NVMe Log 0x01, 16 of 64 entries)
Num   ErrCount  SQId   CmdId  Status  PELoc          LBA  NSID    VS
  0         98     0  0x1011  0x4004      -            0     0     -

Display all SMART information.

$ sudo smartctl --all /dev/nvme0n1
smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.13.0-23-generic] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number:                       SAMSUNG MZVLB512HBJQ-000L7
Serial Number:                      S4ENNX0R210637
Firmware Version:                   5M2QEXF7
PCI Vendor/Subsystem ID:            0x144d
IEEE OUI Identifier:                0x002538
Total NVM Capacity:                 512,110,190,592 [512 GB]
Unallocated NVM Capacity:           0
Controller ID:                      4
NVMe Version:                       1.3
Number of Namespaces:               1
Namespace 1 Size/Capacity:          512,110,190,592 [512 GB]
Namespace 1 Utilization:            34,063,503,360 [34.0 GB]
Namespace 1 Formatted LBA Size:     512
Namespace 1 IEEE EUI-64:            002538 8211b67f9f
Local Time is:                      Thu Jan  6 21:44:36 2022 CET
Firmware Updates (0x16):            3 Slots, no Reset required
Optional Admin Commands (0x0017):   Security Format Frmw_DL Self_Test
Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Timestmp
Log Page Attributes (0x03):         S/H_per_NS Cmd_Eff_Lg
Maximum Data Transfer Size:         512 Pages
Warning  Comp. Temp. Threshold:     84 Celsius
Critical Comp. Temp. Threshold:     85 Celsius

Supported Power States
St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat
 0 +     8.00W       -        -    0  0  0  0        0       0
 1 +     6.30W       -        -    1  1  1  1        0       0
 2 +     3.50W       -        -    2  2  2  2        0       0
 3 -   0.0760W       -        -    3  3  3  3      210    1200
 4 -   0.0050W       -        -    4  4  4  4     2000    8000

Supported LBA Sizes (NSID 0x1)
Id Fmt  Data  Metadt  Rel_Perf
 0 +     512       0         0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        32 Celsius
Available Spare:                    100%
Available Spare Threshold:          10%
Percentage Used:                    0%
Data Units Read:                    77,639 [39.7 GB]
Data Units Written:                 184,955 [94.6 GB]
Host Read Commands:                 740,935
Host Write Commands:                1,386,988
Controller Busy Time:               7
Power Cycles:                       40
Power On Hours:                     11
Unsafe Shutdowns:                   4
Media and Data Integrity Errors:    0
Error Information Log Entries:      98
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0
Temperature Sensor 1:               32 Celsius
Temperature Sensor 2:               29 Celsius

Error Information (NVMe Log 0x01, 16 of 64 entries)
Num   ErrCount  SQId   CmdId  Status  PELoc          LBA  NSID    VS
  0         98     0  0x1011  0x4004      -            0     0     -

Display all SMART information using JSON format.

$ sudo smartctl --json --all /dev/nvme0n1
 
{
  "json_format_version": [
    1,
    0
  ],
  "smartctl": {
    "version": [
      7,
      2
    ],
    "svn_revision": "5155",
    "platform_info": "x86_64-linux-5.13.0-23-generic",
    "build_info": "(local build)",
    "argv": [
      "smartctl",
      "--json",
      "--all",
      "/dev/nvme0n1"
    ],
    "exit_status": 0
  },
  "device": {
    "name": "/dev/nvme0n1",
    "info_name": "/dev/nvme0n1",
    "type": "nvme",
    "protocol": "NVMe"
  },
  "model_name": "SAMSUNG MZVLB512HBJQ-000L7",
  "serial_number": "S4ENNX0R210637",
  "firmware_version": "5M2QEXF7",
  "nvme_pci_vendor": {
    "id": 5197,
    "subsystem_id": 5197
  },
  "nvme_ieee_oui_identifier": 9528,
  "nvme_total_capacity": 512110190592,
  "nvme_unallocated_capacity": 0,
  "nvme_controller_id": 4,
  "nvme_version": {
    "string": "1.3",
    "value": 66304
  },
  "nvme_number_of_namespaces": 1,
  "nvme_namespaces": [
    {
      "id": 1,
      "size": {
        "blocks": 1000215216,
        "bytes": 512110190592
      },
      "capacity": {
        "blocks": 1000215216,
        "bytes": 512110190592
      },
      "utilization": {
        "blocks": 66530296,
        "bytes": 34063511552
      },
      "formatted_lba_size": 512,
      "eui64": {
        "oui": 9528,
        "ext_id": 558642921375
      }
    }
  ],
  "user_capacity": {
    "blocks": 1000215216,
    "bytes": 512110190592
  },
  "logical_block_size": 512,
  "local_time": {
    "time_t": 1641502071,
    "asctime": "Thu Jan  6 21:47:51 2022 CET"
  },
  "smart_status": {
    "passed": true,
    "nvme": {
      "value": 0
    }
  },
  "nvme_smart_health_information_log": {
    "critical_warning": 0,
    "temperature": 32,
    "available_spare": 100,
    "available_spare_threshold": 10,
    "percentage_used": 0,
    "data_units_read": 77639,
    "data_units_written": 184969,
    "host_reads": 740935,
    "host_writes": 1387910,
    "controller_busy_time": 7,
    "power_cycles": 40,
    "power_on_hours": 11,
    "unsafe_shutdowns": 4,
    "media_errors": 0,
    "num_err_log_entries": 98,
    "warning_temp_time": 0,
    "critical_comp_time": 0,
    "temperature_sensors": [
      32,
      29
    ]
  },
  "temperature": {
    "current": 32
  },
  "power_cycle_count": 40,
  "power_on_time": {
    "hours": 11
  }
}

NVMe storage command line interface utility

Install the NVMe storage command line interface utility.

$ sudo apt install nvme-cli

Display utility version.

$ sudo nvme version
nvme version 1.14

Display help information.

$ sudo nvme help
nvme-1.14
usage: nvme <command> [<device>] [<args>]

The '' may be either an NVMe character device (ex: /dev/nvme0) or an
nvme block device (ex: /dev/nvme0n1).

The following are all implemented sub-commands:
  list                      List all NVMe devices and namespaces on machine
  list-subsys               List nvme subsystems
  id-ctrl                   Send NVMe Identify Controller
  id-ns                     Send NVMe Identify Namespace, display structure
  id-ns-granularity         Send NVMe Identify Namespace Granularity List, display structure
  list-ns                   Send NVMe Identify List, display structure
  list-ctrl                 Send NVMe Identify Controller List, display structure
  nvm-id-ctrl               Send NVMe Identify Controller NVM Command Set, display structure
  primary-ctrl-caps         Send NVMe Identify Primary Controller Capabilities
  list-secondary            List Secondary Controllers associated with a Primary Controller
  ns-descs                  Send NVMe Namespace Descriptor List, display structure
  id-nvmset                 Send NVMe Identify NVM Set List, display structure
  id-uuid                   Send NVMe Identify UUID List, display structure
  id-iocs                   Send NVMe Identify I/O Command Set, display structure
  create-ns                 Creates a namespace with the provided parameters
  delete-ns                 Deletes a namespace from the controller
  attach-ns                 Attaches a namespace to requested controller(s)
  detach-ns                 Detaches a namespace from requested controller(s)
  get-ns-id                 Retrieve the namespace ID of opened block device
  get-log                   Generic NVMe get log, returns log in raw format
  telemetry-log             Retrieve FW Telemetry log write to file
  fw-log                    Retrieve FW Log, show it
  changed-ns-list-log       Retrieve Changed Namespace List, show it
  smart-log                 Retrieve SMART Log, show it
  ana-log                   Retrieve ANA Log, show it
  error-log                 Retrieve Error Log, show it
  effects-log               Retrieve Command Effects Log, show it
  endurance-log             Retrieve Endurance Group Log, show it
  predictable-lat-log       Retrieve Predictable Latency per Nvmset Log, show it
  pred-lat-event-agg-log    Retrieve Predictable Latency Event Aggregate Log, show it
  persistent-event-log      Retrieve Presistent Event Log, show it
  endurance-event-agg-log   Retrieve Endurance Group Event Aggregate Log, show it
  lba-status-log            Retrieve LBA Status Information Log, show it
  resv-notif-log            Retrieve Reservation Notification Log, show it
  get-feature               Get feature and show the resulting value
  device-self-test          Perform the necessary tests to observe the performance
  self-test-log             Retrieve the SELF-TEST Log, show it
  set-feature               Set a feature and show the resulting value
  set-property              Set a property and show the resulting value
  get-property              Get a property and show the resulting value
  format                    Format namespace with new block format
  fw-commit                 Verify and commit firmware to a specific slot (fw-activate in old version < 1.2)
  fw-download               Download new firmware
  admin-passthru            Submit an arbitrary admin command, return results
  io-passthru               Submit an arbitrary IO command, return results
  security-send             Submit a Security Send command, return results
  security-recv             Submit a Security Receive command, return results
  get-lba-status            Submit a Get LBA Status command, return results
  resv-acquire              Submit a Reservation Acquire, return results
  resv-register             Submit a Reservation Register, return results
  resv-release              Submit a Reservation Release, return results
  resv-report               Submit a Reservation Report, return results
  dsm                       Submit a Data Set Management command, return results
  copy                      Submit a Simple Copy command, return results
  flush                     Submit a Flush command, return results
  compare                   Submit a Compare command, return results
  read                      Submit a read command, return results
  write                     Submit a write command, return results
  write-zeroes              Submit a write zeroes command, return results
  write-uncor               Submit a write uncorrectable command, return results
  verify                    Submit a verify command, return results
  sanitize                  Submit a sanitize command
  sanitize-log              Retrieve sanitize log, show it
  reset                     Resets the controller
  subsystem-reset           Resets the subsystem
  ns-rescan                 Rescans the NVME namespaces
  show-regs                 Shows the controller registers or properties. Requires character device
  discover                  Discover NVMeoF subsystems
  connect-all               Discover and Connect to NVMeoF subsystems
  connect                   Connect to NVMeoF subsystem
  disconnect                Disconnect from NVMeoF subsystem
  disconnect-all            Disconnect from all connected NVMeoF subsystems
  gen-hostnqn               Generate NVMeoF host NQN
  show-hostnqn              Show NVMeoF host NQN
  dir-receive               Submit a Directive Receive command, return results
  dir-send                  Submit a Directive Send command, return results
  virt-mgmt                 Manage Flexible Resources between Primary and Secondary Controller 
  rpmb                      Replay Protection Memory Block commands
  version                   Shows the program version
  help                      Display this help

See 'nvme help <command>' for more information on a specific command

The following are all installed plugin extensions:
  ymtc            Ymtc vendor specific extensions
  nvidia          NVIDIA vendor specific extensions
  zns             Zoned Namespace Command Set
  transcend       Transcend vendor specific extensions
  sfx             ScaleFlux vendor specific extensions
  dera            Dera vendor specific extensions
  shannon         Shannon vendor specific extensions
  virtium         Virtium vendor specific extensions
  seagate         Seagate vendor specific extensions
  micron          Micron vendor specific extensions
  toshiba         Toshiba NVME plugin
  netapp          NetApp vendor specific extensions
  huawei          Huawei vendor specific extensions
  wdc             Western Digital vendor specific extensions
  memblaze        Memblaze vendor specific extensions
  lnvm            LightNVM specific extensions
  amzn            Amazon vendor specific extensions
  intel           Intel vendor specific extensions

See 'nvme <plugin> help' for more information on a plugin

List every reconized NVMe device.

$ sudo nvme list --verbose
NVM Express Subsystems

Subsystem        Subsystem-NQN                                                                                    Controllers
---------------- ------------------------------------------------------------------------------------------------ ----------------
nvme-subsys0     nqn.2014.08.org.nvmexpress:144d144dS4ENNX0R210637      SAMSUNG MZVLB512HBJQ-000L7                nvme0

NVM Express Controllers

Device   SN                   MN                                       FR       TxPort Address        Subsystem    Namespaces      
-------- -------------------- ---------------------------------------- -------- ------ -------------- ------------ ----------------
nvme0    S4ENNX0R210637       SAMSUNG MZVLB512HBJQ-000L7               5M2QEXF7 pcie   0000:02:00.0   nvme-subsys0 nvme0n1

NVM Express Namespaces

Device       NSID     Usage                      Format           Controllers     
------------ -------- -------------------------- ---------------- ----------------
nvme0n1      1         34.06  GB / 512.11  GB    512   B +  0 B   nvme0

List every reconized NVMe device using JSON format.

$ sudo nvme list --verbose --output-format=json
{
  "Devices" : [
    {
      "Subsystem" : "nvme-subsys0",
      "SubsystemNQN" : "nqn.2014.08.org.nvmexpress:144d144dS4ENNX0R210637      SAMSUNG MZVLB512HBJQ-000L7              ",
      "Controllers" : [
        {
          "Controller" : "nvme0",
          "Transport" : "pcie",
          "Address" : "0000:02:00.0",
          "State" : "live",
          "Firmware" : "5M2QEXF7",
          "ModelNumber" : "SAMSUNG MZVLB512HBJQ-000L7",
          "SerialNumber" : "S4ENNX0R210637",
          "Namespaces" : [
            {
              "NameSpace" : "nvme0n1",
              "NSID" : 1,
              "UsedBytes" : 34066137088,
              "MaximumLBA" : 1000215216,
              "PhysicalSize" : 512110190592,
              "SectorSize" : 512
            }
          ]
        }
      ]
    }
  ]
}

Display results of the identify controller command.

$ sudo nvme id-ctrl --human-readable /dev/nvme0n1 
NVME Identify Controller:
vid       : 0x144d
ssvid     : 0x144d
sn        : S4ENNX0R210637      
mn        : SAMSUNG MZVLB512HBJQ-000L7              
fr        : 5M2QEXF7
rab       : 2
ieee      : 002538
cmic      : 0
  [3:3] : 0	ANA not supported
  [2:2] : 0	PCI
  [1:1] : 0	Single Controller
  [0:0] : 0	Single Port

mdts      : 9
cntlid    : 0x4
ver       : 0x10300
rtd3r     : 0x30d40
rtd3e     : 0x7a1200
oaes      : 0
[27:27] : 0	Zone Descriptor Changed Notices Not Supported
[14:14] : 0	Endurance Group Event Aggregate Log Page Change Notice Not Supported
[13:13] : 0	LBA Status Information Notices Not Supported
[12:12] : 0	Predictable Latency Event Aggregate Log Change Notices Not Supported
[11:11] : 0	Asymmetric Namespace Access Change Notices Not Supported
  [9:9] : 0	Firmware Activation Notices Not Supported
  [8:8] : 0	Namespace Attribute Changed Event Not Supported

ctratt    : 0
  [9:9] : 0	UUID List Not Supported
  [7:7] : 0	Namespace Granularity Not Supported
  [5:5] : 0	Predictable Latency Mode Not Supported
  [4:4] : 0	Endurance Groups Not Supported
  [3:3] : 0	Read Recovery Levels Not Supported
  [2:2] : 0	NVM Sets Not Supported
  [1:1] : 0	Non-Operational Power State Permissive Not Supported
  [0:0] : 0	128-bit Host Identifier Not Supported

rrls      : 0
cntrltype : 0
  [7:2] : 0	Reserved
  [1:0] : 0	Controller type not reported
fguid     : 
crdt1     : 0
crdt2     : 0
crdt3     : 0
oacs      : 0x17
  [9:9] : 0	Get LBA Status Capability Not Supported
  [8:8] : 0	Doorbell Buffer Config Not Supported
  [7:7] : 0	Virtualization Management Not Supported
  [6:6] : 0	NVMe-MI Send and Receive Not Supported
  [5:5] : 0	Directives Not Supported
  [4:4] : 0x1	Device Self-test Supported
  [3:3] : 0	NS Management and Attachment Not Supported
  [2:2] : 0x1	FW Commit and Download Supported
  [1:1] : 0x1	Format NVM Supported
  [0:0] : 0x1	Security Send and Receive Supported

acl       : 7
aerl      : 3
frmw      : 0x16
  [4:4] : 0x1	Firmware Activate Without Reset Supported
  [3:1] : 0x3	Number of Firmware Slots
  [0:0] : 0	Firmware Slot 1 Read/Write

lpa       : 0x3
  [4:4] : 0	Persistent Event log Not Supported
  [3:3] : 0	Telemetry host/controller initiated log page Not Supported
  [2:2] : 0	Extended data for Get Log Page Not Supported
  [1:1] : 0x1	Command Effects Log Page Supported
  [0:0] : 0x1	SMART/Health Log Page per NS Supported

elpe      : 63
npss      : 4
avscc     : 0x1
  [0:0] : 0x1	Admin Vendor Specific Commands uses NVMe Format

apsta     : 0x1
  [0:0] : 0x1	Autonomous Power State Transitions Supported

wctemp    : 357
cctemp    : 358
mtfa      : 0
hmpre     : 0
hmmin     : 0
tnvmcap   : 512110190592
unvmcap   : 0
rpmbs     : 0
 [31:24]: 0	Access Size
 [23:16]: 0	Total Size
  [5:3] : 0	Authentication Method
  [2:0] : 0	Number of RPMB Units

edstt     : 35
dsto      : 0
fwug      : 0
kas       : 0
hctma     : 0x1
  [0:0] : 0x1	Host Controlled Thermal Management Supported

mntmt     : 321
mxtmt     : 358
sanicap   : 0x3
  [31:30] : 0	Additional media modification after sanitize operation completes successfully is not defined
  [29:29] : 0	No-Deallocate After Sanitize bit in Sanitize command Supported
    [2:2] : 0	Overwrite Sanitize Operation Not Supported
    [1:1] : 0x1	Block Erase Sanitize Operation Supported
    [0:0] : 0x1	Crypto Erase Sanitize Operation Supported

hmminds   : 0
hmmaxd    : 0
nsetidmax : 0
endgidmax : 0
anatt     : 0
anacap    : 0
  [7:7] : 0	Non-zero group ID Not Supported
  [6:6] : 0	Group ID does not change
  [4:4] : 0	ANA Change state Not Supported
  [3:3] : 0	ANA Persistent Loss state Not Supported
  [2:2] : 0	ANA Inaccessible state Not Supported
  [1:1] : 0	ANA Non-optimized state Not Supported
  [0:0] : 0	ANA Optimized state Not Supported

anagrpmax : 0
nanagrpid : 0
pels      : 0
sqes      : 0x66
  [7:4] : 0x6	Max SQ Entry Size (64)
  [3:0] : 0x6	Min SQ Entry Size (64)

cqes      : 0x44
  [7:4] : 0x4	Max CQ Entry Size (16)
  [3:0] : 0x4	Min CQ Entry Size (16)

maxcmd    : 0
nn        : 1
oncs      : 0x5f
  [8:8] : 0	Copy Not Supported
  [7:7] : 0	Verify Not Supported
  [6:6] : 0x1	Timestamp Supported
  [5:5] : 0	Reservations Not Supported
  [4:4] : 0x1	Save and Select Supported
  [3:3] : 0x1	Write Zeroes Supported
  [2:2] : 0x1	Data Set Management Supported
  [1:1] : 0x1	Write Uncorrectable Supported
  [0:0] : 0x1	Compare Supported

fuses     : 0
  [0:0] : 0	Fused Compare and Write Not Supported

fna       : 0x4
  [2:2] : 0x1	Crypto Erase Supported as part of Secure Erase
  [1:1] : 0	Crypto Erase Applies to Single Namespace(s)
  [0:0] : 0	Format Applies to Single Namespace(s)

vwc       : 0x1
  [2:1] : 0	Support for the NSID field set to FFFFFFFFh is not indicated
  [0:0] : 0x1	Volatile Write Cache Present

awun      : 1023
awupf     : 0
icsvscc     : 1
  [0:0] : 0x1	NVM Vendor Specific Commands uses NVMe Format

nwpc      : 0
  [2:2] : 0	Permanent Write Protect Not Supported
  [1:1] : 0	Write Protect Until Power Supply Not Supported
  [0:0] : 0	No Write Protect and Write Protect Namespace Not Supported

acwu      : 0
sgls      : 0
 [1:0]  : 0	Scatter-Gather Lists Not Supported

mnan      : 0
subnqn    : 
ioccsz    : 0
iorcsz    : 0
icdoff    : 0
fcatt     : 0
  [0:0] : 0	Dynamic Controller Model

msdbd     : 0
ofcs      : 0
  [0:0] : 0	Disconnect command Not Supported

ps    0 : mp:8.00W operational enlat:0 exlat:0 rrt:0 rrl:0
          rwt:0 rwl:0 idle_power:- active_power:-
ps    1 : mp:6.30W operational enlat:0 exlat:0 rrt:1 rrl:1
          rwt:1 rwl:1 idle_power:- active_power:-
ps    2 : mp:3.50W operational enlat:0 exlat:0 rrt:2 rrl:2
          rwt:2 rwl:2 idle_power:- active_power:-
ps    3 : mp:0.0760W non-operational enlat:210 exlat:1200 rrt:3 rrl:3
          rwt:3 rwl:3 idle_power:- active_power:-
ps    4 : mp:0.0050W non-operational enlat:2000 exlat:8000 rrt:4 rrl:4
          rwt:4 rwl:4 idle_power:- active_power:-

Display results of the identify controller command using JSON format.

$ sudo nvme id-ctrl --human-readable --output-format json /dev/nvme0n1
{
  "vid" : 5197,
  "ssvid" : 5197,
  "sn" : "S4ENNX0R210637      ",
  "mn" : "SAMSUNG MZVLB512HBJQ-000L7              ",
  "fr" : "5M2QEXF7",
  "rab" : 2,
  "ieee" : 9528,
  "cmic" : 0,
  "mdts" : 9,
  "cntlid" : 4,
  "ver" : 66304,
  "rtd3r" : 200000,
  "rtd3e" : 8000000,
  "oaes" : 0,
  "ctratt" : 0,
  "rrls" : 0,
  "crdt1" : 0,
  "crdt2" : 0,
  "crdt3" : 0,
  "oacs" : 23,
  "acl" : 7,
  "aerl" : 3,
  "frmw" : 22,
  "lpa" : 3,
  "elpe" : 63,
  "npss" : 4,
  "avscc" : 1,
  "apsta" : 1,
  "wctemp" : 357,
  "cctemp" : 358,
  "mtfa" : 0,
  "hmpre" : 0,
  "hmmin" : 0,
  "tnvmcap" : 512110190592,
  "unvmcap" : 0,
  "rpmbs" : 0,
  "edstt" : 35,
  "dsto" : 0,
  "fwug" : 0,
  "kas" : 0,
  "hctma" : 1,
  "mntmt" : 321,
  "mxtmt" : 358,
  "sanicap" : 3,
  "hmminds" : 0,
  "hmmaxd" : 0,
  "nsetidmax" : 0,
  "anatt" : 0,
  "anacap" : 0,
  "anagrpmax" : 0,
  "nanagrpid" : 0,
  "sqes" : 102,
  "cqes" : 68,
  "maxcmd" : 0,
  "nn" : 1,
  "oncs" : 95,
  "fuses" : 0,
  "fna" : 4,
  "vwc" : 1,
  "awun" : 1023,
  "awupf" : 0,
  "icsvscc" : 1,
  "nwpc" : 0,
  "acwu" : 0,
  "sgls" : 0,
  "ioccsz" : 0,
  "iorcsz" : 0,
  "icdoff" : 0,
  "fcatt" : 0,
  "msdbd" : 0,
  "ofcs" : 0,
  "psds" : [
    {
      "max_power" : 800,
      "flags" : 0,
      "entry_lat" : 0,
      "exit_lat" : 0,
      "read_tput" : 0,
      "read_lat" : 0,
      "write_tput" : 0,
      "write_lat" : 0,
      "idle_power" : 0,
      "idle_scale" : 0,
      "active_power" : 0,
      "active_work_scale" : 0
    },
    {
      "max_power" : 630,
      "flags" : 0,
      "entry_lat" : 0,
      "exit_lat" : 0,
      "read_tput" : 1,
      "read_lat" : 1,
      "write_tput" : 1,
      "write_lat" : 1,
      "idle_power" : 0,
      "idle_scale" : 0,
      "active_power" : 0,
      "active_work_scale" : 0
    },
    {
      "max_power" : 350,
      "flags" : 0,
      "entry_lat" : 0,
      "exit_lat" : 0,
      "read_tput" : 2,
      "read_lat" : 2,
      "write_tput" : 2,
      "write_lat" : 2,
      "idle_power" : 0,
      "idle_scale" : 0,
      "active_power" : 0,
      "active_work_scale" : 0
    },
    {
      "max_power" : 760,
      "flags" : 3,
      "entry_lat" : 210,
      "exit_lat" : 1200,
      "read_tput" : 3,
      "read_lat" : 3,
      "write_tput" : 3,
      "write_lat" : 3,
      "idle_power" : 0,
      "idle_scale" : 0,
      "active_power" : 0,
      "active_work_scale" : 0
    },
    {
      "max_power" : 50,
      "flags" : 3,
      "entry_lat" : 2000,
      "exit_lat" : 8000,
      "read_tput" : 4,
      "read_lat" : 4,
      "write_tput" : 4,
      "write_lat" : 4,
      "idle_power" : 0,
      "idle_scale" : 0,
      "active_power" : 0,
      "active_work_scale" : 0
    }
  ]
}

Display results of the identify namespace command.

$ sudo nvme id-ns --human-readable /dev/nvme0n1
NVME Identify Namespace 1:
nsze    : 0x3b9e12b0
ncap    : 0x3b9e12b0
nuse    : 0x3f819d0
nsfeat  : 0
  [4:4] : 0	NPWG, NPWA, NPDG, NPDA, and NOWS are Not Supported
  [3:3] : 0	NGUID and EUI64 fields if non-zero, Reused
  [2:2] : 0	Deallocated or Unwritten Logical Block error Not Supported
  [1:1] : 0	Namespace uses AWUN, AWUPF, and ACWU
  [0:0] : 0	Thin Provisioning Not Supported

nlbaf   : 0
flbas   : 0
  [4:4] : 0	Metadata Transferred in Separate Contiguous Buffer
  [3:0] : 0	Current LBA Format Selected

mc      : 0
  [1:1] : 0	Metadata Pointer Not Supported
  [0:0] : 0	Metadata as Part of Extended Data LBA Not Supported

dpc     : 0
  [4:4] : 0	Protection Information Transferred as Last 8 Bytes of Metadata Not Supported
  [3:3] : 0	Protection Information Transferred as First 8 Bytes of Metadata Not Supported
  [2:2] : 0	Protection Information Type 3 Not Supported
  [1:1] : 0	Protection Information Type 2 Not Supported
  [0:0] : 0	Protection Information Type 1 Not Supported

dps     : 0
  [3:3] : 0	Protection Information is Transferred as Last 8 Bytes of Metadata
  [2:0] : 0	Protection Information Disabled

nmic    : 0
  [0:0] : 0	Namespace Multipath Not Capable

rescap  : 0
  [7:7] : 0	Ignore Existing Key - Used as defined in revision 1.2.1 or earlier
  [6:6] : 0	Exclusive Access - All Registrants Not Supported
  [5:5] : 0	Write Exclusive - All Registrants Not Supported
  [4:4] : 0	Exclusive Access - Registrants Only Not Supported
  [3:3] : 0	Write Exclusive - Registrants Only Not Supported
  [2:2] : 0	Exclusive Access Not Supported
  [1:1] : 0	Write Exclusive Not Supported
  [0:0] : 0	Persist Through Power Loss Not Supported

fpi     : 0x80
  [7:7] : 0x1	Format Progress Indicator Supported
  [6:0] : 0	Format Progress Indicator (Remaining 0%)

dlfeat  : 0
  [4:4] : 0	Guard Field of Deallocated Logical Blocks is set to 0xFFFF
  [3:3] : 0	Deallocate Bit in the Write Zeroes Command is Not Supported
  [2:0] : 0	Bytes Read From a Deallocated Logical Block and its Metadata are Not Reported

nawun   : 0
nawupf  : 0
nacwu   : 0
nabsn   : 0
nabo    : 0
nabspf  : 0
noiob   : 0
nvmcap  : 512110190592
mssrl   : 0
mcl     : 0
msrc    : 0
anagrpid: 0
nsattr	: 0
nvmsetid: 0
endgid  : 0
nguid   : 00000000000000000000000000000000
eui64   : 0025388211b67f9f
LBA Format  0 : Metadata Size: 0   bytes - Data Size: 512 bytes - Relative Performance: 0 Best (in use)

Display results of the identify namespace command using JSON format.

$ sudo nvme id-ns --human-readable --output-format json /dev/nvme0n1
$ sudo nvme id-ns --human-readable --output-format json /dev/nvme0n1
{
  "nsze" : 1000215216,
  "ncap" : 1000215216,
  "nuse" : 66591176,
  "nsfeat" : 0,
  "nlbaf" : 0,
  "flbas" : 0,
  "mc" : 0,
  "dpc" : 0,
  "dps" : 0,
  "nmic" : 0,
  "rescap" : 0,
  "fpi" : 128,
  "nawun" : 0,
  "nawupf" : 0,
  "nacwu" : 0,
  "nabsn" : 0,
  "nabo" : 0,
  "nabspf" : 0,
  "noiob" : 0,
  "nvmcap" : 512110190592,
  "nsattr" : 0,
  "nvmsetid" : 0,
  "mssrl" : 0,
  "mcl" : 0,
  "msrc" : 0,
  "anagrpid" : 0,
  "endgid" : 0,
  "eui64" : "0025388211b67f9f",
  "nguid" : "00000000000000000000000000000000",
  "lbafs" : [
    {
      "ms" : 0,
      "ds" : 9,
      "rp" : 0
    }
  ]
}

Display firmware log page in a human readable way.

$ sudo nvme fw-log /dev/nvme0n1 
Firmware Log for device:nvme0n1
afi  : 0x1
frs1 : 0x3746584551324d35 (5M2QEXF7)

Display firmware log page in a human readable way using JSON format.

$ sudo nvme fw-log --output-format json /dev/nvme0n1 
{
  "nvme0n1" : {
    "Active Firmware Slot (afi)" : 1,
    "Firmware Rev Slot 1" : "3982967975194021173 (5M2QEXF7)"
  }
}

Display NVMe SMART log page in a human readable way using JSON format.

$ sudo nvme smart-log /dev/nvme0n1
$ sudo nvme smart-log  /dev/nvme0n1
Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning			: 0
temperature				: 34 C
available_spare				: 100%
available_spare_threshold		: 10%
percentage_used				: 0%
endurance group critical warning summary: 0
data_units_read				: 77922
data_units_written			: 186499
host_read_commands			: 742847
host_write_commands			: 1443253
controller_busy_time			: 7
power_cycles				: 40
power_on_hours				: 12
unsafe_shutdowns			: 4
media_errors				: 0
num_err_log_entries			: 120
Warning Temperature Time		: 0
Critical Composite Temperature Time	: 0
Temperature Sensor 1           : 34 C
Temperature Sensor 2           : 31 C
Thermal Management T1 Trans Count	: 0
Thermal Management T2 Trans Count	: 0
Thermal Management T1 Total Time	: 0
Thermal Management T2 Total Time	: 0

Display NVMe SMART log page in a human readable way using JSON format.

$ sudo nvme smart-log --output-format json /dev/nvme0n1
{
  "critical_warning" : 0,
  "temperature" : 307,
  "avail_spare" : 100,
  "spare_thresh" : 10,
  "percent_used" : 0,
  "endurance_grp_critical_warning_summary" : 0,
  "data_units_read" : 77922,
  "data_units_written" : 186502,
  "host_read_commands" : 742847,
  "host_write_commands" : 1443428,
  "controller_busy_time" : 7,
  "power_cycles" : 40,
  "power_on_hours" : 12,
  "unsafe_shutdowns" : 4,
  "media_errors" : 0,
  "num_err_log_entries" : 120,
  "warning_temp_time" : 0,
  "critical_comp_time" : 0,
  "temperature_sensor_1" : 307,
  "temperature_sensor_2" : 303,
  "thm_temp1_trans_count" : 0,
  "thm_temp2_trans_count" : 0,
  "thm_temp1_total_time" : 0,
  "thm_temp2_total_time" : 0
}

Display last 3 entries from NVMe error log page in a human readable way.

$ sudo nvme error-log --log-entries 3 /dev/nvme0n1 
Error Log Entries for device:nvme0n1 entries:3
.................
 Entry[ 0]   
.................
error_count	: 120
sqid		: 0
cmdid		: 0x4001
status_field	: 0x200b(INVALID_NS: The namespace or the format of that namespace is invalid)
phase_tag	: 0
parm_err_loc	: 0x4
lba		: 0
nsid		: 0xfffffffe
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 1]   
.................
error_count	: 119
sqid		: 0
cmdid		: 0x7019
status_field	: 0x200b(INVALID_NS: The namespace or the format of that namespace is invalid)
phase_tag	: 0
parm_err_loc	: 0x4
lba		: 0
nsid		: 0xfffffffe
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................
 Entry[ 2]   
.................
error_count	: 118
sqid		: 0
cmdid		: 0x1003
status_field	: 0x2109(INVALID_LOG_PAGE: The log page indicated is invalid. This error condition is also returned if a reserved log page is requested)
phase_tag	: 0
parm_err_loc	: 0x28
lba		: 0
nsid		: 0xffffffff
vs		: 0
trtype		: The transport type is not indicated or the error is not transport related.
cs		: 0
trtype_spec_info: 0
.................

Display last 3 entries from NVMe error log page in a human readable way using JSON format.

$ sudo nvme error-log --log-entries 3 --output-format json /dev/nvme0n1 
{
  "errors" : [
    {
      "error_count" : 120,
      "sqid" : 0,
      "cmdid" : 16385,
      "status_field" : 8203,
      "phase_tag" : 0,
      "parm_error_location" : 4,
      "lba" : 0,
      "nsid" : 4294967294,
      "vs" : 0,
      "trtype" : 0,
      "cs" : 0,
      "trtype_spec_info" : 0
    },
    {
      "error_count" : 119,
      "sqid" : 0,
      "cmdid" : 28697,
      "status_field" : 8203,
      "phase_tag" : 0,
      "parm_error_location" : 4,
      "lba" : 0,
      "nsid" : 4294967294,
      "vs" : 0,
      "trtype" : 0,
      "cs" : 0,
      "trtype_spec_info" : 0
    },
    {
      "error_count" : 118,
      "sqid" : 0,
      "cmdid" : 4099,
      "status_field" : 8457,
      "phase_tag" : 0,
      "parm_error_location" : 40,
      "lba" : 0,
      "nsid" : 4294967295,
      "vs" : 0,
      "trtype" : 0,
      "cs" : 0,
      "trtype_spec_info" : 0
    }
  ]
}

Retrieve and display NVMe Command Effects log page using JSON format.

$ sudo nvme effects-log /dev/nvme0n1 
Admin Command Set
ACS0     [Delete I/O Submission Queue     ] 00000001
ACS1     [Create I/O Submission Queue     ] 00000001
ACS2     [Get Log Page                    ] 00000001
ACS4     [Delete I/O Completion Queue     ] 00000001
ACS5     [Create I/O Completion Queue     ] 00000001
ACS6     [Identify                        ] 00000001
ACS8     [Abort                           ] 00000001
ACS9     [Set Features                    ] 00000001
ACS10    [Get Features                    ] 00000001
ACS12    [Asynchronous Event Request      ] 00000001
ACS16    [Firmware Commit                 ] 00000001
ACS17    [Firmware Image Download         ] 00000001
ACS20    [Device Self-test                ] 00000001
ACS128   [Format NVM                      ] 00020003
ACS129   [Security Send                   ] 00020003
ACS130   [Security Receive                ] 00010001
ACS132   [Sanitize                        ] 00000003

NVM Command Set
IOCS0    [Flush                           ] 00010001
IOCS1    [Write                           ] 00000003
IOCS2    [Read                            ] 00000001
IOCS4    [Write Uncorrectable             ] 00000003
IOCS5    [Compare                         ] 00000001
IOCS8    [Write Zeroes                    ] 00000003
IOCS9    [Dataset Management              ] 00010003

Retrieve and display NVMe Command Effects log page using JSON format.

$ sudo nvme effects-log --output-format json /dev/nvme0n1 
{
  "admin_cmd_set" : {
    "ACS_0 (Delete I/O Submission Queue)" : 1,
    "ACS_1 (Create I/O Submission Queue)" : 1,
    "ACS_2 (Get Log Page)" : 1,
    "ACS_4 (Delete I/O Completion Queue)" : 1,
    "ACS_5 (Create I/O Completion Queue)" : 1,
    "ACS_6 (Identify)" : 1,
    "ACS_8 (Abort)" : 1,
    "ACS_9 (Set Features)" : 1,
    "ACS_10 (Get Features)" : 1,
    "ACS_12 (Asynchronous Event Request)" : 1,
    "ACS_16 (Firmware Commit)" : 1,
    "ACS_17 (Firmware Image Download)" : 1,
    "ACS_20 (Device Self-test)" : 1,
    "ACS_128 (Format NVM)" : 131075,
    "ACS_129 (Security Send)" : 131075,
    "ACS_130 (Security Receive)" : 65537,
    "ACS_132 (Sanitize)" : 3
  },
  "io_cmd_set" : {
    "IOCS_0 (Flush)" : 65537,
    "IOCS_1 (Write)" : 3,
    "IOCS_2 (Read)" : 1,
    "IOCS_4 (Write Uncorrectable)" : 3,
    "IOCS_5 (Compare)" : 1,
    "IOCS_8 (Write Zeroes)" : 3,
    "IOCS_9 (Dataset Management)" : 65539
  }
}

Start a device self test (1h short, 2h extended, eh vendor specific, fh abort).

$ sudo nvme device-self-test --self-test-code 1h /dev/nvme0n1 
Short Device self-test started

Display current self test operations.

$ sudo nvme self-test-log --dst-entries 0 /dev/nvme0n1 
Device Self Test Log for NVME device:nvme0n1
Current operation  : 0x1
Current Completion : 90%

Display current self test operations using JSON format.

$ sudo nvme self-test-log --dst-entries 0 --output-format json /dev/nvme0n1 
{
  "Current Device Self-Test Operation" : 1,
  "Current Device Self-Test Completion" : 90,
  "List of Valid Reports" : [

  ]
}

Display latest entry in self test log using JSON format.

$ sudo nvme self-test-log --dst-entries 1 /dev/nvme0n1 
Device Self Test Log for NVME device:nvme0n1
Current operation  : 0
Current Completion : 0%
Self Test Result[0]:
  Operation Result             : 0
  Self Test Code               : 1
  Valid Diagnostic Information : 0
  Power on hours (POH)         : 0xc
  Vendor Specific              : 0 0

Display latest entry in self test log using JSON format.

$ sudo nvme self-test-log --dst-entries 1 --output-format json /dev/nvme0n1 
{
  "Current Device Self-Test Operation" : 0,
  "Current Device Self-Test Completion" : 0,
  "List of Valid Reports" : [
    {
      "Self test result" : 0,
      "Self test code" : 1,
      "Segment number" : 0,
      "Valid Diagnostic Information" : 0,
      "Power on hours" : 12,
      "Vendor Specific" : 0
    }
  ]
}