The Linux kernel's simple naming for a storage device (e.g. /dev/sda, /dev/sdb) can change randomly across boots. Is that true for NVMe storage devices too? These have names such as /dev/nvme0n1p1 and /dev/nvme0n1p2, etc.
1 Answer
Short: No. You can not rely on the name of the descriptor. And you most likely never will.
The NVMe naming standard describes:
- nvme0: first registered device's device controller
- nvme0n1: first registered device's first namespace
- nvme0n1p1: first registered device's first namespace's first partition
So the overall naming is depended on your physical layout. And that can change depending on you use case by adding/removing block devices, drive failures, etc.
Basically the same as with the sd_ descriptors.
What you can rely on is the order of the listed partitions for each device, as those are getting stored on and read from the block device' partition table. As long as you do not change the partition layout, the order stays the same.
In the end, referring to either to the device UUID or PARTUUID is still the best practise, even with NVMe. Depending on the use case, referring to the LABEL might be more convenient.
-
1This answer can be improved by linking to the NVMe Naming Standard.Elijah Lynn– Elijah Lynn2019-10-26 08:31:05 +00:00Commented Oct 26, 2019 at 8:31
by-uuid, etc., AFAICT. So why not use them?by-uuid,by-idandby-pathand not necessarily appropriate. Sometimes labels might be preferred., for example However, as far as I am concerned that discussion is off topic. I'm trying to keep this question simple and focused. In this question I want to know whether the NVMe names are subject to the same limitations as regular sdX names.by-*, and that's what's in the title.