libnvme(9)

πŸ“¦ version 3.2, in arch rolling

πŸ’– libnvme β€” struct nvme_id_ns πŸ’–

okay bestie, buckle up πŸ’… this page is from the API Manual for libnvme, and it's literally just one struct: struct nvme_id_ns. that's it. that's the whole vibe. it's the Identify Namespace data structure and it's lowkey the main character of this page ✨


🌸 NAME 🌸

struct nvme_id_ns β€” the Identify Namespace data structure. she's iconic, she's long, she's got 40-something members and we're gonna meet every single one 🫢


✨ SYNOPSIS ✨

here's the whole struct, copied exactly, no cap:

struct nvme_id_ns {
    __le64 nsze;
    __le64 ncap;
    __le64 nuse;
    __u8 nsfeat;
    __u8 nlbaf;
    __u8 flbas;
    __u8 mc;
    __u8 dpc;
    __u8 dps;
    __u8 nmic;
    __u8 rescap;
    __u8 fpi;
    __u8 dlfeat;
    __le16 nawun;
    __le16 nawupf;
    __le16 nacwu;
    __le16 nabsn;
    __le16 nabo;
    __le16 nabspf;
    __le16 noiob;
    __u8 nvmcap[16];
    __le16 npwg;
    __le16 npwa;
    __le16 npdg;
    __le16 npda;
    __le16 nows;
    __le16 mssrl;
    __le32 mcl;
    __u8 msrc;
    __u8 kpios;
    __u8 nulbaf;
    __u8 rsvd83;
    __le32 kpiodaag;
    __u8 rsvd88[4];
    __le32 anagrpid;
    __u8 rsvd96[3];
    __u8 nsattr;
    __le16 nvmsetid;
    __le16 endgid;
    __u8 nguid[16];
    __u8 eui64[8];
    struct nvme_lbaf        lbaf[64];
    __u8 vs[3712];
 };

like. look at her. __le64 to __u8 to arrays, it's giving full range πŸ”₯


πŸ¦‹ Members πŸ¦‹

okay so every single field, in order, zero skips, let's go πŸŽ€

  • nsze β€” Namespace Size πŸ’« this is the total size of the namespace, measured in logical blocks. the number of logical blocks is based on the formatted LBA size.
  • ncap β€” Namespace Capacity πŸ’« the max number of logical blocks that may be allocated in the namespace at any point in time. again, number of logical blocks is based on the formatted LBA size.
  • nuse β€” Namespace Utilization πŸ’« the current number of logical blocks allocated in the namespace. this one is smaller than or equal to the Namespace Capacity (so nuse ≀ ncap, we love an ordered relationship ✨). number of logical blocks, once more, based on the formatted LBA size.
  • nsfeat β€” Namespace Features, see enum nvme_id_nsfeat.
  • nlbaf β€” Number of LBA Formats πŸ’« defines how many supported LBA data size + metadata size combos the namespace supports β€” and also the highest possible index into struct nvme_id_ns.lbaf. so she's both a count and a ceiling, multi-talented πŸ‘‘
  • flbas β€” Formatted LBA Size, see enum nvme_id_ns_flbas.
  • mc β€” Metadata Capabilities, see enum nvme_id_ns_mc.
  • dpc β€” End-to-end Data Protection Capabilities, see enum nvme_id_ns_dpc.
  • dps β€” End-to-end Data Protection Type Settings, see enum nvme_id_ns_dps.
  • nmic β€” Namespace Multi-path I/O and Namespace Sharing Capabilities, see enum nvme_id_ns_nmic. long name, big energy πŸ’…
  • rescap β€” Reservation Capabilities, see enum nvme_id_ns_rescap.
  • fpi β€” Format Progress Indicator, see enum nvme_nd_ns_fpi. (yes, that's nvme_nd_ns_fpi, exactly like that β€” keep it as-is, don't "fix" it fr fr)
  • dlfeat β€” Deallocate Logical Block Features, see enum nvme_id_ns_dlfeat.
  • nawun β€” Namespace Atomic Write Unit Normal πŸ’« the namespace-specific size of the write operation that's guaranteed to be written atomically to the NVM during normal operation. atomic queen ⭐
  • nawupf β€” Namespace Atomic Write Unit Power Fail πŸ’« the namespace-specific size of the write operation guaranteed to be written atomically to the NVM during a power fail or error condition. yeah, she keeps it together even in chaos 😭
  • nacwu β€” Namespace Atomic Compare & Write Unit πŸ’« the namespace-specific size of the write operation guaranteed to be written atomically to the NVM for a Compare and Write fused command.
  • nabsn β€” Namespace Atomic Boundary Size Normal πŸ’« the atomic boundary size for this namespace for the NAWUN value. specified in logical blocks.
  • nabo β€” Namespace Atomic Boundary Offset πŸ’« the LBA on this namespace where the first atomic boundary starts.
  • nabspf β€” Namespace Atomic Boundary Size Power Fail πŸ’« the atomic boundary size for this namespace, specific to the Namespace Atomic Write Unit Power Fail value. specified in logical blocks.
  • noiob β€” Namespace Optimal I/O Boundary πŸ’« the optimal I/O boundary for this namespace, specified in logical blocks. the host should construct Read and Write commands that don't cross the I/O boundary β€” that's how you get optimal performance ✨
  • nvmcap β€” NVM Capacity πŸ’« the total size of the NVM allocated to this namespace. the value is in bytes (yes, bytes, not blocks β€” read the label bestie πŸ“).
  • npwg β€” Namespace Preferred Write Granularity πŸ’« the smallest recommended write granularity in logical blocks for this namespace. this is a 0's based value.
  • npwa β€” Namespace Preferred Write Alignment πŸ’« the recommended write alignment in logical blocks for this namespace. also a 0's based value.
  • npdg β€” Namespace Preferred Deallocate Granularity πŸ’« the recommended granularity in logical blocks for the Dataset Management command with the Attribute - Deallocate bit.
  • npda β€” Namespace Preferred Deallocate Alignment πŸ’« the recommended alignment in logical blocks for the Dataset Management command with the Attribute - Deallocate bit.
  • nows β€” Namespace Optimal Write Size πŸ’« the size in logical blocks for optimal write performance for this namespace. 0's based value, you know the drill πŸ’…
  • mssrl β€” Maximum Single Source Range Length πŸ’« the max number of logical blocks that may be specified in each valid Source Range field of a Copy command.
  • mcl β€” Maximum Copy Length πŸ’« the max number of logical blocks that may be specified in a Copy command.
  • msrc β€” Maximum Source Range Count πŸ’« the max number of Source Range entries that may be used to specify source data in a Copy command. this is a 0’s based value.
  • kpios β€” Key Per I/O Status πŸ’« indicates the namespace's Key Per I/O capability status.
  • nulbaf β€” Number of Unique Capability LBA Formats πŸ’« defines how many supported user data size + metadata size combos the namespace supports that may not share the same capabilities. LBA formats shall be allocated in order and packed sequentially (order matters, no skipping ahead πŸ™ˆ).
  • rsvd83 β€” Reserved.
  • kpiodaag β€” Key Per I/O Data Access Alignment and Granularity πŸ’« the alignment and granularity in logical blocks required for commands that support a KPIOTAG value in the CETYPE field.
  • rsvd88 β€” Reserved.
  • anagrpid β€” ANA Group Identifier πŸ’« the ANA Group Identifier of the ANA group that this namespace is a member of.
  • rsvd96 β€” Reserved.
  • nsattr β€” Namespace Attributes, see enum nvme_id_ns_attr.
  • nvmsetid β€” NVM Set Identifier πŸ’« the NVM Set this namespace is associated with.
  • endgid β€” Endurance Group Identifier πŸ’« the Endurance Group this namespace is associated with.
  • nguid β€” Namespace Globally Unique Identifier πŸ’« a 128-bit value that's globally unique and assigned to the namespace when the namespace is created. this field stays fixed for the entire life of the namespace and is preserved across namespace and controller operations 🫢 (she's loyal).
  • eui64 β€” IEEE Extended Unique Identifier πŸ’« a 64-bit IEEE Extended Unique Identifier (EUI-64) that's globally unique and assigned to the namespace when the namespace is created. this field stays fixed for the whole life of the namespace and is preserved across namespace and controller operations. same loyalty arc, smaller number 🌈
  • lbaf β€” LBA Format, see struct nvme_lbaf.
  • vs β€” Vendor Specific. (that's where the vendor does vendor things πŸ’€)
lowkey reminder: rsvd83, rsvd88, and rsvd96 are Reserved β€” don't go poking at them like they're free real estate, they are NOT πŸ™ˆ

🧚 sign-off 🧚

that's the whole page bestie, every field accounted for, nothing dropped πŸ’– this was struct nvme_id_ns, brought to you by libnvme(9) in the API Manual, dated October 2026 🌸 slay, bye πŸ‘‹πŸ’…

πŸ“¦ where this page comes from