created: 2023-08-23 18:19:59 (+00:00; UTC; UTC)
last modified: 2025-06-09 15:52:12 (+00:00; UTC; UTC)

NVMe Cheat Sheet

List Devices


nvme list

SMART Info


nvme smart-log /dev/nvme0

nvme smart-log-add /dev/nvme0

nvme error-log /dev/nvme0

Check Support


nvme id-ctrl -H /dev/nvme0n1

oacs      : 0x17
  [1:1] : 0x1	Format NVM Supported

sanicap   : 0x60000002
    [2:2] : 0	Overwrite Sanitize Operation Not Supported
    [1:1] : 0x1	Block Erase Sanitize Operation Supported
    [0:0] : 0	Crypto Erase Sanitize Operation Not Supported

fna       : 0
  [2:2] : 0	Crypto Erase Not Supported as part of Secure Erase

nvme id-ns -H /dev/nvme0n1

LBA Format  0 : Metadata Size: 0   bytes - Data Size: 512 bytes - Relative Performance: 0x2 Good 
LBA Format  1 : Metadata Size: 0   bytes - Data Size: 4096 bytes - Relative Performance: 0x1 Better (in use)

Format No Secure Erase (TRIM/Deallocate LBAs)


nvme format --force /dev/nvme0n1 --ses=0

Format Crypto Erase


nvme format --force /dev/nvme0n1 --ses=2

Format User Data Erase


nvme format --force /dev/nvme0n1 --ses=1

Format Change Native Sector Size


nvme format --force --lbaf=1 /dev/nvme0n1

Sanitize Crypto Erase


nvme sanitize -a 0x4 /dev/nvme0n1

Sanitize Block Erase


nvme sanitize -a 0x2 /dev/nvme0n1

Sanitize Status


nvme sanitize-log /dev/nvme0n1

Running


Sanitize Progress                      (SPROG) :  16704
Sanitize Status                        (SSTAT) :  0x2

Complete


Sanitize Progress                      (SPROG) :  65535
Sanitize Status                        (SSTAT) :  0x101

Sources/Links

2023-08-23