NVME-NS-ATTACH(1)

πŸ“¦ version 3.2, in arch rolling

πŸ’… 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 value 0xffffffff and it's also accepted written as all or -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 to normal, tabular, json, or binary. 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 --quiet cancels any --verbose for the library log level. so pick a lane 😌
  • --set-options=<key=value>[,<key=value>...] β€” sets libnvme library options for this invocation. the 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 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