nvme-cli Cheat Sheet¶
Installation¶
Ubuntu / Debian:
Fedora / RHEL / CentOS:
Arch Linux:
Alpine Linux:
Device Discovery & Identification¶
List all NVMe devices:
Show NVMe controller info:
Show NVMe namespace info:
List NVMe topologies:
Show supported LBA formats:
Health & SMART Monitoring¶
View SMART/Health log:
View error log entries:
Run device self-test (Short):
Run device self-test (Extended):
Check self-test results:
Formatting & Secure Erase¶
Warning: These commands will destroy data. Double-check device paths. Operations targeting namespaces use
/dev/nvme0n1, while full drive operations often use the controller/dev/nvme0.
Format namespace (default):
Format with specific LBA size:
Secure Erase (User Data):
Cryptographic Erase:
Sanitize (Block Erase):
Sanitize (Crypto Erase):
Check Sanitize Status:
Firmware Management¶
Check current firmware version:
Download firmware to device:
Commit firmware (Activate next boot):
Commit & Activate immediately:
Power Management¶
Show supported power states:
Set active power state:
Show Autonomous Power Transitions:
Namespace Management (Advanced)¶
Detach namespace:
Delete namespace:
Create namespace (size in blocks):
Attach namespace:
Reset NVMe controller: