NVME-NS-ATTACH(1)
π NVME-NS-ATTACH(1) β the nvme manual, bestie edition β¨
okay so real talk, this is a page straight out of the NVMe Manual (yes, the actual manual, we're being fancy today π) and it's about nvme-ns-attach β like, literally just "send NVMe attach namespace, return result." that's the whole vibe. let's get into it π
β¨ NAME β¨
nvme-ns-attach β send the NVMe attach namespace command and hand you back the result. no cap, that's it π¦
πΈ SYNOPSIS πΈ
nvme [<global-options>] ns attach <device>
[--namespace-id=<nsid> | -n <nsid>]
[--controllers=<ctrl-list,> | -c <ctrl-list,>]
π DESCRIPTION π
so for the NVMe device you hand over, this bad boy sends the nvme namespace attach command for the namespace identifier you gave it, attaching that namespace to the list of controller identifiers you provided. slay π
Now, <device> is mandatory β and it has to be an NVMe character device (like /dev/nvme0). it is not a namespace block device (so like /dev/nvme0n1 is a no-go, bestie π«Ά). read the room, pick the right device.
π¦ OPTIONS π¦
-n <nsid>,--namespace-id=<nsid>β the namespace identifier you wanna attach, but the thing is it can't already be attached, okay? also you can pass the broadcast value0xffffffffand it's also accepted written asallor-1π-c <ctrl-list,>,--controllers=<ctrl-list,>β the comma separated list of controller identifiers you want the namespace attached to. but here's the thing β if you don't give a list at all, the namespace gets attached to the<device>controller that's being used for this command. convenient β¨
π GLOBAL OPTIONS π
these ones live at the top-level nvme command, so they're available to this subcommand too. main character energy honestly π
--dry-runβ prints the command it would have run, but doesn't actually run it. literally just looking respectfully π--no-ioctl-probingβ turns off probing for 64-bit IOCTL support.--no-retriesβ kills the retry logic on transient errors.-o <fmt>,--output-format=<fmt>β sets the reporting format tonormal,tabular,json, orbinary. only one output format at a time, bestie, pick one π--output-format-version=<version>β picks the output format version. version 1 keeps the original field naming, while version 2 (the default) gives you way more consistent and script-friendly field names. any other version? rejected. periodt π«--quietβ suppresses informational messages. errors still get reported, and--quietcancels any--verbosefor the library log level. so pick a lane π--set-options=<key=value>[,<key=value>...]β sets libnvme library options for this invocation. the supported keys areforce-4k,mi-probe-enabled,test-base-dirandtest-sysfs-dir.--timeout=<ms>β sets the timeout for the command in milliseconds.infiniteor-1waits with no time limit (0xffffffff).-v,--verboseβ increases the level of detail in the output. and like, you can specify it multiple times to crank the verbosity even further π₯
fun fact: these options can also be set as machine-wide defaults in nvme-cli.conf(5). and a command-line flag always overrides the file β the CLI is the icon, the file is just the understudy π
π EXAMPLES π
Attach namespace 2 to the controllers with id 0x21 and 0x22:
# nvme ns attach /dev/nvme1 -n 0x2 -c 0x21,0x22
Attach namespace 3 to nvme0:
# nvme ns attach /dev/nvme0 -n 3
π NVME π
part of the nvme-user suite π§
k that's the whole page, bestie πΈ. this one's from the NVMe crew, dated 10/30/2026, and it's the NVME-NS-ATTACH(1) page β go attach some namespaces and be iconic about it πβ¨
π¦ 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