NVME-SANITIZE(1)
πΈ nvme-sanitize β the manual page (nvme-sanitize(1)) π
okay bestie, welcome to nvme-sanitize(1) from the NVMe Manual β¨ this is the page where you learn how to make a drive absolutely forget everything it ever knew. iconic behavior, tbh.
β¨ NAME β¨
nvme-sanitize β send the NVMe Sanitize Command, and it hands you back the result π«Ά
β¨ SYNOPSIS β¨
nvme [<global-options>] sanitize <device> [--no-dealloc | -d] [--oipbp | -i]
[--owpass=<overwrite-pass-count> | -n
<overwrite-pass-count>]
[--ause | -u] [--sanact=<action> | -a <action>]
[--ovrpat=<overwrite-pattern> | -p <overwrite-pattern>]
[--emvs | -e] [--preq | -q] [--force] [--wait | -w]
[--repeat=<repeat-count> | -r <repeat-count>]
β¨ DESCRIPTION β¨
So for the NVMe device you point at, this thing sends a Sanitize command and then tells you how it went. literally that's the whole job π
The <device> parameter is mandatory β it's an NVMe character device, like /dev/nvme0, okay? no skipping this.
On success it returns 0. any other time, it returns an error code. no cap.
β¨ OPTIONS β¨
-d,--no-deallocβ No Deallocate After Sanitize. if this is set, the controller shall not deallocate any logical blocks as a result of successfully completing the sanitize operation. if it's cleared, the controller should deallocate logical blocks as a result of successfully completing the sanitize operation. π«Ά this bit shall be ignored if the Sanitize Action field is set to001b(i.e., Exit Failure Mode).-i,--oipbpβ Overwrite Invert Pattern Between Passes. if set, the Overwrite Pattern shall be inverted between passes. if cleared, the overwrite pattern shall not be inverted between passes. this bit shall be ignored unless the Sanitize Action field is set to011b(i.e., Overwrite). π-n <overwrite-pass-count>,--owpass=<overwrite-pass-count>β Overwrite Pass Count. this field says how many overwrite passes you want (i.e., how many times the media is to be overwritten) using the data from the Overwrite Pattern field of this command. a value of0means16overwrite passes β yes, zero means sixteen, we don't make the rules π this field shall be ignored unless the Sanitize Action field is set to011b(i.e., Overwrite).-u,--auseβ Allow Unrestricted Sanitize Exit. if set, the sanitize operation is performed in unrestricted completion mode. if cleared, it's performed in restricted completion mode. this bit shall be ignored if the Sanitize Action field is set to001b(i.e., Exit Failure Mode).-a <action>,--sanact=<action>β Sanitize Action. here's the menu, bestie π:0x00β Reserved0x01|exit-failureβ Exit Failure Mode0x02|start-block-eraseβ Start a Block Erase sanitize operation0x03|start-overwriteβ Start an Overwrite sanitize operation0x04|start-crypto-eraseβ Start a Crypto Erase sanitize operation0x05|exit-media-verificationβ Exit Media Verification State
-p <overwrite-pattern>,--ovrpat=<overwrite-pattern>β Overwrite Pattern. this field is ignored unless the Sanitize Action field in Command Dword 10 is set to011b(i.e., Overwrite). it specifies a 32-bit pattern that gets used for the Overwrite sanitize operation. β¨-e,--emvsβ Enter Media Verification State. if set, then the Media Verification state shall be entered if sanitize processing completes successfully. if cleared, this bit shall have no effect. and if the SANACT field does not specify starting a sanitize operation (i.e., is set to any value other than010b,011b, or100b), then this bit shall be ignored by the controller. iykyk π-q,--preqβ Purge Required. if set, the host is requesting that the user data be purged as defined by IEEE Std 2883. if the controller supports Sanitize Purge Request and Reporting (SPRRSin the Identify Controller data structure) and the sanitize operation started by this command does not purge user data, then that sanitize operation shall fail π if cleared, then that sanitize operation is not required to purge user data as a condition for succeeding.--forceβ ignore that the namespace is currently busy and perform the operation even though. π₯ (yes that's genuinely what it says, main character energy)-w,--waitβ wait for the sanitize to finish. sit there. be patient. π§-r <repeat-count>,--repeat=<repeat-count>β repeat for the multi cycle sanitization. β
β¨ GLOBAL OPTIONS β¨
these are the options defined at the top-level nvme command, and they're available to this subcommand too π«Ά
--dry-runβ print the command that would be executed, but don't actually execute it. fake it till you make it, but safely π--no-ioctl-probingβ disable probing for 64-bit IOCTL support.--no-retriesβ disable retry logic on transient errors.-o <fmt>,--output-format=<fmt>β set the reporting format tonormal,tabular,'json, orbinary. only one output format may be used at a time. (yes, the original list has a stray quote on json β forwarding it exactly, character for character π)--output-format-version=<version>β select the output format version. version1uses the original field naming, while version2(the default) provides more consistent and script-friendly field names. other versions are rejected. periodt.--quietβ suppress informational messages. errors are still reported, and--quietcancels any--verbosefor the library log level.--set-options=<key=value>[,<key=value>...]β set libnvme library options for this invocation. the supported keys areforce-4k,mi-probe-enabled,test-base-dirandtest-sysfs-dir.--timeout=<ms>β set the timeout for the command in milliseconds.infiniteor-1waits without a time limit (0xffffffff). β³-v,--verboseβ increase the level of detail in the output. may be specified multiple times to further increase verbosity. go off, stack those v's π₯
these options can also be set as machine-wide defaults in nvme-cli.conf(5). a command-line flag always overrides the file. always. no exceptions. π
β¨ EXAMPLES β¨
- has the program issue a Sanitize Command π:
# nvme sanitize /dev/nvme0 -a 0x02
# nvme sanitize /dev/nvme0 --sanact=0x01
# nvme sanitize /dev/nvme0 --sanact=start-overwrite
β¨ NVME β¨
part of the nvme-user suite. π
okay that's the whole page, bestie β go forth and sanitize responsibly π¦
and the cute sign-off, as promised: this gem was dated 10/30/2026 and shipped under the source/version line NVMe (page NVME-SANITIZE(1), natch). mwah π
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms