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.

This question already has an answer here:

What is partition alignment and why? Does it have something to do with the 2048-sector gap between two logical partitions?

share|improve this question

marked as duplicate by Ƭᴇcʜιᴇ007, Heptite, Kevin Panko, Tog, m4573r Feb 19 at 10:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
@grawity The crucial part is different. I need someone to explain that in detail. –  Determinant Feb 25 '12 at 14:59

2 Answers 2

up vote 10 down vote accepted

Newer hard drives are being manufactured to utilise 4 kilobyte sectors rather than the conventional 512-byte sectors.

This is done to make more efficient use of the physical space on hard drives as for every sector there is a small batch of error correction data on the drive, and by going from 0.5kilobytes to 4kilobytes per sector means that there can be much less space on the drive wasted in this error correction data. To show what I mean here is an image taken from the Wikipedia article on Advanced Format Drives:

enter image description here

The reason for having to align your disk stems from the interaction of software that was written to expect 512-byte sectors working on a drive with 4-kilobyte sectors. If the software expects 512-byte sectors then it may well be trying to write to what it thinks is the "second" sector of a cluster, but is in fact the second 512 bytes of a 4-kilobyte sector.

The problem is that "Advanced Format" drives that simulate a 512-byte sector to the operating system but actually work with 4-kilobyte sectors internally is that a sector can only be written "in one go". In order to write to that second 512 byte area the entire 4KB sector must be read, and then re-written back to the drive, and this is a slower process than simply telling the drive to rewrite the whole 4KB sector.

Even if the operating system is aware of 4KB sectors it must have the drive properly aligned so that the boundaries between sectors agrees between where the drive says they are and where the operating system thinks they are.

Then there are SSDs, which have a similar problem in that they can be written byte-by-byte, but only erased in large blocks of typically 256KB or 512KB. In this way, in order to maximise performance you must align the partition (and thus sector) boundaries along one of those 256 or 512KB blocks.

For this reason a lot of modern partitioning tools simply align the entire drive along a 1MB boundary, which neatly does away with the need to detect whether you have any of the many types of drive, be they 512-byte sectors, 4KB sectors, or SSD with some arbitrary block size.

-=EDIT=-

To tell if your drive is properly aligned there are a number of ways to check, as this article on Lifehacker mentions. The advice applies mainly to SSds but is equally relevant to making sure a normal hard drive is aligned properly:

To see if your partitions are aligned correctly, hit the Start menu and type in msinfo32. Enter Msinfo32 and go to Components > Storage > Disks. Look for your SSD on the list and find the "Partition Starting Offset" item. If this number is divisible by 4096 (that is, if dividing it by 4096 equals a whole number and not a decimal), your partition is correctly aligned. If not, you need to realign it. Luckily, this is pretty easy to do with the Gparted live CD. If you have an Ubuntu live CD lying around, that will work too, since it has Gparted available under System > Administration.

share|improve this answer
2  
Just a note: The performance lost due to wrong alignment comes when the software wants to write a lot of 4kiB filesystem sectors far away from each other. If each write overflows 512B into the next 4kiB disk sector, that next whole sector must be rewritten too, resulting in twice as much writing as necessary. (the first disk sector still contains 3.5kiB of the data written) –  Eroen Feb 25 '12 at 13:53
    
Just a note: This is done not to „increase performance”, but to save bucks. –  kinokijuf Feb 25 '12 at 14:12
    
@kinokijuf As I mentioned the 4KB sectors are to make more efficient use of the disk (saving space is equivalent to free extra storage and therefore could be seen to translate to extra cash that can be charged) but the alignment itself is done for performance reasons. –  Mokubai Feb 25 '12 at 14:15
    
@Mokubai Alignment yes, but a real 512 byte disk is still faster. –  kinokijuf Feb 25 '12 at 14:17
    
@Mokubai Great explanation! Can you give a specific example of alignment (size calculation)? A simple illustration? –  Determinant Feb 25 '12 at 14:23

To cut costs, hard drive manufacturers are now making larger (~1T) drives with 4K physical sectors (the so-called „Advanced Format”). Because the standard specifies 512B sectors, the partitions on these drives must be aligned so that the 4K NTFS sectors line up with the 4K sectors on drive. And don’t get me started on SSDs…

I have never heard of the 1M gap. This may depend on your partitioning software. I have on my laptop two partitions without any sectors between them.

share|improve this answer
    
On my disk, primary disk are right next to each other, but inside the extended partition, all logical partitions are separated by 1MiB –  Determinant Feb 25 '12 at 12:42
    
No standard specifies 512B sectors, but quite a few OSs assume it incorrectly for anything that looks like a hard drive, so the drives pretend to be that way. 1M sectors are used on CDs and DVDs, so some partitioning tools default to it as a least common divisor. –  Eroen Feb 25 '12 at 13:45
    
@Eroen AFAIK the Windows NT disk driver only supports 512B sectors. –  kinokijuf Feb 25 '12 at 14:08
    
Also, the CD sector is 2048 (Mode1) or 2336 (Mode2) bytes, not 1048576. –  kinokijuf Feb 25 '12 at 14:09
    
@kinokijuf: "What Windows NT kernels support" is not a standard. I was mistaken about CD sector sizes, you are correct. –  Eroen Feb 25 '12 at 15:11

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