Course contentsShow
← Linux
Lesson 636 of 1,8197. Storage Management and Logical VolumesFree lesson

Disk geometry and sector alignment

Configure partition alignment to prevent write-amplification on SSDs and advanced format drives.

In this lesson, you will learn how to align partitions with your storage hardware’s physical layout to prevent "write amplification" and maintain high performance.

Understanding the Geometry

Historically, hard drives were organized into physical sectors of 512 bytes. Modern SSDs and "Advanced Format" (AF) hard drives, however, use larger internal units—typically 4KB (4096 bytes) blocks—to handle data more efficiently.

"Alignment" refers to ensuring the starting point of your partition perfectly matches the underlying physical boundary of these 4KB blocks. If a partition starts at an odd offset (like byte 513 instead of byte 4096), a single write operation from your filesystem might overlap two physical sectors on the drive. This forces the hardware to read two sectors, modify them, and write them both back, effectively doubling or quadrupling the work for a single data update. This is write amplification.

Configuring Alignment

When you create a partition today, modern partitioning tools like fdisk or parted usually handle this automatically by aligning to "megabyte boundaries." Since 1MB is evenly divisible by 4KB, your data will always start on a clean boundary.

You can verify your current alignment using fdisk:

sudo fdisk -l /dev/sda

Look for the "Start" sector value. If the start sector is a multiple of 8 (since 8 sectors × 512 bytes = 4096 bytes), your partition is perfectly aligned to a 4KB boundary.

Why it Matters

If your partitions are misaligned, your SSD will experience premature wear, and your system performance will suffer because the drive controller has to perform "read-modify-write" cycles for nearly every file operation. Even though the kernel abstracts hardware complexity, it cannot "fix" a partition that was poorly placed during initial creation. By ensuring your partitions align with the 4KB physical block size, you ensure that every filesystem block maps cleanly to a physical storage block, maximizing both longevity and speed.

Key Takeaway: Always ensure your partition start sectors are multiples of 8 to align with modern 4KB physical disk architecture, which eliminates unnecessary overhead and prevents premature drive wear.