Pcornel
Storage · Physical Storage Media › NVMe

NVMe Namespaces

Cheat sheet · https://pcornel.dk/topic.php?topic=3896

Back to the Topic

Answer

NVMe namespaces divide an NVMe drive into separate logical block devices, such as /dev/nvme0n1 and nvme0n2, each with its own size and format. They are managed with nvme create-ns and attach-ns.

Remember

  • Each namespace is its own block device.
  • Create and attach with nvme-cli.
  • Not all drives support multiple namespaces.

First checks

  • nvme list-ns /dev/nvme0 — namespaces
  • nvme id-ns /dev/nvme0n1 — namespace details
  • nvme create-ns /dev/nvme0 --nsze=... --ncap=... — create (destructive planning)

Verify in this order

controller → namespaces → /dev/nvmeXnY

Where it usually breaks

First mismatch in media/firmware → device controller → interface/link → host driver → block device → upper storage layer; preserve identity/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3896

Confirmation

Confirm action

Continue?