Use this when splitting NVMe drives into namespaces.
NVMe Namespaces
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.
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.
controller → namespaces → /dev/nvmeXnY
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 · 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.
- Each namespace is its own block device.
- Create and attach with nvme-cli.
- Not all drives support multiple namespaces.
nvme list-ns /dev/nvme0— namespacesnvme id-ns /dev/nvme0n1— namespace detailsnvme 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.
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
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%