Skip to content

Instantly share code, notes, and snippets.

@ketanarlulkar
Last active March 20, 2017 05:18
Show Gist options
  • Save ketanarlulkar/56cba9632c371f65a53424228ff53560 to your computer and use it in GitHub Desktop.
Save ketanarlulkar/56cba9632c371f65a53424228ff53560 to your computer and use it in GitHub Desktop.
Quick list of NVMe-cli commands

NVMe-cli commands

Undertemperature

  1. Get Default Undertemperature Threshold sudo nvme admin-passthru /dev/nvme0 -o 0xA --cdw10=0x104 --cdw11=0x100000 -s
  2. Get Current Undertemperature Threshold sudo nvme admin-passthru /dev/nvme0 -o 0xA --cdw10=0x4 --cdw11=0x100000 -s
  3. Set Undertemperature Threshold sudo nvme admin-passthru /dev/nvme0 -o 0x9h --cdw10=0x4 --cdw11=0x10$temp -s
  4. Set Persist Undertemperature Threshold sudo nvme admin-passthru /dev/nvme0 -o 0x9h --cdw10=0x80000004 --cdw11=0x10$temp -s

Overtemperature

  1. Get Default Overtemperature Threshold sudo nvme admin-passthru /dev/nvme0 -o 0xA --cdw10=0x104 --cdw11=0x0 -s
  2. Get Current Overtemperature Threshold sudo nvme admin-passthru /dev/nvme0 -o 0xA --cdw10=0x4 --cdw11=0x0 -s
  3. Set Overtemperature Threshold sudo nvme admin-passthru /dev/nvme0 -o 0x9h --cdw10=0x4 --cdw11=0x$temp -s
  4. Set Persist Overtemperature Threshold sudo nvme admin-passthru /dev/nvme0 -o 0x9h --cdw10=0x80000004 --cdw11=0x$temp -s

Get current temperature from SMART log

  • Get Current Temperature sudo nvme get-log /dev/nvme0 -i 2 -l 32

Queue operations

Completion Queue

  1. Ceate IO CQ with QID = 2 sudo nvme admin-passthru /dev/nvme0 -o 5 --cdw10=0x7F0002 --cdw11=0x3 -r
  2. Delete IO CQ with QID = 2 sudo nvme admin-passthru /dev/nvme0 -o 4 --cdw10=0x2

Submission Queue

  1. Delete IO SQ with QID = 3 sudo nvme admin-passthru /dev/nvme0 -o 0 --cdw10=0x3
  2. Create IO SQ with QID = 3 sudo nvme admin-passthru /dev/nvme0 -o 1 --cdw10=0x7F0003 --cdw11=0x30001 -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment