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 is 8. When it's 0, the metadata is passes (their words, not mine 😭 β€” it just goes through).
    • Bits 2:0 β€” PRCHK: Protection Information Check:
      • Bit 2 β€” set to 1 enables checking the guard tag
      • Bit 1 β€” set to 1 enables checking the application tag
      • Bit 0 β€” set to 1 enables checking the reference tag
  • -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 value 0xffffffff can also be given as all or -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 to normal, tabular, 'json, or binary. 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. Version 1 uses the original field naming, while version 2 (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 --quiet cancels any --verbose for the library log level. 🀫
  • --set-options=<key=value>[,<key=value>...] β€” sets libnvme library options for this invocation. Supported keys are force-4k, mi-probe-enabled, test-base-dir and test-sysfs-dir.
  • --timeout=<ms> β€” sets the timeout for the command in milliseconds. infinite or -1 waits 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