Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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).

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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).

share|improve this answer
    
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 '11 at 20:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.