Pcornel
Browse topics
Options
Recent
Favorites
Storage · Technical reference

NVMe Namespaces

Direct 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.

When to use this

Use this when splitting NVMe drives into namespaces.

First 30 seconds

1. Namespaces split an NVMe drive into independent block devices.

2. Used for multi-tenant, NVMe-oF and ZNS.

3. Create/attach with nvme-cli.

4. Each namespace has its own LBA format.

5. Check supported count.

Operational verification

controller → namespaces → /dev/nvmeXnY

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Physical storage media and interfaces
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformPhysical storage media and interfaces
Scope / prerequisiteUse this when splitting NVMe drives into namespaces.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Common mistakes Narrow the fault
  • Deleting a namespace with data (nvme delete-ns).
  • Mixing 512 B and 4 KiB LBA formats unknowingly.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Each namespace is its own block device.
  • Create and attach with nvme-cli.
  • Not all drives support multiple namespaces.
Key checks
  • nvme list-ns /dev/nvme0 — namespaces
  • nvme id-ns /dev/nvme0n1 — namespace details
  • nvme create-ns /dev/nvme0 --nsze=... --ncap=... — create (destructive planning)
ReferenceImportant terms & boundaries2 sections · depth on demand

What namespaces are

A namespace is a logical block device on an NVMe controller (/dev/nvme0n1). Enterprise drives can be split into several namespaces with different sizes or LBA formats; NVMe-oF targets export namespaces to hosts.

In depth

A namespace is a slice of NVMe capacity presented as its own block device (/dev/nvme0n1, nvme0n2…). Enterprise drives and NVMe-oF arrays can create several namespaces with different sizes and formats; consumer drives usually have exactly one.

nvme list-ns /dev/nvme0 --all
nvme id-ns /dev/nvme0n1 -H | grep 'LBA Format'   # 512 vs 4096-byte sectors
nvme create-ns /dev/nvme0 --nsze=<blocks> --ncap=<blocks> --flbas=0
nvme attach-ns /dev/nvme0 --namespace-id=2 --controllers=0

Reformatting a namespace to 4K LBA (nvme format --lbaf=1) can improve performance but erases its data.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Commands

nvme list
nvme id-ctrl /dev/nvme0 | grep -E 'nn|tnvmcap'      # max namespaces, total capacity
nvme list-ns /dev/nvme0 --all
nvme create-ns /dev/nvme0 --nsze=<blocks> --ncap=<blocks> --flbas=0
nvme attach-ns /dev/nvme0 --namespace-id=2 --controllers=0

Documented example, not captured output. Most client SSDs support one namespace; enterprise drives support many (used for multi-tenancy, separate wear zones or NVMe-oF exports). Each namespace appears as /dev/nvme0nN.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docPhysical storage media and interfaces current

Authoritative/upstream documentation reviewed for bounded claims in Physical Storage Media → NVMe → NVMe Namespaces. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://nvmexpress.org/specifications/ · confidence 94%
Confirmation

Confirm action

Continue?