nvme

 

 


nvme driver

 

nvme ssd 在 linux 上係有自己的 driver

# -p --parameters

modinfo -p nvme

 


nvme CLI

 

version

nvme version

nvme version 1.12

list m2

nvme list

Node             SN                   Model                                    Namespace Usage                      Format           FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1     ...............      Samsung SSD 980 PRO 1TB                  1         998.89  GB /   1.00  TB    512   B +  0 B   2B2QGXA7

get-feature

 

log

error-log

nvme error-log /dev/nvme1n1

smart-log

nvme smart-log /dev/nvme1n1

self-test

nvme device-self-test /dev/nvme1n1 -s 1h

Device self-test started

-s <NUM>, --self-test-code=<NUM>

This field specifies the action taken by the device self-test command

  • 1h: Start a short device self-test operation
  • 2h: Start a extended device self-test operation
  • eh: Start a vendor specific device self-test operation
  • fh: abort the device self-test operation

nvme self-test-log /dev/nvme1n1

Device Self Test Log for NVME device:nvme1n1
Current operation  : 0x1
Current Completion : 90%
Self Test Result[0]:
  Operation Result             : 0xf
Self Test Result[1]:
  Operation Result             : 0xf
...

一段時間後

Device Self Test Log for NVME device:nvme1n1
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)         : 0x767
  Vendor Specific              : 0 0
Self Test Result[1]:
  Operation Result             : 0xf
...

Sector size

Most SSDs report their sector size as 512 bytes, even though they use larger sectors - typically 4 kB, 8 kB, or sometimes larger.

nvme id-ns /dev/nvme0n1 | grep -e lbaf

nlbaf   : 0
lbaf  0 : ms:0   lbads:9  rp:0 (in use)

"nlbaf" is the number of LBA formats minus 1, so here there is only one format supported.

"lbaf" 0 means LBA format #0. It has an lbads (LBA data size) of 9

"lbads" means sectors are 2^9 or 512 bytes

"rp" (Relative Performance) value indicates which format will provide the best performance, with 0 being the best.