Original Link: http://www.anandtech.com/show/2888
Western Digital’s Advanced Format: The 4K Sector Transition Beginsby Ryan Smith on December 18, 2009 12:00 AM EST
- Posted in
We had a chance to talk to Western Digital last week about a new hard drive technology they have coming down the pipe called Advanced Format. Ahead of the impending launch of the first Advanced Format drives, Western Digital is engaging in an education campaign about the technology, as it represents the first step in a general transition for hard drives, and is a transition that can’t be done completely behind the scenes. Specifically, Advanced Format is going to bring about some issues where older operating systems (and we’re looking almost exclusively at Windows XP here) will inadvertently harm drive performance by making certain assumptions about the drives that will no longer be true.
We’ll get in to the nitty-gritty about the impact of this in a bit, but first let’s start with Advanced Format. What is it? In a nutshell, it’s replacing the traditional 512 byte hard drive sector with a 4 kilobyte (4,096B) hard drive sector for a number of practical and technological reasons. Advanced Format is the name Western Digital is giving to drives implementing 4KB sectors.
The move to 4K-sectors has been some 10 years in the making, as research in the late 90’s identified that 512B sectors made less and less sense as drives continued to get larger. At a time when hard drives were measured in megabytes, 512B sectors were a good balance between technical factors and a desire to keep wasted space at a minimum (you can’t normally put 2 files in 1 sector), but times have changed and hard drive capacities are several orders of magnitude larger.
The crux of the problem is that there are 3 factors that are in constant need of balancing when it comes to hard drive design: areal density, the signal-to-noise ratio (SNR) in reading from drive platters, and the use of Error Correcting Code (ECC) to find and correct any errors that occur. As areal density is increases, sectors become smaller and their SNR decreases. To compensate for that, improvements are made to ECC (usually through the use of more bits) in order to maintain reliability. So for a drive maker to add more space, they ultimately need to improve their error-correction capabilities, which means the necessary ECC data requires more space. Rinse, wash, repeat.
The SNR for various areal densities
At some point during this process drive manufacturers stop gaining any usable space - that is, they have to add as much ECC data as they get out of the increase areal density in the first place - which limits their ability to develop larger drives. Drive manufacturers dislike this both because it hinders their ability to develop new drives, and because it means their overall format efficiency (the amount of space on a platter actually used to store user data) drops. Drive manufacturers want to build bigger drives, and they want to spend as little space on overhead as possible.
But all is not lost. The principle problem here is that ECC correction takes place in 512B chunks, while ECC can be more efficient when used over larger chunks of data. If ECC data is calculated against a larger sector, even though more ECC data is necessary than for a single 512B sector, less ECC data than the sum of multiple sectors is needed to maintain the same level of operational reliability. One estimate for 4K sector technology puts this at 100 bytes of ECC data needed for a 4K sector, versus 320 (40x8) for 8 512B sectors. Furthermore the larger sectors means that larger erroneous chunks of data can be corrected (burst error correction), something that was becoming harder as greater areal densities made it easier to wipe out larger parts of a 512B sector. As a result, the need for the larger sector is born.
As for why Western Digital and other drive makers are transitioning specifically to a 4K sector, the rationale is based on the earlier problems. 4K sectors are much larger than 512B sectors, which means they benefit more from our earlier ECC optimizations, which in turn brings a greater increase in format efficiency than using smaller sectors (i.e. 1K).
4K also happens to be a magical number elsewhere when it comes to computers – this is primarily rooted in the fact that a normal page of memory on an x86 processor continues to be 4KB (ed: 4MB pages also exist). The x86 page size in turn has also lead to file system clusters (the smallest unit of storage in a file system) becoming 4KB as 4KB clusters neatly fit in to a page of memory, while the need for smaller clusters has subsided amidst a general increase in file size (i.e. fewer files are smaller than 4KB and waste space). NTFS, EXT3, and HFS+ all default to 4KB clusters on modern hard drives. So 4KB physical sectors map perfectly with 4KB file system clusters, which in turn map perfectly with 4KB memory pages. And hence 4KB is the largest practical size for a hard drive sector at this time.
|Old Sector||New Sector||x86 Mem Page||NTFS Cluster||HFS+ Cluster|
So what’s the net benefit from all of this for consumers? At the moment, not a lot, which is why this is a low-key launch for Western Digital, and the focus of this is an education effort on what the use of 4K sectors means for older operating systems. The biggest benefit is going to be that this will enable Western Digital to more easily design drives over 2TB in size.
From a numbers perspective, Western Digital estimates that the use of 4K sectors will give them an immediate 7%-11% increase in format efficiency. ECC burst error correction stands to improve by 50%, and the overall error rate capability improves by 2 orders of magnitude. In theory these reliability benefits should immediately apply to all 4K sector drives (making the Advanced Format drives more reliable than regular drives), but Western Digital is not pushing that idea at this time.
IDEMA projected format efficiency and ECC burst sizes
With all of that said, to make this kind of advancement practical, a transition period is necessary. That transition period will be done through the use of 512B emulation technology, which will expose Advanced Format drives to the drive controller and operating system as having 512B sectors, when in reality they will have 4K sectors. Unfortunately, this method has a downside, which is the ultimate reason for Western Digital’s education campaign.
512 byte sector emulation: how the drive is laid out (physical) and what the OS sees (logical)
With the emulation of 512B sectors, there’s the risk that a partition could be misaligned compared to the 4K physical sectors - where it would be unwittingly started in the middle of such a sector. As a result, the clusters of a file system on that partition would end up straddling 4K sectors, which would cause performance problems. Specifically, in testing IDEMA (the drive manufacturers’ trade group) found that random writes in would be particularly impacted, as a Read-Modify-Write(RMW) would need to take place to update each sector, rather than a straight write(ed: This is very similar to writing to a dirty block on a SSD). Although this isn’t mechanically/electronically harmful in any way, the performance hit compared to a straight write makes it undesirable.
A single unaligned 4K cluster straddling 2 physical sectors
A misaligned partition under WinXP. Only LBAs divisible by 8 are aligned
What Operating Systems Are Affected
Now that we’ve dealt with what 4K sectors are, why Western Digital and other drive manufacturers are switching to them, and what the potential pitfalls of 512B emulation are, we can look at the specific cases where there are potential problems.
The big problem is that while the first work on 4KB sectors started in 1998, it wasn’t until after the launch of Windows XP that the matter came to a head. As a result the 5.x versions of Windows (2K, XP, 2K3, WHS) have no concept of 4KB sectors. Even though all operating systems will be seeing 512B sectors through the use of emulation technology on the drive controller, out of Windows only Win 6.x (Vista, 2008, Win7) and later have been programmed to take in to account the alignment issues we mentioned earlier. Win 5.xx in particular has a nasty habit of starting the first partition at LBA 63, which is 1 512B sector misaligned from a 4K sector boundary. In essence, the issue is that Win 5.x will always create a misaligned first partition and will have poor default performance as a result.
Although Win 5.x is the primary victim here, other versions of Windows can also be affected in edge cases. Along with the need for 4K-aware operating systems, drive imaging software needs to be 4K-aware. Otherwise such imaging software may inadvertently create misaligned partitions too. As such, Win 6.x is also affected by alignment issues when imaging software is used, as some (and perhaps all?) imaging products currently available will write misaligned partitions and/or clusters.
Notably, Linux and Mac OS X are not affected by this issue. Western Digital has tested both of these operating systems, and officially classifies them as not-affected. Ultimately we suspect that if you went back far enough you could find older versions of these OSes that are affected, but unlike Win 5.xx, there’s not a significant legacy user base to worry about. Along these lines, Linux and Mac OS X drive imaging products are similarly unaffected. In their testing, imaging tools such as SuperDuper didn’t run in to any alignment issues, so Linux and Mac OS X users are not affected in any way by 4K sectors. It’s only Windows and Windows imaging products that are affected.
In order to solve the misalignment issue, Western Digital is offering two solutions. The first solution for correcting misaligned partitions is specifically geared towards Win 5.x, and that is an option on the drive itself to use an offset. Through the jumpering of pins 7 and 8 on an Advanced Format drive, the drive controller will use a +1 offset, resolving Win 5.xx’s insistence on starting the first partition at LBA 63 by actually starting it at LBA 64, an aligned position. This is exactly the kind of crude hack it sounds like since it means the operating system is no longer writing to the sector it thinks its writing to, but it’s simple to activate and effective in solving the issue so long as only a single partition is being used. If multiple partitions are being used, then this offset cannot be used as it can negatively impact the later partitions. The offset can also not be removed without repartitioning the drive, as the removal of the offset would break the partition table.
The second method of resolving misaligned partitions is through the use of Western Digital’s WD Align utility, which moves a partition and its data from a misaligned position to an aligned position. This is the recommended solution for using multiple partitions under Win 5.xx, along with correcting any misaligned partitions generated by imaging software. For that matter we’d consider it the recommended solution for single-partition drives being used under Win 5.x too, as there’s no need to worry about offsets and breaking the partition table.
The utility is available for download from Western Digital’s site, and while it isn’t pretty (it’s a scripted CLI application) it gets the job done. The amount of time needed to run the utility is based on the amount of data that needs to be moved rather than the partition size (it simply ignores empty space), so it’s best to run the utility immediately after creating a partition or installing Windows, as there’s less data to move around.
Unfortunately, at this point the utility also serves as the only way to identify an Advance Format drive without physically looking at it. Looking at the ATA spec, it looks like there’s a provision for asking a drive its native sector size (regardless of 512B emulation) but at this point there’s no such tool beyond the WD Align utility itself. This in and of itself isn’t a big issue, but if you’re a techie that ever finds themselves working on an XP machine with a 1TB+ Western Digital drive, you’ll want to keep an eye open.
The First Drives & The Future
So what are the first Advanced Format drives and when are they due? The first drives will be Caviar Green drives using multiple 500GB platters – so the 1TB, 1.5TB, and 2TB Caviar Green. These drives will be shipping any day now, and can be identified through two different methods: 1) They all have 64MB of cache - the first WD Caviar Green drives to come with that much cache - and 2) They all have EARS in the drive model number, e.g. WD10EARS.
As we stated before, in spite of the benefits of 4K sectors, Western Digital is not pushing these drives as part of any major product launch. Rather they’re going to be quietly trickling in to the marketplace. Expect a price premium at first (as with any other new product) before settling down. We don’t have a drive on-hand to review, but from the fact that this is a low-key launch, WD isn’t painting any expectations of a performance difference, although this will be something to test in the future.
And on that note, expect to see similar launches from everyone else within the next year. The last IDEMA plan called for everyone to have 4K-sector drives by 2011, so everyone should be launching within the next year here. Everyone using 512B emulation is going to run in to the same teething issues with Win 5.x – so while other vendors may handle things slightly differently, ultimately everyone is going to be compensating for Win 5.x in some manner (in case it hasn’t been made clear here, these guys would be ecstatic for Win 5.x to go away quickly).
Farther down the road will be the exposure of 4K-sectors to the operating system itself. Linux and Win 6.x are set (and we believe that Mac OS X is too), the only limit right now is the desire to do a phased transition to make thing easier for legacy users. Since 4K-sector drives won’t work on Win 5.x at all, drive manufacturers can’t put them on the market so long as there’s a significant legacy base. 2014 – the year that extended support ends for WinXP – looks like a good year to finally complete the move to 4K sectors.