NVME-CONNECT(1)

πŸ’… NVME-CONNECT(1) β€” the nvme-connect glow-up (from the NVMe Manual, bestie)

okay so. nvme-connect is literally the moment your machine makes a Fabrics controller and connects it to a remote system. She's the main character of "my storage is somewhere else and I want in." πŸ¦‹


✨ NAME ✨

nvme-connect β€” connect to a Fabrics controller. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

nvme [<global-options>] connect [--config=<filename>]
                        [--devid-file=<filename>]
                        [--discovery]
                        [--idempotent]
                        [--owner=<NAME>]
                        [<fabrics-options>]

πŸ’– DESCRIPTION πŸ’–

So what she actually does: she creates a transport connection to a remote system (and yes, that system is specified by --traddr and --trsvcid, keep up πŸ’…), and then she creates an NVMe over Fabrics controller for the NVMe subsystem that you named with the --nqn option.

That's it. That's the whole vibe. Connect + controller = iconic πŸ’«


🌸 OPTIONS 🌸

  • --config=<filename> β€” bestie, use this JSON configuration file instead of the default one. simple as that ✨
  • --devid-file=<filename> β€” write the kernel-assigned device name (like, for example, nvme0) into <filename>. If the controller is already connected, the device name that already exists gets written. Otherwise the device name goes in after the controller is connected. 🫢

When you use it with --idempotent, the existing device name gets written before the command exits successfully. this is so a supervising process β€” a systemd service, say β€” can figure out which device to disconnect later. iykyk.

the output file is created before the connection is even attempted. and no cap: if the file can't be created, like because the parent directory doesn't exist, the command fails without attempting the connection at all. πŸ’€

  • --discovery β€” plot twist: the target is a Discovery Controller. The kernel recognizes the well-known discovery NQN all by itself, but without this option it sees a Discovery Controller with a unique NQN as an I/O controller. and that gives it a keep-alive timeout of 5 seconds when none is given, and creates I/O queues for it. so yeah, use the flag if that's not what you want πŸ™ˆ
  • --idempotent β€” if the controller you're asking for is already connected, exit with status 0 instead of reporting an error. she's unbothered, she's thriving πŸ’…
  • --owner=<NAME> β€” record NAME as the owner of the connected controller in the NVMe ownership registry, so other orchestrators (and nvme-disconnect-all) leave it alone. see nvme-disconnect-all(1). an empty NAME (--owner=) removes the registry entry instead, leaving the controller unowned. and without --owner, a controller that was already connected keeps whatever entry it has. no take-backsies πŸ‘‘

πŸ¦‹ FABRICS OPTIONS πŸ¦‹

these are the options that all the NVMe over Fabrics commands share, nvme connect included. girlies, this is the good stuff:

  • -a <traddr>, --traddr=<traddr> β€” specify the network address of the controller. for transports using IP addressing (e.g. rdma, tcp), this should be an IP address. 🧚
  • --concat β€” enable secure concatenation (TCP).
  • -c <#>, --reconnect-delay=<#> β€” set the delay in seconds before a reconnect is attempted after a connection loss.
  • -C <secret>, --kxchap-ctrl-secret=<secret> β€” controller authentication secret for bi-directional authentication. if you don't specify it, bi-directional authentication isn't attempted. that's just how it is ✨
  • -S <secret>, --kxchap-secret=<secret> β€” host authentication secret (KX-HMAC-CHAP). must be provided in ASCII format as defined in the NVMe specification. rules are rules πŸ“œ
  • -C <secret>, --dhchap-ctrl-secret=<secret> β€” controller authentication secret for bi-directional authentication. if not specified, bi-directional authentication is not attempted. (deprecated, see --kxchap-ctrl-secret) β€” she's an elder, show her respect but use the new one πŸ™ˆ
  • -S <secret>, --dhchap-secret=<secret> β€” host authentication secret (DH-HMAC-CHAP). must be provided in ASCII format as defined in the NVMe specification. (deprecated, see --kxchap-secret) β€” same deal, legacy queen πŸ’€
  • --disable-sqflow β€” disable submission queue flow control.
  • -G, --data-digest β€” enable data digest generation/verification (TCP).
  • -D, --duplicate-connect β€” allow duplicate connections to the same subsystem. yes you CAN have two, she's not jealous πŸ’…
  • -g, --hdr-digest β€” enable header digest generation/verification (TCP).
  • -f <iface>, --host-iface=<iface> β€” specify the network interface to use for the connection.
  • -I <hostid>, --hostid=<hostid> β€” specify the host UUID.
  • -q <hostnqn>, --hostnqn=<hostnqn> β€” override the default host NQN. glow-up your identity ✨
  • -w <traddr>, --host-traddr=<traddr> β€” specify the source address on the host side of the connection.
  • -k <#>, --keep-alive-tmo=<#> β€” set the keep-alive timeout in seconds.
  • --keyring=<keyring> β€” keyring to use for TLS key lookup.
  • -n <subnqn>, --nqn=<subnqn> β€” specify the NVMe subsystem NQN to connect to. this is literally the who-you're-connecting-to 🎯
  • -i <#>, --nr-io-queues=<#> β€” number of I/O queues to create.
  • -P <#>, --nr-poll-queues=<#> β€” number of polling queues to create.
  • -W <#>, --nr-write-queues=<#> β€” number of write queues to create.
  • -Q <#>, --queue-size=<#> β€” queue depth for I/O queues.
  • -l <#>, --ctrl-loss-tmo=<#> β€” maximum time in seconds to retry reconnect attempts after controller loss. she's persistent, she's loyal 🫢
  • -s <trsvcid>, --trsvcid=<trsvcid> β€” transport service identifier (e.g. TCP/rdma port). the default is 4420 for RDMA.
  • -T <#>, --tos=<#> β€” type of service value for the connection (TCP).
  • -t <trtype>, --transport=<trtype> β€” specify the transport type. supported values include:
    • rdma β€” RDMA (RoCE, iWARP, InfiniBand)
    • tcp β€” TCP/IP
    • fc β€” Fibre Channel (experimental)
    • loop β€” Local loopback transport
  • --tls β€” enable TLS encryption (TCP).
  • --tls-key=<tls-key> β€” TLS key for the connection. it is recommended to preload keys into the system keyring instead of passing them via the command line. (pls don't put secrets in your shell history bestie, that's so not the move 😭)
  • --tls-key-identity=<identity> β€” identity associated with the TLS key.

πŸ’œ GLOBAL OPTIONS πŸ’œ

these are defined up at the top-level nvme command and they're available to this subcommand too. big main-character energy ✨

  • --dry-run β€” print the command that would be executed, but do not actually execute it. all the fantasy, zero consequences πŸ’­
  • --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 to normal, tabular, 'json, or binary. only one output format may be used at a time. pick one, queen, you can't have all four πŸ‘‘
  • --output-format-version=<version> β€” select the output format version. version 1 uses the original field naming, while version 2 (the default) provides more consistent and script-friendly field names. other versions are rejected. respectfully, no πŸ’€
  • --quiet β€” suppress informational messages. errors are still reported, and --quiet cancels any --verbose for the library log level. she's a literal "mute notifications" button πŸ”‡
  • --set-options=<key=value>[,<key=value>...] β€” set libnvme library options for this invocation. supported keys are force-4k, mi-probe-enabled, test-base-dir and test-sysfs-dir.
  • --timeout=<ms> β€” set the timeout for the command in milliseconds. infinite or -1 waits without a time limit (0xffffffff). she'll wait forever, literally πŸŒ™
  • -v, --verbose β€” increase the level of detail in the output. may be specified multiple times to further increase verbosity. spam the -v, she loves to over-explain πŸ’¬
these options can also be set as machine-wide defaults in nvme-cli.conf(5). a command-line flag always overrides the file. flag > file, every single time. πŸ’…

🌈 EXAMPLES 🌈

  1. connect to a subsystem named nqn.2014-08.com.example:nvme:nvm-subsystem-sn-d78432 on the IP4 address 192.168.1.3. port 4420 is used by default:
# nvme connect --transport=rdma --traddr=192.168.1.3 \
--nqn=nqn.2014-08.com.example:nvme:nvm-subsystem-sn-d78432

look at her go. effortless. πŸ¦‹βœ¨


⭐ SEE ALSO ⭐

nvme-discover(1) nvme-connect-all(1) β€” go read those next, bestie, they're the sequel πŸŽ€


πŸ‘‘ AUTHORS πŸ‘‘

this was co-written by Jay Freyensee[1] and Christoph Hellwig[2]. two icons, one manpage πŸ’–


πŸ“ NVME πŸ“

part of the nvme-user suite 🫢


πŸ“ NOTES πŸ“

  1. Jay Freyensee β€” mailto:james.p.freyensee@intel.com
  2. Christoph Hellwig β€” mailto:hch@lst.de

okay that's the whole thing, you're officially educated πŸ’…βœ¨ this was the NVMe manual, dated 10/30/2026 β€” go forth and connect responsibly, bestie πŸŒΈπŸ’–πŸŽ€

πŸ“¦ where this page comes from