What is a namespace in NVME

What are NVME namespaces? How do you work?


I recently started supporting Linux installed on devices with built-in nvme SSDs. I noticed that the device files had an additional number that went beyond a number indicating the drive number and partition number. IDE / SATA / SCSI drives usually only have a drive letter and a partition number.

For example: / dev / nvme0n1p2

I was wondering what the n1 part was and after some searching it looks like it is identifying an nvme namespace. The definitions for this were vague: "An NVMe namespace is a set of nonvolatile memory (NVM) that can be formatted into logical blocks."

So is it a partition that is defined at the hardware controller level and not in an MBR or GPT partition table? Can a namespace span multiple NVME physical SSDs? For example, can you create a namespace that combines the storage of multiple SSDs into a single logical namespace, similar to RAID 0?

What would you do with an NVME namespace that you can't already achieve with partition tables or LVM or a file system that can manage multiple volumes (like ZFS, Btrfs, etc.)?

Why does namespace numbering seem to start at 1 instead of 0? Does this just have anything to do with the way NVME keeps track of namespace numbers at a low level (e.g. partitions also start at 1 instead of 0 as that is how it set the default for partition numbers and the Linux kernel only the partition number used that is stored on the hard drive - I think NVME works the same way?)

Reply:


In NVM Express and related standards, controllers grant access to storage that is divided into one or more namespaces. Namespaces can above created and deleted the controller become if there is room for them (or the underlying storage supports thin provisioning), and multiple controllers can grant access to a shared namespace. How the underlying storage is organized is, as far as I can tell, not dictated by the standard.

Typical NVMe SSDs cannot be combined, however, since they each provide their own storage and controller on a PCI Express port and the access point is the controller via namespaces. Therefore, a namespace cannot group multiple controllers (multiple controllers can do that Grant access to a shared namespace). It is better to think of namespaces like SCSI LUNs as used in corporate storage (SANs, etc.).

Namespace numbering starts at 1 because this is how the namespace IDs per controller work. Namespaces also have longer, globally unique identifiers.

Namespaces can be edited using the command that provides low-level support for NVMe features including:

  • Formatting that performs a low-level format and allows the use of various functions (secure deletion, selection of the LBA format ...);
  • Append and Detach, which allows controllers to be appended or detached from a namespace (if they support it and the namespace allows it).

The coupling and uncoupling is not found in NVMe drives for laptops or desktops. You can use it with NVMe storage bays, such as those sold by Dell EMC, that replace the iSCSI SANs of the past.

For more information, see the NVM Express standards (they are relatively easy to read) and this tutorial presentation on NVM Express which is a good introduction.



We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By continuing, you consent to our use of cookies and other tracking technologies and affirm you're at least 16 years old or have consent from a parent or guardian.

You can read details in our Cookie policy and Privacy policy.