Page 1 of 1

Is WD Advanced Format Drives still a problem? [SOLVED]

Posted: Fri Oct 19, 2012 8:02 pm
by giantjoebot
I know it was never really a problem, and they just had to be formatted differently, but what I want to know is if you still have to do that, or does it auto detect that its an Advanced Format Drive?

On WD's website it said that if the Linux kernel is 2.6.31 or newer that it shouldn't be a problem, but I thought I would check here just to be sure
http://wdc.custhelp.com/app/answers/det ... ing-system

Re: Is WD Advanced Format Drives still a problem?

Posted: Sat Oct 20, 2012 6:35 pm
by srs5694
The kernel has almost nothing to do with it! The problem is in the drive and the fact that writing part of a 4KiB physical sector requires reading that sector, modifying its contents, and writing it back out again. Between the read and the write, the sector will have spun out from under the read-write head, so the disk will have to rotate at least once before the write can occur. This process will inevitably take longer than writing a whole physical sector, which requires no read operation. Partition alignment matters because most filesystems include data structures that are 4KiB in size, or multiples of that amount, aligned on multiples of 4KiB relative to the start of the filesystem, which in turn is normally the start of the partition. Thus, if the partition is aligned properly, most disk reads and writes will be of 4KiB or larger amounts on physical-sector boundaries. If not, many disk reads and writes will span physical sector boundaries, resulting in the need for that extra read and delay when writing data.

The only thing the kernel has to do with it is that the kernel includes calls to return the logical and physical sector size. Unfortunately, with every Advanced Format drive I've used (admittedly only about four or five of them), either the drives lie about this detail or the kernel doesn't report it accurately. Furthermore, the partitioning software must use the data, making it at least as important as the kernel.

That said, as a practical matter, most Linux partitioning software today uses 1MiB (2048-sector) alignment by default. (I hear that cfdisk is a fossil on this score and still uses cylinder alignment, but I've not checked it myself.) Thus, if you use modern partitioning software, you should be OK; however, it's a good idea to double-check the matter yourself by obtaining a sector-precise listing of your partitions' start points and checking that all the numbers are divisible by 8. (The extended partition, if you have one, is an exception; its alignment is irrelevant.)

BTW, I'm the author of the GPT fdisk partitioning software, so I've studied this issue pretty closely.

Re: Is WD Advanced Format Drives still a problem?

Posted: Sat Oct 20, 2012 6:48 pm
by jazz.h
So if Disk Utility says that my extended partition is misaligned (and the performance is degraded) but the primary are OK, than it's irrelevant (as I assumed)?

Re: Is WD Advanced Format Drives still a problem?

Posted: Sat Oct 20, 2012 10:20 pm
by srs5694
jazz.h wrote:So if Disk Utility says that my extended partition is misaligned (and the performance is degraded) but the primary are OK, than it's irrelevant (as I assumed)?
Based on that message alone, yes. I recommend checking the numbers yourself, though; Disk Utility isn't entirely reliable about figuring out what's properly aligned. (It often raises false alarms, though, rather than missing problems -- except of course in versions that are old enough that they don't check for proper alignment.)

Re: Is WD Advanced Format Drives still a problem?

Posted: Sun Oct 21, 2012 1:10 pm
by jazz.h
Thanks.

Re: Is WD Advanced Format Drives still a problem?

Posted: Thu Oct 25, 2012 4:26 pm
by giantjoebot
That was a very detailed explanation. I understood most of it, except towards the end. This is where you lost me
double-check the matter yourself by obtaining a sector-precise listing of your partitions' start points and checking that all the numbers are divisible by 8. (The extended partition, if you have one, is an exception; its alignment is irrelevant.)
I have no idea how to do that. But you did answer my question, thank you very much. I do appreciate it.

Re: Is WD Advanced Format Drives still a problem?

Posted: Thu Oct 25, 2012 6:13 pm
by srs5694
giantjoebot wrote:That was a very detailed explanation. I understood most of it, except towards the end. This is where you lost me
double-check the matter yourself by obtaining a sector-precise listing of your partitions' start points and checking that all the numbers are divisible by 8. (The extended partition, if you have one, is an exception; its alignment is irrelevant.)
I have no idea how to do that. But you did answer my question, thank you very much. I do appreciate it.
Most partitioning tools have an option to provide sector-precise partition start and end points. For instance:

Code: Select all

sudo fdisk -lu /dev/sda
sudo parted /dev/sda unit s print
sudo gdisk -l /dev/sda
All of these will display partition start and end points in sectors; however, you should use fdisk only on MBR disks. (It will show the protective MBR's 0xEE partition for GPT disks, and that's irrelevant.) As noted, the alignment of extended partitions on MBR disks is irrelevant, since extended partitions are just placeholders for logical partitions. It's the alignment of the filesystem-holding partitions (primary and logical) that's important on MBR disks. (GPT doesn't make the distinction between these partition types; with it, the alignment of any partition that holds a filesystem is important.)

GUI tools can also be used, but you may need to select a special option. In GParted, for instance, you should select a partition and then click Partition->Information to get an information dialog box that includes the first and last sector information.

Re: Is WD Advanced Format Drives still a problem?

Posted: Fri Oct 26, 2012 3:54 am
by giantjoebot
that doesn't sound too hard. Dude you are amazing and have gone above and beyond to answer my question thank you so much