back to notes

Your Hard Drive May Be Lying to You.

If you have a disk called an Advanced Format disk, it may be purposefully misreporting to you about its sector size.

Many Advanced Format disks purposefully misreport their sector size as 512 bytes (so the disks work with Windows XP), when they are in fact 4096 bytes. Partition misalignment causing massive disk delays (possibly halving your disk throughput).

To make matters worse, tools like parted assumes that the reported sectors size is correct (512 bytes), and creates partitions based on this size. Then creating your file system based on these misreported sectors creates further confusion and slowdown.

Here's how you fix this. Let's assume you are trying to create a GPT partition and create a XFS file system on /dev/sdc

parted /dev/sdc
parted > mklabel gpt
parted > mkpart primary xfs 2048s -1s
parted > unit sector
parted > print
parted > quit

fdisk -b 4096 /dev/sdc
fdisk > p

Does fdisk show that Start = 1? Great!

fdisk > q

mkfs.xfs -s size=4096

How do you tell if your disk is misreporting sector sizes? You'll need to dig through your disk spec sheet and then compare it to the reported sector size in fdisk. If fdisk reports 512 byte sectors and your disk's spec sheet claims 4096 byte (or 4KB) or Advanced Format sectors, you have a misaligned disk.

I'll be keeping an rss feed of articles that I find related to this issue here: http://feeds.pinboard.in/rss/u:jkern/t:4k



last updated september 2014