Linux, WD “Green” drives, and 4K sectors

I picked up a couple of the new WD Green 1.5TB drives recently. I needed some new storage, and these drives have a lot going for them:

– 64MB cache
– low power usage
– 4K sector size

I knew going into this that the 4K sector size was proving problematic in some circumstances. In short, these drives have a 4K physical sector size, but present 512B logical sectors for better BIOS/OS compatibility. All well and good, except this can cause partitions to be misaligned and lead to writes falling across different physical sectors. [This article|http://www.osnews.com/story/22872/Linux_Not_Fully_Prepared_for_4096-Byte_Sector_Hard_Drives] discusses some of the performance implications. I verified on my drives that properly aligning the first partitions does lead to >3x performance increases.

This ends up being relevant to $WORK. We are in the process of deploying VMWare with a NetApp filer providing the backend storage. One of the others on my team discovered that (supposedly) the same problems exist, as the NetApp is using 4K sector sizes as well.

Since I’m not in desperate need of getting these drives going in my fileserver, I’ll be playing over the next week to see how this affects Linux DM-RAID and LVM configurations. I plan to see if there are any LVM options related to physical block size and alignments. If anything interesting turns up, I’ll put up a follow-on post.

On a related note – do you generally layer an LVM PV on top of a DM-RAID RAID-1, or create 2 PVs and let LVM take care of the RAID-1? I’ll be looking at both, I think. Not that performance is terribly important at home, but it would be nice to know in case I need to extend it to $WORK in the future.

Some other interesting links:

* http://lwn.net/Articles/377895/
* http://www.citrix.com/site/resources/dynamic/partnerDocs/BestPracticesforFileSystemAlignmentinVirtualEnvironments.pdf