

I have two drives, /dev/sdc and /dev/sdd, both identical Green drives. Now, this just demonstrates the problem we already know about. 1000 random unaligned 4K writes consistently take between 22 and 24 seconds. Note that I realize that all my testing is “quick and dirty,” but I’m just trying to demonstrate a point, not analyze it in painful detail.ġ000 random aligned 4K writes consistently take between 7 and 8 seconds. The effects of this test are amplified by the use of O_SYNC, which insists that all writes hit the disk immediately, but it demonstrates the problem. If I pass 1, the test is on 4K boundaries plus 512. So if I pass 0 to the program, it runs the test on 4K boundaries. This program does random 4K block writes to the drive at a selectable 512-byte alignment. I’ve included the source code to my test at the end of the article. I performed a test that demonstrates that WD has not done this. This way, Windows XP partitions would not really be misaligned. It has been suggested that WD might internally offset block addresses by 1 so that LBA 63 maps to LBA 64. The first thing I did was test the performance effect itself. Following are the results of my experimentation. I don’t know about MacOS, but with regard to Linux, they are not entirely correct. WD also tested other OS’s and declared both MacOS X and Linux to be “unaffected”. They provide a utility to shift partitions by 512 bytes to line them up. By default, the first primary partition starts on LBA block 63, which obviously is not a multiple of 8. WD claims to have done some studies and found that Windows XP was hardest hit. This misalignment causes a performance hit since the drive has to read and rewrite the 4K sectors with whatever 512-byte slices changed. However, nothing restricts you from creating a partition that starts on an odd-numbered 512-byte logical sector. OS’s like Linux use 4K blocks (or multiples of 4K) to store data, which matches well with the physical sector. This is caused by improper logical-to-physical sector alignment. The problem most likely to hit you with one of these drives is very slow write performance. Despite this issue being known about for a long time, basic Linux tools for partitioning and formatting drives have not caught up. 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. 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. These new drives represent a transitional point from 512-byte sectors to 4096-byte sectors. Recently, I bought a pair of those new Western Digital Caviar Green drives.
