6

Here's what I get when partitioning with parted:

The resulting partition is not properly aligned for best performance

This is one troubling piece that I haven't, somewhat, found a proper answer for, when googling. What does this error mean, how to deal with it and why does it occur?

NOTE:

mkpart p 8192 X

skipping exactly 4 MiB (512x8192) of space before the start of the partition boundaries, makes parted not spew this error message (anything less - does).

1 Answer 1

8

Note: I am sure SuperUser already has a good answer on this. I couldn't find it, however.)

Both disks and filesystems divide their space in blocks (sectors, clusters) of a certain size, normally multiples of two in the range 512 B ~ 8192 B.

When a partition is not "aligned" – that is, when a filesystem starts in the middle of a physical sector – writing a single filesystem cluster involves reading, updating, and then rewriting multiple physical sectors:

              1       2       3
fsys:     |-------|-------|-------|
disk:  |-------|--'----|--'----|-------|
           1       2       3       4

In the example above, writing filesystem cluster #2 would require the disk controller to read blocks #2 and #3, then write back to the same location (after waiting for the platters to spin almost 360° if it's a hard disk).

But if the partition is aligned, all that's needed is a single write.

Recent high-capacity disks use 4096 B sectors physically (called "Advanced Format"), but the OS sees each sector as 8 sectors 512 B each. Even if the filesystem is aligned to those 512 B sectors, it might still start in the middle of a real 4 kiB sector, resulting in the same problem as above.

To avoid this and related alignment problems in the future, many partitioning programs have started aligning at boundaries as high as 1 MiB (which isn't that much of a loss on terabyte disks anyway).

2
  • interesting read and good info. However, I always use parted with a unit of sectors. Also, I have a 3TB Hitachi drive that has a native sector size of 512 bytes (mostly an exception from comparable drives of the same size). So, as my understanding goes, i can safely ignore this message if I actually partition the drive in sectors that match my physical sector size (no way of shifting?)
    – XXL
    Oct 24, 2011 at 20:25
  • Start sectors must divide by 2048 (when align to 1MiB) what about partitions end sectors? Are they irrelevant ?
    – EdiD
    Jun 10, 2018 at 11:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .