NVME-WRITE-ZEROES(1)
π NAME π
nvme-write-zeroes β bestie, this sends an NVMe write zeroes command and hands you back the results β¨ (yes, that's the whole vibe, from the NVMe Manual, page NVME-WRITE-ZEROES(1))
π«Ά SYNOPSIS π«Ά
nvme [<global-options>] write-zeroes <device>
[--start-block=<slba> | -s <slba>]
[--block-count=<nlb> | -c <nlb>]
[--ref-tag=<reftag> | -r <reftag>]
[--prinfo=<prinfo> | -p <prinfo>]
[--app-tag-mask=<appmask> | -m <appmask>]
[--app-tag=<apptag> | -a <apptag>] [--deac | -d]
[--limited-retry | -l] [--force-unit-access | -f]
[--namespace-id=<nsid> | -n <nsid>]
[--storage-tag<storage-tag> | -S <storage-tag>]
[--storage-tag-check<storage-tag-check> | -C
<storage-tag-check>]
[--dir-type=<dtype> | -T <dtype>]
[--dir-spec=<dspec> | -D <dspec>]
[--namespace-zeroes | -Z]
πΈ DESCRIPTION πΈ
Okay so picture this: the Write Zeroes command is literally just there to set a range of logical blocks to 0. That's it. That's the whole assignment. Zeroes. Everywhere. Poof π¨ β data gone, zeroes in.
π OPTIONS π
-s <slba>,--start-block=<slba>β where you're starting, bestie. The start block.-c <nlb>,--block-count=<nlb>β how many logical blocks are getting zeroed out. Count 'em.-p <prinfo>,--prinfo=<prinfo>β this one's the Protection Information field definition, and it's giving bitfield energy. Let me break it down for you:- Bit 3 β PRACT: Protection Information Action. When you set this to
1, PI gets stripped/inserted on read/write whenever the block format's metadata size is8. When it's0, the metadata is passes (their words, not mine π β it just goes through). - Bits 2:0 β PRCHK: Protection Information Check:
- Bit 2 β set to
1enables checking the guard tag - Bit 1 β set to
1enables checking the application tag - Bit 0 β set to
1enables checking the reference tag
- Bit 2 β set to
- Bit 3 β PRACT: Protection Information Action. When you set this to
-r <reftag>,--ref-tag=<reftag>β optional reftag, only relevant when you're rolling with protection information.-m <appmask>,--app-tag-mask=<appmask>β optional application tag mask, again for the protection information girlies.-a <apptag>,--app-tag=<apptag>β optional application tag, same protection information situation.-l,--limited-retryβ sets the limited retry flag. Slay.-d,--deacβ sets the DEAC bit, which asks the controller to deallocate the logical blocks. Politely. β¨-f,--force-unit-accessβ sets the force-unit access flag.-n <nsid>,--namespace-id=<nsid>β the Namespace ID used in the command. The broadcast value0xffffffffcan also be given asallor-1. Iconic shorthand, honestly.-S <storage-tag>,--storage-tag=<storage-tag>β the Variable Sized Logical Block Storage Tag (LBST).-C <storage-tag-check>,--storage-tag-check=<storage-tag-check>β this bit specifies that the Storage Tag field shall be checked as part of end-to-end data protection processing.-T <dtype>,--dir-type=<dtype>β directive type.-D <dspec>,--dir-spec=<dspec>β directive specific.-Z,--namespace-zeroesβ if this is set, the controller clears all logical blocks to zero across the entire namespace. Yes, the whole thing. Main character move π.
π¦ GLOBAL OPTIONS π¦
These ones live at the top-level nvme command, so they're available to this subcommand too:
--dry-runβ prints the command that would be executed, but doesn't actually execute it. Rehearsal mode π.--no-ioctl-probingβ disables probing for 64-bit IOCTL support.--no-retriesβ disables retry logic on transient errors.-o <fmt>,--output-format=<fmt>β sets the reporting format tonormal,tabular,'json, orbinary. Only one output format may be used at a time β pick one, don't be greedy β¨.--output-format-version=<version>β selects the output format version. Version1uses the original field naming, while version2(the default) provides more consistent and script-friendly field names. Any other versions are rejected, periodt.--quietβ suppresses informational messages. Errors are still reported, and--quietcancels any--verbosefor the library log level. π€«--set-options=<key=value>[,<key=value>...]β sets libnvme library options for this invocation. Supported keys areforce-4k,mi-probe-enabled,test-base-dirandtest-sysfs-dir.--timeout=<ms>β sets the timeout for the command in milliseconds.infiniteor-1waits without a time limit (0xffffffff). No clock-watching required π.-v,--verboseβ increases the level of detail in the output. May be specified multiple times to further increase verbosity. More-v, more lore.
Heads up bestie: these options can also be set as machine-wide defaults in nvme-cli.conf(5). A command-line flag always overrides the file β CLI stays winning π.
π EXAMPLES π
No examples yet. π (Devastating, I know. Somebody get the maintainers on this.)
β NVME β
Part of the nvme-user suite. You're welcome π
That's the whole page, bestie π«Ά β brought to you by the NVMe Manual, dated 10/30/2026, page NVME-WRITE-ZEROES(1). Go forth and zero some blocks responsibly β¨π
π¦ 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