Product SiteDocumentation Site

Chapter 17.  Storage I/O Alignment and Size

17.1. Parameters for Storage Access
17.2. Userspace Access
17.3. Standards
17.4. Stacking I/O Parameters
17.5. Logical Volume Manager
17.6. Partition and File System Tools
Recent enhancements to the SCSI and ATA standards allow storage devices to incidate their preferred (and in some cases, required) I/O alignment and I/O size. This information is particularly useful with newer disk drives that increase the physical sector size from 512 bytes to 4k bytes. This information may also be beneficial for RAID devices, where the chunk size and stripe size may impact performance.
The Linux I/O stack has been enhanced to process vendor-provided I/O alignment and I/O size information, allowing storage management tools (parted, lvm, mkfs.*, and the like) to optimize data placement and access. If a legacy device does not export I/O alignment and size data, then storage management tools in Fedora 14 will conservatively align I/O on a 4k (or larger power of 2) boundary. This will ensure that 4k-sector devices operate correctly even if they do not indicate any required/preferred I/O alignment and size.


Fedora 14 supports 4k-sector devices as data disks, not as boot disks. Boot support for 4k-sector devices is planned for a later release.
Refer to Section 17.2, “Userspace Access” to learn how to determine the information that the operating system obtained from the device. This data is subsequently used by the storage management tools to determine data placement.

17.1. Parameters for Storage Access

The operating system uses the following information to determine I/O alignment and size:
Smallest internal unit on which the device can operate
Used externally to address a location on the device
Tthe number of bytes that the beginning of the Linux block device (partition/MD/LVM device) is offset from the underlying physical alignment
The device’s preferred minimum unit for random I/O
The device’s preferred unit for streaming I/O
For example, certain 4K sector devices may use a 4K physical_block_size internally but expose a more granular 512-byte logical_block_size to Linux. This discrepancy introduces potential for misaligned I/O. To address this, the Fedora 14 I/O stack will attempt to start all data areas on a naturally-aligned boundary (physical_block_size) by making sure it accounts for any alignment_offset if the beginning of the block device is offset from the underlying physical alignment.
Storage vendors can also supply I/O hints about the preferred minimum unit for random I/O (minimum_io_size) and streaming I/O (optimal_io_size) of a device. For example, minimum_io_size and optimal_io_size may correspond to a RAID device's chunk size and stripe size respectively.