libnvme(9)
π 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 (sonuseβ€ncap, we love an ordered relationship β¨). number of logical blocks, once more, based on the formatted LBA size.nsfeatβ Namespace Features, seeenum 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 intostruct nvme_id_ns.lbaf. so she's both a count and a ceiling, multi-talented πflbasβ Formatted LBA Size, seeenum nvme_id_ns_flbas.mcβ Metadata Capabilities, seeenum nvme_id_ns_mc.dpcβ End-to-end Data Protection Capabilities, seeenum nvme_id_ns_dpc.dpsβ End-to-end Data Protection Type Settings, seeenum nvme_id_ns_dps.nmicβ Namespace Multi-path I/O and Namespace Sharing Capabilities, seeenum nvme_id_ns_nmic. long name, big energy πrescapβ Reservation Capabilities, seeenum nvme_id_ns_rescap.fpiβ Format Progress Indicator, seeenum nvme_nd_ns_fpi. (yes, that'snvme_nd_ns_fpi, exactly like that β keep it as-is, don't "fix" it fr fr)dlfeatβ Deallocate Logical Block Features, seeenum 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 theNAWUNvalue. 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 aKPIOTAGvalue in theCETYPEfield.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, seeenum 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, seestruct nvme_lbaf.vsβ Vendor Specific. (that's where the vendor does vendor things π)
lowkey reminder:rsvd83,rsvd88, andrsvd96are 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
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms