Research notes / Storage geometry
512e, 4Kn and alignment: geometry is not durability
Published 12 October 2026 · Updated 10 November 2026 · Source review and arithmetic, not a device benchmark
An aligned partition is only a starting point. Individual writes still have offsets and lengths, while durable completion and protection from torn writes require separate guarantees.
On this page11 sections
Two sector sizes, three familiar formats
A logical sector is an addressing unit; a physical sector describes device-level read/write granularity. The format names below distinguish these two sizes, not filesystem allocation units. Microsoft's historical compatibility guide documents this distinction; its old operating-system support table is not current deployment advice. [1]
| Format | Logical | Physical | Relationship |
|---|---|---|---|
| 512n | 512 | 512 | Equal address and physical units |
| 512e | 512 | 4096 | Eight logical sectors per physical sector |
| 4Kn | 4096 | 4096 | No 512-byte addressing emulation |
On 512e, replacing part of a physical sector can require preserving its other bytes through read-modify-write. Seagate identifies both misalignment and small writes as causes, and discusses caching that combines updates. One host write therefore cannot simply be counted as one media RMW operation. [2]
An address is not a block count or a byte offset
A logical block address (LBA) selects a logical block within a device or namespace. It does not identify a physical-media location. Record the addressed device or namespace and logical-block data size before interpreting the number. [14]
For a linear, zero-based data address space, start byte = LBA times data bytes per block. Eight blocks beginning at LBA 8 cover addresses 8 through 15 in both examples below. Metadata is excluded; these are calculated data positions, not file offsets, transfer-buffer layouts or physical placement.
| Data bytes/block | Start LBA | Block count | Start byte | Data length (B) |
|---|---|---|---|---|
| 512 | 8 | 8 | 4096 | 4096 |
| 4096 | 8 | 8 | 32768 | 32768 |
Decode the field before doing arithmetic. NVMe NVM Command Set 1.0e Read NLB=7 means eight blocks; its NSZE=8 instead describes a namespace containing LBAs 0 through 7, too small for the request above. There is no universal add-one rule. [13]
Does the entire range fit?
Let N be the address-space block count, S the start LBA and C the already decoded block count. For nonnegative integer S and N and positive integer C, require S < N and then C <= N - S. Checking the start first avoids unsigned subtraction underflow; this form also avoids a fixed-width S + C overflow. These conditions are derived from the zero-based address interval, not a separate command encoding.
| Block count N | Start S | Request count C | Entire range fits? |
|---|---|---|---|
| 8 | 0 | 8 | Yes |
| 8 | 7 | 1 | Yes |
| 8 | 7 | 2 | No |
| 8 | 8 | 1 | No |
This checks only address-space containment, not transfer limits, allocation, command success or durable completion. In NVMe, use NSZE for the address interval: NCAP limits the number of blocks that may be allocated at once, while NUSE is the allocation-reporting field, subject to capability and access-state rules. Neither is a substitute for the address bound. [13] The downloadable model requires BigInt inputs, rejects a zero request count and retains exact integer values. No device or namespace was created.
Why utilization is not filesystem used space
In NVM Command Set 1.0e, NSFEAT.THINP=0 requires NCAP=NSZE and permits NUSE to remain equal to NCAP; THINP=1 requires allocated-block tracking. For a controller supporting ANA, NUSE and NVMCAP are cleared to zero when its relationship with the namespace is ANA Inaccessible or ANA Persistent Loss. [13]
Therefore NUSE is not a filesystem-used-space counter, and zero alone proves neither an empty namespace nor erased data. Retain controller/path state with the observation. This is an interpretation of the reporting contract, not a new device measurement.
Check units as well as names: NVMCAP is reported in bytes, while NSZE, NCAP and NUSE count logical blocks. NVMCAP need not equal NSZE times the logical block data size; the specification permits either a larger or a smaller value because of provisioning and other settings. Do not multiply it by the block size again. [13]
Linux 6.17 block-statistics sector counters use 512-byte units even when the device's logical blocks are 4096 bytes. Multiplying such a counter by the discovered device block size would overstate its byte count by eight in that case. [15] The downloadable integer calculations generate the table; no device was queried for these inputs.
A stable LBA can hide a changed physical location
Sector slipping skips defective positions when assigning logical blocks. Alternate-sector remapping instead redirects a block to replacement storage. Seagate's Barracuda 9 manual distinguishes format-time slipping from automatic reallocation and later command-driven reassignment. [17]
The Hoskins patent describes full-volume slipping plus separate redirection for newly identified defects. It demonstrates a design distinction, not universal modern firmware behavior. [18] Neither mechanism is the IBM 3340's within-record gap handling.
| Mechanism | Mapping change | Do not infer |
|---|---|---|
| Sector slipping | Number usable positions past excluded sectors | A one-track-only implementation |
| Alternate-sector remapping | Point an existing LBA to a replacement | Recovery of its old contents |
This matters during recovery: Seagate's SCSI manual Rev. J says REASSIGN BLOCKS does not retain the listed blocks' data, although other blocks are preserved on successful completion. It recommends recovering the affected contents before reassignment and writing them back afterwards. [19] This historical command contract is not a safe repair recipe for an arbitrary drive. No command was executed here.
Failure is not an all-or-nothing result. In section 5.27.1 of the same revision, running out of replacement space can leave the reassignment list partly processed. The returned first-unprocessed address is useful when available, but FFFFFFFFh can mean either that the address is unknown or that all listed defects were reassigned. That sentinel alone establishes neither completion nor rollback. An unrelated block can also suffer an unrecoverable read error during the operation. A CHECK CONDITION result therefore needs its specific sense data and revision context, not a blanket "nothing changed" interpretation. [19]
The broader slip-sparing family also includes track-level schemes: Ruemmler and Wilkes describe the HP C2240 using slip-track sparing at format time and individual-track remapping during operation. Their model needed reserved-area layout and rotational position, yet omitted individual spared-sector effects. [20] The practical inference is narrower than "remapped means slow": a defect count alone does not identify the locations, workload or resulting latency.
One aligned partition, three different writes
These constructed examples assume a 512e interface, zero device alignment offset and direct linear mapping from the partition to the device. Offsets are byte offsets in that mapping, not arbitrary file offsets. The partition at 1 MiB begins at byte 1,048,576, which is divisible by 4096. This is address geometry, not measured media operations.
| Case | Partition start (B) | Relative offset (B) | Length (B) | Sectors touched | Whole sectors only? |
|---|---|---|---|---|---|
| Aligned, full sector | 1048576 | 0 | 4096 | 1 | Yes |
| Aligned, small update | 1048576 | 0 | 512 | 1 | No |
| Aligned partition, shifted I/O | 1048576 | 512 | 4096 | 2 | No |
| Shifted partition start | 32256 | 0 | 4096 | 2 | No |
The second row touches only one physical sector but replaces one eighth of it. In the third, the partition is aligned yet the 4096-byte write straddles two sectors. Moving the partition cannot, by itself, fix every request shape. The fourth row uses a hypothetical start at 63 logical sectors: 63 × 512 = 32,256 bytes.
For device-relative start o, positive byte length n and physical-sector size P, the number of intersected sectors is:
floor((o + n - 1) / P) - floor(o / P) + 1
Whole-sector coverage additionally requires both o and n to be multiples of P. The calculation and example inputs generate this table at build time. Counts do not predict latency, command count, flash write amplification or the number of actual RMW cycles.
Read the topology at the layer being used
Linux 6.12 exposes distinct values for logical size, physical size, alignment offset and preferred I/O sizes. In stacked storage, the physical-block report can come from component constraints; it is not a probe of hidden NAND geometry. [3]
logical_block_size/physical_block_size- Addressing unit and reported physical write granularity.
alignment_offset- Byte displacement of a device or partition start from natural alignment.
minimum_io_size- Preferred minimum request granularity. A smaller request is not automatically invalid; the logical sector and the I/O API impose their own constraints.
optimal_io_size- Preferred sustained-I/O unit. Zero means no value was reported, not that every size performs equally well.
Record the actual device or volume path with these observations. Applying the table's zero-offset arithmetic to a remapped, striped or differently aligned device without checking its mapping would change the problem being calculated.
Unbuffered access adds API-specific constraints. Microsoft's file-buffering documentation separates access sizes and offsets from memory-buffer alignment, and notes that disabling system buffering does not remove hardware caching. Check the API contract as well as the sector format. [4]
Inspect the path without rewriting the disk
Select explicit columns so an observation does not depend on changing command defaults. The following commands only query information. Replace the example device paths with the disk and partition actually being inspected; device permissions may restrict blockdev. Record both tool and kernel versions. [8] [9]
uname -r
lsblk --version
lsblk --bytes --output NAME,TYPE,LOG-SEC,PHY-SEC,MIN-IO,OPT-IO,ALIGNMENT
blockdev --getiomin /dev/sda
blockdev --getioopt /dev/sda
blockdev --getalignoff /dev/sda
blockdev --getalignoff /dev/sda1A partition row can inherit its parent's queue attributes, while its alignment depends on its own start. Repeated MIN-IO or OPT-IO values are therefore not independent device measurements. After a recent device change, let udev finish before reading its properties. [8]
Linux 6.12 also raises io_min to at least the physical block size during queue-limit validation. A plausible-looking number can be a default, not evidence that a benchmark established an optimum. Keep the reported hint separate from the workload size eventually chosen. [10]
The alignment offset needs special handling: blockdev --getalignoff can report -1 when Linux 6.12 marks the queue topology as misaligned. This is a sentinel, not a negative byte displacement to insert into the coverage formula. In that kernel, partition sysfs formats the value as unsigned and can instead show 4294967295. Retain the raw value and version when diagnosing this case. [10] [11] [12]
For direct sysfs inspection, disk alignment lives at /sys/block/sda/alignment_offset and partition alignment at /sys/block/sda/sda1/alignment_offset, outside queue/. Neither the recipe nor a zero offset validates every future request or establishes power-loss behavior. [3]
Which direction does the offset measure?
For a compatible queue, Linux 6.12 computes a partition's reported offset using granularity G = max(physical_block_size, minimum_io_size), parent offset A and partition-start byte address S. The result is (G + A - (S mod G)) mod G, not simply S mod G. [10]
| Start S (B) | G (B) | Parent A (B) | Reported offset (B) |
|---|---|---|---|
| 1048576 | 4096 | 0 | 0 |
| 1049088 | 4096 | 0 | 3584 |
| 32256 | 4096 | 0 | 512 |
| 1048576 | 4096 | 512 | 512 |
In the second row, the start is 512 bytes past a boundary but the reported value is 3584 bytes, the forward distance to the next boundary in this linear example. The fourth row shows why divisibility of the partition start alone is insufficient. These examples assume valid size limits and no misaligned-topology flag; the sentinel case above must be handled separately. This calculation does not recommend moving a partition or predict performance.
The downloadable calculation generates both tables. Its offset inputs use bytes; the kernel's partition-start argument uses 512-byte sectors, including on devices with larger logical sectors.
Geometry, atomicity and persistence are separate
“Physical sector” is sometimes described using the word atomic in documentation. That wording must not be extended into a promise that any application transaction survives power loss. Linux ext4's atomic-write documentation describes explicit capability, request and alignment requirements for torn-write protection. A sector-format label alone does not establish that contract. [6]
A device with volatile write-back cache can acknowledge an ordinary write before it reaches nonvolatile storage. Linux documents cache flush and Force Unit Access separately from address geometry. Correct alignment does not issue either operation. [5]
Keep the questions separate: is the request valid, does it cover whole physical sectors, is the required update atomic under the stated failure model, and when is completion durable? The fsync error review explains why a failed persistence request is not repaired by merely relabelling the data as written.
What a power-cut experiment actually demonstrated
Zheng, Tucek, Qin and Lillibridge (FAST 2013) tested 15 SSDs representing ten models using hardware power cuts. Their raw-device workload used direct, synchronized I/O. Section 5.3 reports mixed old/new data within 4 KiB records on three devices, termed shorn writes. This is evidence about the tested devices and fault workload, not a modern SSD failure rate or a benchmark comparing 512e with 4Kn. [7]
Read the accompanying erratum when inspecting the paper's diagrams: it corrects the display of Figures 1, 6 and 7, including the shorn-write illustration. It is a figure-rendering correction, not a new device sample. [16]
The practical inference is narrow: request geometry does not prove failure behavior. Keep the tested update boundary explicit when discussing a torn write. For today's Linux API contract, see the separate atomic-write analysis; it is not a replication of the 2013 experiment.
Method and limits
This is a primary-source synthesis with four sector-coverage examples, four partition-offset examples, two logical-address examples and four range-containment examples. No drive was written, repartitioned or benchmarked. The arithmetic has no cache, controller, filesystem or failure model; it does not estimate a slowdown or a failure probability. Linux 6.12 is the fixed ABI/cache reference. The separately linked ext4 documentation was reviewed on 12 October 2026; feature support must be checked against the deployed version. The topology inspection section was added on 19 October 2026 against Linux 6.12 source and util-linux 2.40.2 documentation. Its commands are a recipe, not captured output from a tested disk.
Related corpus records: logical sector, physical sector, Advanced Format, 512e, 4Kn and partition alignment.
Primary sources
- Microsoft: Advanced format disk compatibility update, sector formats and alignment issues
- Seagate: Transition to Advanced Format 4K Sector Hard Drives, emulation and read-modify-write
- Linux 6.12: stable sysfs block ABI, sector sizes and I/O topology
- Microsoft: File buffering, alignment and file access requirements
- Linux 6.12: Explicit volatile write back cache control
- Linux ext4 documentation: Atomic Block Writes, requirements and semantics
- Zheng, Tucek, Qin and Lillibridge: Understanding the Robustness of SSDs under Power Fault, FAST 2013, sections 4.2 and 5.3
- util-linux 2.40.2: lsblk explicit columns and inherited queue attributes
- util-linux 2.40.2: blockdev query options and byte units
- Linux 6.12: block limits validation and bdev_alignment_offset
- Linux 6.12: partition alignment_offset_show unsigned formatting
- util-linux 2.40.2: signed BLKALIGNOFF query formatting
- NVM Express NVM Command Set Specification 1.0e (2024), definitions 1.4.3.2-6, section 2.1.1 and Figures 47-48, 97
- SNIA Dictionary: logical block and logical block address, edition generated 4 November 2026
- Linux 6.17: block layer statistics, read/write/discard sector units
- USENIX FAST 2013: erratum correcting Figures 1, 6 and 7 in Zheng et al.
- Seagate Barracuda 9 Product Manual, 83329030 Rev. C (July 1997), sections 3.1 and 3.5, pp. 6-7
- Edward Sean Hoskins, Full volume slip defect management in a disc drive, US 6,925,580 B2 (2005), description of Figures 7-17
- Seagate SCSI Interface Product Manual, 77738479 Rev. J (April 1999), section 5.27, pp. 176-177
- Chris Ruemmler and John Wilkes, An introduction to disk drive modeling (IEEE Computer, March 1994), Data layout and Conclusions; author PDF pp. 5 and 15
Source access dates appear in the article metadata; topology references were checked on 19 October 2026. Format definitions and mechanisms are sourced; example inputs and the interpretation checklist are Hesela's explanatory construction.