NVME-ID-CTRL(1)

πŸ’… NVME-ID-CTRL(1) β€” the nvme-id-ctrl glow-up

okay bestie, this is a page from the NVMe Manual, and it's literally about sending an Identify Controller command and getting the result + structure back. slay. let's get into it πŸŽ€


✨ NAME ✨

nvme-id-ctrl β€” send NVMe Identify Controller, return result and structure. that's it, that's the whole vibe πŸ’–


🌸 SYNOPSIS 🌸

nvme [<global-options>] id ctrl <device>
                        [--vendor-specific | -V]
                        [--raw-binary | -b]

πŸ¦‹ DESCRIPTION πŸ¦‹

so for the NVMe device you hand it, it sends an identify controller command and gives you back the result and the returned structure. no cap. ✨

the <device> parameter is mandatory, and it can be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1). pick your fighter πŸ’…

on success, the structure comes back in one of several ways depending on the option flags β€” either the structure gets parsed by the program, or the raw buffer gets printed to stdout. your call, main character. 🌈

🫢 heads up, the bare nvme id-ctrl form (without a space) still works as a deprecated alias and will be removed in a future major version. new scripts should use nvme id ctrl instead. it's giving "we're retiring this, respectfully". πŸ’€

πŸ‘‘ OPTIONS πŸ‘‘

  • -b, --raw-binary β€” prints the raw buffer to stdout, and the structure is not parsed by the program. this one overrides the vendor specific and human readable options, so it's lowkey the boss of the group. 😀
  • -V, --vendor-specific β€” in addition to parsing known fields, this dumps the vendor specific region of the structure in hex with ascii interpretation. iconic. ✨

🧚 GLOBAL OPTIONS 🧚

these ones are defined at the top-level nvme command and are available to this subcommand β€” so they're like, universally invited to the party πŸŽ€

  • --dry-run β€” print the command that would be executed, but don't actually execute it. a vibe check before the real thing πŸ’…
  • --no-ioctl-probing β€” disables probing for 64-bit IOCTL support. simple as that. πŸ¦‹
  • --no-retries β€” disables retry logic on transient errors. one shot, no second chances, periodt. πŸ’€
  • -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, so don't get greedy bestie 🌸
  • --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. other versions are rejected β€” no gatecrashing πŸ™ˆ
  • --quiet β€” suppresses informational messages. errors are still reported, and --quiet cancels any --verbose for the library log level. it's giving "shhh, i'm focusing" ✨
  • --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. very key-value of you πŸ”₯
  • --timeout=<ms> β€” sets the timeout for the command in milliseconds. infinite or -1 waits without a time limit (0xffffffff). unlimited patience energy πŸ§˜β€β™€οΈ
  • -v, --verbose β€” increases the level of detail in the output. may be specified multiple times to further increase verbosity. stack it like a true icon πŸ‘‘
πŸ’œ btw these options can also be set as machine-wide defaults in nvme-cli.conf(5). a command-line flag always overrides the file. no cap, the flag wins every time. 🫢

πŸ’– EXAMPLES πŸ’–

  • has the program interpret the returned buffer and display the known fields in a human readable format:
# nvme id ctrl /dev/nvme0
  • in addition to showing the known fields, has the program display the vendor unique field:
# nvme id ctrl /dev/nvme0 --vendor-specific
# nvme id ctrl /dev/nvme0 -V

the above will dump the vs buffer in hex since it doesn't know how to interpret it. honestly relatable, nobody knows what's in there πŸ’€

  • have the program return the raw structure in binary:
# nvme id ctrl /dev/nvme0 --raw-binary > id_ctrl.raw
# nvme id ctrl /dev/nvme0 -b > id_ctrl.raw

it is probably a bad idea to not redirect stdout when using this mode. like, seriously, redirect it. πŸ™ˆ

  • alternatively you may want to send the data to another program that can parse the raw buffer.
# nvme id ctrl /dev/nvme0 --raw-binary | nvme_parse_id_ctrl

the parse program in the above example can be a program that shows the structure in a way you like. the following program is such an example that will parse it and can accept the output through a pipe, '|', as shown in the above example, or you can cat a saved output buffer to it. chef's kiss pipeline behavior πŸ“

/* File: nvme_parse_id_ctrl.c */

#include <linux/nvme.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char **argv)
{
        unsigned char buf[sizeof(struct nvme_id_ctrl)];
        struct nvme_id_ctrl *ctrl = (struct nvme_id_ctrl *)buf;

        if (read(STDIN_FILENO, buf, sizeof(buf)))
                return 1;

        printf("vid   : %#x\n", ctrl->vid);
        printf("ssvid : %#x\n", ctrl->ssvid);
        return 0;
}

🌈 NVME 🌈

part of the nvme-user suite β€” one of us, one of us πŸ’«


and that's the whole page bestie!! 🫢 this little masterpiece is from the NVMe manual, dated 10/30/2026, and yeah β€” it's NVME-ID-CTRL(1), part of the nvme-user suite. go forth and identify some controllers, you absolute legend πŸ‘‘πŸ’…βœ¨

πŸ“¦ where this page comes from