[Linux-users] 4k physical sector hard drives (ie. new 'green' WD models)
Brad Sawatzky
brads at jlab.org
Tue Apr 20 19:31:22 EDT 2010
Just a heads up to other linux (and Windows) folks if you've purchased
one of the shiny new Western Digital 'Green' hard drives. The WD drives
with this feature usually have 'EARS' in their identifier:
ie. 'WDC WD10EARS-00Y5B1'.
These models have switched to using a 4kB physical block (or 'sector')
size vs. the historical standard of 512 bytes. There are warnings for
special workarounds for Windows XP users, but the drives claim to work
fine with newer OSs. Technically WD isn't lying, but your performance
will suck.
fdisk (for example) defaults to starting partitions at 'sector' 63 for
historical reasons. When 4k blocks are in use, this misaligns the
physical blocks with the file system blocks and really kills
performance... Write performance is trashed and, for example, you get
long (blocking!) pauses when the writeback buffer gets written out. It
is worse for small changes scattered around the platter (ie. meta-data
updates).
You can work around this by manually tweaking the partition table to
align on a 4k blocks. For example, lay out as usual, then go into
expert mode 'x' and tweak the start block using 'b' so it is divisible
by 8 for all partitions. Then proceed with filesystem creation as
usual. This is a 'valid' layout:
root at aether 1002% fdisk -u /dev/sdc
[ . . . ]
Command (m for help): p
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa301944f
Device Boot Start End Blocks Id System
/dev/sdc1 64 390636539 195318238 fd Linux raid autodetect
/dev/sdc2 390636544 1953520064 781441760+ fd Linux raid autodetect
Yes, if you screwed up the first time around, then you have to copy all
your data off to a backup, reformat, and move it all back. All umpteen
TB of it. <cough> I'm posting this so others don't have to stare at
rsync for as long as I have.
Newer versions of 'parted' and derived tools (gparted, etc) allegedly
have an '--align' argument that will do this automagically in some(?)
cases. There are a few dragons here though, because the drives lie
about their physical sector size... It's hard for the tool to know the
correct behavior. Life gets more exciting if Windows is rolled into the
mix...
Lots of background info here:
http://lwn.net/Articles/377895/
http://lwn.net/Articles/377897/
http://ata.wiki.kernel.org/index.php/ATA_4_KiB_sector_issues
http://www.osnews.com/story/22872/Linux_Not_Fully_Prepared_for_4096-Byte_Sector_Hard_Drives
-- Brad
--
Brad Sawatzky, PhD <brads at jlab.org> -<>- Jefferson Lab / Hall C / C111
Ph: 757-269-5947 -<>- Fax: 757-269-5235 -<>- Pager: brads-page at jlab.org
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" but "That's funny..." -- Isaac Asimov
More information about the Linux-users
mailing list