Problem with WD Advanced Format drive in LINUX (WD15EARS)


ramiro_morales wrote:> Could it be that WD has changed things in the “00Z5B1” models to correctly report the physical block size for the benefit of the Linux-based partitioning tools and so help people avoid getting non 4kB-aligned partitions?. Or maybe the difference is in the fact he’s is the drive inside a external My Book Essential?.

I just got a WDC WD15EARS-00Z5B1 (internal drive) and it reports 512 bytes as logical / physical sector size. Using kernel 2.6.34-rc6 and an Intel DP35DP board. So nothing changed.

Getting the alignment correctly on this one was quite a challenge.

GPT partition table (32 partitions), parted couldn’t get the align right by itself, so I wrote a small Python script that calculated partition sizes and alignment for me. (Can be done manually if it’s 2-3 partitions but gets tedious for a larger number).

cryptsetup/LUKS: is luckily automatically aligned to 4k boundaries

LVM: is luckily automatically aligned to 4k boundaries

XFS filesystem: would know to use 4K blocks if the drive reported it correctly, which it doesn’t, so you have to supply the sector size as option to mkfs.xfs. Especially the XFS problem I noticed too late and as a result I spent another day shuffling data around, remaking all my XFS volumes.

However now that all things are done and my encrypted xfs lvm volumes are now running properly aligned on this drive, I’m very happy with its performance. I hope the next generation of drives will report their sector sizes correctly!