White Papers

10 512e and 4Kn Disk Formats
4.1.2 Aligned versus unaligned hard drive partitions
Both 512e/4Kn HDDs use 4KB sectors but the read-write operations depends on the transfer size request
and alignment with Logical Block Address (LBA).
Each 512-byte sector on the drive is assigned a unique LBA, from zero (0) to the number required based
on the drive capacity. The host requests a specific block of data using the assigned LBA. When the host
requests to write data, an LBA address is returned at the end of the write request telling the host where the
data is located. This becomes important in the transition to 4K sectors since for every 4K sector there are
eight different possibilities for where the host LBA starts.
When LBA 0 is aligned to the first virtual 512-byte block in the 4K physical sector, the logical to physical
alignment condition for 512-byte emulation is termed Alignment 0. Another possible alignment is when
LBA 0 is aligned to the second virtual 512-byte block in the 4K physical sector. This situation is termed
Alignment 1 and is shown in comparison to the Alignment 0 condition in Figure 4. There are six additional
possibilities for unaligned partitions that can result in read-modify-write events similar to the Alignment 1
condition.
Figure 4 Aligned write scenario
Alignment 0 conditions work very well with the new 4K sectors in the Advanced Format standard. This is
because a hard drive can easily map eight contiguous 512-byte sectors into a single 4K sector by storing
512-byte write requests in the hard drive’s cache (DRAM) until enough contiguous 512-byte blocks are
received to form a 4K sector. Since modern computing applications deal with chunks of data that are
typically larger than 4K, runts (transfers smaller than 4K) are extremely rare.
Figure 5 Unaligned write scenario
When hard drive partitions are created that result in an unaligned condition as shown in figure 5, read-
modify-write (RMW) cycles occur that can slow hard drive performance. See section 5.5 for information
on avoiding these cycles when implementing Advanced Format hard drives.
Drive LBA 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Host Aligned Command
Sector n
Sector n+1
Host sends 4K bytes write command
Drive writes 4k bytes aligned, no RMWs
Drive Operations
Drive sends write completion status
Drive LBA 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Host Unaligned Command
Drive sends write completion status
Drive Operations
Host sends 4K bytes write command
Because host transfer is unaligned, drive reads 2x 4k byte sectors into its DRAM
Updates both 4k sectors, n and n+1, with the host 4k bytes of data
Sectors 4-11 will be updated in DRAM
Drive writes the updated sectors n and n+1 to the media
Sector n
Sector n+1