NDCTL-INIT-LABELS(1)

✨ NAME ✨

okay so bestie, this is ndctl-init-labels from the ndctl manual β€” it's the glow-up command that initializes the label data area on a dimm or a whole lil squad of dimms. πŸ’…


🌸 SYNOPSIS 🌸

ndctl init-labels <nmem0> [<nmem1>..<nmemN>] [<options>]

πŸ’– DESCRIPTION πŸ’–

okay so picture this: the namespace label area is a tiny persistent partition of capacity that lives on some NVDIMM devices. it's not the main character storage-wise, but it IS the planner β€” it's what you use to provision one (or more!!) namespaces out of regions. πŸ—‚οΈ

and here's the tea: starting with v4.10 the kernel will actually honor labels for sub-dividing PMEM, but ONLY if all the DIMMs in an interleave set / region have a valid namespace index block. no valid index block? no sub-dividing. it's giving all-or-nothing. 😀

so this command exists to initialize the namespace index block if it's missing, or reinitialize it if it's damaged. very fixer-upper of it.

⚠️ but bestie listen β€” reinitialization effectively destroys ALL existing namespace labels on the DIMM. like, gone gone. not a drill. 😭

πŸŽ€ EXAMPLE πŸŽ€

first, find the DIMMs that make up a given region:

# ndctl list -RD --region=region1
{
  "dimms":[
    {
      "dev":"nmem0",
      "id":"8680-56341200"
    }
  ],
  "regions":[
    {
      "dev":"region1",
      "size":268435456,
      "available_size":0,
      "type":"pmem",
      "mappings":[
        {
          "dimm":"nmem0",
          "offset":13958643712,
          "length":268435456
        }
      ]
    }
  ]
}

next, disable that region so the DIMM label area can actually be written from userspace:

# ndctl disable-region region1

now initialize the labels, slay:

# ndctl init-labels nmem0

re-enable the region so it can live its truth:

# ndctl enable-region region1

and finally, create a namespace in that region:

# ndctl create-namespace --region=region1

periodt. that's the whole ritual. πŸ•―οΈβœ¨


πŸ‘‘ OPTIONS πŸ‘‘

  • <memory device(s)> β€” a nmemX device name, or a dimm id number. restricts the operation to the dimm(s) you named. you can also pass the keyword all to say "no restrictions, bestie", but ngl that's literally the same as just not supplying a --dimm option at all. πŸ™ƒ
  • -s, --size= β€” limit the operation to the given number of bytes. a size of 0 means "operate over the entire label capacity" β€” the whole thing, head to toe. πŸ’«
  • -O, --offset= β€” begin the operation at the given offset into the label area. pick your starting point, queen.
  • -b, --bus= β€” a bus id number, or a provider string (e.g. "ACPI.NFIT"). restricts the operation to the specified bus(es). the keyword all can be specified to indicate the lack of any restriction, however this is the same as not supplying a --bus option at all. same energy as the dimm one fr fr. 🚌
  • -v β€” turn on verbose debug messages in the library β€” but only if ndctl was built with logging and debug enabled. if it wasn't, this is just vibes. πŸ™ˆ
  • -f, --force β€” force initialization of the label space even if there appears to be an existing / valid namespace index. 🚨 WARNING: this will destroy all defined namespaces on the dimm. it's giving nuclear. be so serious before you type this one. πŸ’€
  • -V, --label-version β€” initialize with a specific version of labels from the namespace label specification. defaults to 1.1. (the 1.1 is the factory setting, the OG, the blueprint. ⭐)

Copyright Β© 2016 - 2022, Intel Corporation. License GPLv2: GNU GPL version 2 http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

πŸ’œ translation: it's free, you can remix it, but there is NO WARRANTY β€” so don't come for anyone if it goes sideways.

🌈 SEE ALSO 🌈


and that's the whole page, bestie!! πŸ¦‹ this one's from the ndctl manual, dated 2026-07-07, and it'll always be known as NDCTL-INIT-LABELS(1) in our hearts. go initialize those labels responsibly, and remember: --force is not a personality trait. πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from