Repository navigation
When an NVMe controller is hot-unplugged or rebooted, why does the block device (e.g., /dev/nvme3n1) still appear in nvme list even after controller nvme3 is removed? Why do controller numbers change across nvme list and nvme list-subsys?
This is expected behavior and by design in the Linux NVMe driver:
-
Controller Numbers Are Not Persistent: The Linux kernel does not guarantee that controller instances (
nvme0,nvme1, etc.) or block device nodes (/dev/nvmeXnY) retain the same index across reboot or hot-unplug/re-plug (PCIe hotplug/DLPAR). When a controller is re-discovered, it is assigned the next available dynamic instance number (e.g.,nvme3becomesnvme4). -
Multipath Namespace Heads Follow the Subsystem, Not the Controller: When NVMe multipath is active, block devices shown in
nvme list(/dev/nvmeSnNand generic char devices/dev/ngSnN) are multipath namespace heads. They are indexed by the subsystem instance (nvme-subsysS), not by a single controller:-
/dev/nvme3n1belongs tonvme-subsys3. -
/dev/nvme2n1belongs tonvme-subsys2.
If a namespace is shared across multiple controllers (paths) within a subsystem, removing one controller (e.g.,
nvme3) leaves other controllers active (e.g.,nvme1). As long as at least one path tonvme-subsys3remains live, the subsystem and its namespace heads remain intact and their device nodes do not disappear. -
-
Do not rely on persistent
/dev/nvmeXor/dev/nvmeXnYnames in scripts, automation, or test cases. -
Correlating Topology: Run
nvme list -vornvme list-subsys -vto view subsystems, controllers, and namespaces organized together hierarchically. -
Stable Device Addressing: Identify and mount devices using persistent identifiers such as:
- Persistent symlinks under
/dev/disk/by-id/(e.g.,nvme-eui.*,nvme-nvme.*) - Subsystem NQN (
nvme-subsysX - NQN=...)
- Persistent symlinks under
Getting Started
Connecting to NVMe-oF Targets
- How to connect to a target
- How to connect to a target over Fibre Channel
- How to configure NVMe-oF connections (nvme-fabrics.conf)
- Using
--host-traddrand--host-iface - How to set up inband authentication
- How to set up TLS for NVMe-TCP
- How to set up NVMe-oF autoconnect
- NVMe-oF Persistent Discovery Controllers (PDC)
- NVMe-oF Multipath and ANA
- nvme-discoverd
Security & Encryption
- The
nvme keysPlugin - How to securely erase an NVMe device
- TCG Opal with nvme‐cli and cryptsetup
- nvme-keysd
- Privilege Separation
Monitoring
Reference
Contributing / Development