NVME-GEN-HOSTNQN(1)

πŸ’… NVME-GEN-HOSTNQN(1) β€” the nvme manual, bestie edition πŸŽ€

okay so this is a page from the NVMe Manual (yes, like the NVMe manual) and honestly it's a little baddie of a command that just makes you a name. a whole identity. for your host. slay.


✨ NAME ✨

nvme-gen-hostnqn β€” generate a host NVMe Qualified Name 🫢

🌸 SYNOPSIS 🌸

nvme [<global-options>] gen-hostnqn

πŸ’– DESCRIPTION πŸ’–

okay so picture this: you run this and it generates a host NQN, in exactly this form:

nqn.2014-08.org.nvmexpress:uuid:1b4e28ba-2fa1-11d2-883f-0016d3cca427

and then it prints it to stdout. that's it. that's the whole vibe. ✨

Now, the UUID? it's taken from the first of these sources that actually gives a usable value β€” like, it goes down the list and takes the first one that isn't a flop:

  1. the system UUID reported by DMI, from /sys/class/dmi/id/product_uuid or /sys/firmware/dmi/entries.
  2. the firmware device tree, from /proc/device-tree/ibm,partition-uuid.
  3. the local machine ID, /etc/machine-id. and no, bestie, the machine ID itself is never published β€” the UUID is derived from it with HMAC-SHA256 and a fixed application identifier, exactly like systemd's sd_id128_get_machine_app_specific(3) does. keeping it private, we love that for her. πŸ”’
  4. a random UUID, if none of the above is available. ⚠️ heads up: this value is not stable across invocations, and a warning gets printed. so like, don't get attached.

so the tea on sources 1 and 2: they describe the hardware, which means they survive a reinstall. iconic. the machine ID describes the installation and does not survive. πŸ’€ also, a UUID that's all zeros or all ones is just a placeholder that some virtual machines and firmware report β€” it gets skipped. not today, satan.

🚨 ok this part matters: this command must be run as root. the DMI and device tree files are readable by root only, so an unprivileged run can't reach the stable sources, and its output can't be written to /etc/nvme/hostnqn either. so like… sudo. please. πŸ™ˆ

⭐ OPTIONS ⭐

πŸ‘‘ GLOBAL OPTIONS

these are defined at the top-level nvme command and are available to this subcommand. group project, everyone's invited:

  • --dry-run β€” prints the command that would be executed, but does not actually execute it. manifesting without the commitment. πŸ¦‹
  • --no-ioctl-probing β€” disables probing for 64-bit IOCTL support.
  • --no-retries β€” disables retry logic on transient errors. one shot, no second chances.
  • -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 pick a lane. πŸ’…
  • --output-format-version=<version> β€” selects the output format version. version 1 uses the original field naming, while version 2 (default) provides more consistent and script-friendly field names. other versions are rejected. glow-up confirmed. ✨
  • --quiet β€” suppresses informational messages. errors are still reported, and --quiet cancels any --verbose for the library log level. shhh era. 🀫
  • --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, no stress. ⏳
  • -v, --verbose β€” increases the level of detail in the output. may be specified multiple times to further increase verbosity. the more the merrier fr fr.

also!! these options can be set as machine-wide defaults in nvme-cli.conf(5). and a command-line flag always overrides the file. main character energy wins. πŸ‘‘


πŸ“ EXAMPLES πŸ“

nvme gen-hostnqn

like, that's it. go off. ✨


🌈 NVME 🌈

part of the nvme-user suite. one of us, one of us. 🧚


and that's the whole page bestie!! πŸ’œ this one's from the NVMe crew, dated 10/30/2026 β€” go forth and generate those names, and remember: root, or it doesn't count. πŸŽ€πŸ”₯

πŸ“¦ where this page comes from