# WD Green drive (4K sectors), LBA 63, sector alignment ??

## theosib

I got one of those WD "Green" drives that has the 4KiB physical sectors.  There are warnings about older versions of Windows having problems where they start the partition at LBA 63 and therefore have every 4K cluster one sector out of alignment from the physical disk.

When I use fdisk under Linux to create a "primary" partition, I find that it starts the partition at LBA 63.  I've read that Linux is supposedly unaffected, but if the partition starts at LBA 63, doesn't that mean that it's out of alignment?  

Is this a bug in fdisk, or does Linux magically do the right thing and align clusters to multiples of 8?

----------

## theosib

I ran an experiment.  I created a write test that does random 4096-byte writes to the block device with O_SYNC.  The block offset is varied in 512-byte increments, and I compare the time it takes to write (and sync) 1000 completely random writes.  It's slow because O_SYNC means EVERY write must hit the disk, but it proves the point.

When writing blocks with LBA offsets in multiples of 8, it takes about 7 seconds.  When writing blocks with LBA offsets not multiples of 8, it takes about 23 seconds.

Now, this tells me nothing about whether or not ext3 is smart enough to align things differently, although that would violate the partition abstraction, so I'm going to guess that it's doing it wrong.

----------

## cyrillic

You could use parted instead of fdisk to do what you want.

Check man parted for the --align option.

----------

## cwr

www.osnews.com has a recent article on this; it looks as if a lot of Linux

tools aren't fully aware of the problem, so you may have to do some

juggling to get partitions correctly aligned.  You can get a slowdown

of a factor of 3 or so, so it's worth some tinkering.

Will

----------

## jonfr

How does cfdisk handle this type of hard drive ?

----------

## Hupf

Taken from the /. and osnews forum discussions: the main problem seems to be that the drive is reporting a sector size of 512 bytes (for compatibility e.g. with Windows XP). You have to use a tool where this can be overridden manually (parted does this) or use this method.

----------

## theosib

cfdisk is part of the same tool suite as fdisk.  Besides having a curses interface, it only has a few other minor differences.  So I'm sure it does not automatically handle this problem.  It's developed by the same people.

BTW, I'm the one who wrote the OSnews article.

----------

## cwr

 *theosib wrote:*   

> BTW, I'm the one who wrote the OSnews article.

 

Synchronicity!

Will

----------

