Alignment offset
Alignment offset describes the byte displacement of a block device or partition start from the storage stack's natural alignment.
Query the path actually used. In Linux 6.12, bdev_alignment_offset incorporates a partition's start and returns -1 when the queue carries a misaligned-topology flag. This sentinel is not a byte displacement. [2]
The signed blockdev --getalignoff query preserves -1. Partition sysfs in that kernel instead formats the result as unsigned and can show 4294967295; do not apply either sentinel as an ordinary offset. [4] [3]
For compatible partition limits, Linux uses G = max(physical_block_size, minimum_io_size) and computes (G + parent_offset - (start_bytes mod G)) mod G. For G=4096, parent_offset=0 and start_bytes=1049088, the result is 3584, not 512. This is a calculated example, not a device observation. [2]
Relations
- related
- Partition alignment, Logical sector, Physical sector, Minimum I/O size, Optimal I/O size, Direct-I/O alignment
Advantages
Limitations
- A zero displacement does not establish correct buffer alignment for every I/O API. [1]
Citations
- Linux 6.12: stable sysfs block ABI, sector sizes and I/O topology
- 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
- util-linux 2.40.2: lsblk explicit columns and inherited queue attributes
Further reading
Sources & caveats
- The sentinel and partition formatting are implementation details verified in Linux v6.12 and util-linux v2.40.2, not a promise about all releases.