Linked by theosib on Sun 14th Feb 2010 10:45 UTC

Recently, I bought a pair of those new Western Digital Caviar Green drives. These new drives represent a transitional point from 512-byte sectors to 4096-byte sectors. A number of articles have been published recently about this, explaining the benefits and some of the challenges that we'll be facing during this transition. Reportedly, Linux should unaffected by some of the pitfalls of this transition, but my own experimentation has shown that Linux is just as vulnerable to the potential performance impact as Windows XP. Despite this issue being known about for a long time, basic Linux tools for partitioning and formatting drives have not caught up.

E-mail Print r 16   · Read More · 65 Comment(s)
Thread beginning with comment 409410
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: GNU Parted
by mkpetersen on Mon 15th Feb 2010 14:01 UTC in reply to "RE: GNU Parted"
Member since:

First of all it's important to distinguish between logical block size which is used when sending commands to a device and the physical block size which is used by the device internally.

Linux has supported (SCSI) drives that present 4KB logical block sizes for a long time. For compatiblity with legacy OS'es, however, consumer grade ATA drives with 4KB physical blocks continue to present a 512-byte logical block interface. The knob indicating that the drive has 4KB physical blocks is orthogonal to the logical block size reporting, allowing the information to be communicated without interfering with legacy OS'es like XP that only know about 512-byte sectors.

We have worked closely with disk manufacturers for a long time to make sure we were ready. Western Digital have been instrumental in the ATA specification in terms of the alignment and physical block size parameters. The engineering sample drives I have received from WDC have all implemented the physical block size knobs correctly. Which makes it even more baffling that they end up shipping an advanced format drive that gets it wrong. I have no idea why they did that. The location of the block size information in IDENTIFY DEVICE is unlikely to be inspected by legacy systems, so I highly doubt it's a compatibility thing. Brown paper bag time for Western Digital...

It is true that the effects of this particular drive reporting incorrect information could have been mitigated by a 1MB default alignment. However, that would still have caused misalignment for other drives that come wired with 1-alignment to compensate for the legacy DOS sector 63 offset. So blindly aligning to 1MB won't cut it. Windows Vista/7 don't do that either. Like Linux, they compensate based upon what the drive reports.

Linux 2.6.31 and beyond will report device alignment and physical block size for all block devices. It is then up to the userland partitioning utilities etc. to adjust start offsets accordingly. You'll find that both parted and util-linux-ng have been updated to do this. And that modern fdisk will in fact align on a 1MB (+/- drive alignment) boundary by default.

Caveat being that Fedora is the only community distribution I know of that's using the updated bits. I don't think all of them made it into Fedora 12 but I'm sure Fedora 13 will do the right thing.

So I encourage you to work with your distribution vendor to ensure they start shipping recent partition tooling.

Martin K. Petersen
Kernel Developer, Oracle Linux Engineering

Reply Parent Score: 5