Advanced Format (4K sector) hard disks

All disk manufacturers now have to ensure that any new model they bring to market uses 4K bytes per physical sector rather than the (old) standard of 512 bytes per physical sector. Drive manufacturers have tried to make these new AF drives backwards compatible, however there are still some compatibility issues with Windows. In fact, MS do not actually support 4K drives on Windows XP!

Information on the backward compatibility of these drives can be found here.
Information about the issues resolved by KB982018 can be read here.
Dell also have some useful information about some potential issues here.
Detailed MS article on compatibility and programming here.

For optimum performance, partitions on 4K AF drives should be alligned on a 4K byte boundary - it can make quite a difference to performance as you can see here.
Most Windows 7 and Vista systems will already be correctly aligned, however XP systems and systems where partitions have been created using a third-party partition tool may not align the start of a partition to a 4K boundary.

Dell have a Paragon Alignment tool which you may be of use only if you have a Dell system here. Note that some people have used a free version of the Paragon Alignment tool and lost all their data - so be warned!

If you have Vista, there is an MS patch here.
If you have Windows 7, you can check if a drive is the new type of 4K drive by first installing MS hotfix KB982018 and then running fsutil as follows:


D:\>fsutil fsinfo ntfsinfo c:
NTFS Volume Serial Number :       0x687430f17430c41a
Version :                         3.1
Number Sectors :                  0x000000003a182f7d
Total Clusters :                  0x00000000074305ef
Free Clusters  :                  0x0000000004e08cfb
Total Reserved :                  0x00000000000007a0
Bytes Per Sector  :               512   << this means the disk is in Advanced Format 512e mode
Bytes Per Physical Sector :       4096  << this means you have a 4K disk
Bytes Per Cluster :               4096
Bytes Per FileRecord Segment    : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length :           0x000000000da00000
Mft Start Lcn  :                  0x00000000000c0000
Mft2 Start Lcn :                  0x0000000003a182f7
Mft Zone Start :                  0x0000000001cf7c20
Mft Zone End   :                  0x0000000001d041e0
RM Identifier:                    2A6590ED-9B5C-11DF-8E16-7071BC290459

If 'Bytes per Physical Sector' is not listed then you have not installed hotfix KB982018.

Dell also have a utility DellAFDT.exe which you can download to check for AF drives and partition alignment.

C:> DellAFDT.exe
Model:                                        Hitachi HUA722010CLA330
Serial#:                                      JPW9H0HQ2ZULVH
Advanced Format:                              No    << not an AF drive
Partition Alignment:                          Aligned
    Partition 1:                              Aligned [Not assigned]
    Partition 2:                              Aligned [C:]
    Partition 3:                              Aligned [D:]
Identify Data Word 106:                       0x0
Identify Data Word 117:                       0x0
Identify Data Word 118:                       0x0
Identify Data Word 209:                       0x0

Or you can use wmic in XP or later OS's to detect a 4K drive

C:> wmic DISKDRIVE get bytespersector, caption
BytesPerSector  Caption
512             OCZ-AGILITY3 ATA Device
512             ST3250820AS ATA Device
512             USB 2.0 USB Device
512             WDC WD1600AAJS-60M0A0 
4096            TrekStor HDD USB Device

In addition to Microsoft compatibility issues, some older storage drivers (e.g. early versions of the Intel iastor driver) do not support the new AF drives if your BIOS is in HDD AHCI mode - your image will BSOD if you try to place an old disk image onto one of these new 4K drives and boot it.

To fix this on an Intel chipset platform, you would mean need to upgrade the Intel MSM driver (e.g. 8.9.4.1004) and replace it with a new IRST driver (e.g. 10.6.0.1002 or later).

On Windows Vista/7 you may receive a pop-up error message “Windows setup could not configure Windows to run on this computer’s hardware” if the driver needs updating. You can update the driver by disabling AHCI mode in the BIOS, booting the sysprep'ed old image and using CTRL-SHIFT-F3 at the first OOBE screen to reboot and enter Audit mode, then update the driver and then re-sysprep - generalize the image. Now you can take a copy of the hard disk and make a new image. Then change the BIOS back to AHCI HDD mode and see if it now boots OK.

Known compatibility issues

The following are known compatibility issues that may occur when you use large-sector drives:

  • On Windows 7 and on Windows 2008 R2, installation will fail with the error "Windows Setup could not configure Windows on this computer's hardware" if the conditions that are outlined in http://support.microsoft.com/kb/2466753 apply.

  • If you are using a logical sector drive of a size other than 512 bytes, Windows system image backup and restore operations may fail, and you receive the following error message:
    One of the backup files could not be created.
    Details: The request could not be performed because of an I/O device error.
    Error code: 0x8078002A


  • If you create a virtual hard disk (VHD) on a native 4K sector drive by using Disk Management or Hyper-V in Windows Server 2008 R2, the operation fails with an "Incorrect Function" error. 
In Disk Management, the following error message is generated: 
Virtual Disk Manager Incorrect function
In Hyper-V, the following error message is generated when the New Virtual Hard Disk Wizard is used:
The server encountered an error trying to create the virtual hard disk. The system failed to create ‘I:\Disk0.vhd.’ Error Code: Incorrect function.
In Hyper-V, the following error message is generated when the New Virtual Machine Wizard is used: 
The server encountered an error while configuring hard disk on TestVM. The system failed to create 'I:\TestVM\TestVM.vhd.' Error Code: Incorrect function.
  • If fsutil.exe continues to display "Bytes Per Physical Sector : <Not Supported>" after you apply the latest storage driver and the required hotfixes, you should make sure that the following registry path exists: 
HKLM\CurrentControlSet\Services\<miniport’s service name>\Parameters\Device\
Name: EnableQueryAccessAlignment
Type: REG_DWORD
Value: 1: Enable

Seagate USB GoFlex Hard Disk units - it seems the USB controller used in these external USB Hard Disk units only supports 4K Sector transfers and not 512e compatibility mode. As a result they may not work with many backup utilities or disk partition utilities - including RMPrepUSB! Contact the manufacturer and ask them to change the USB controller firmware!

Check partition alignment

You can use a simple vbs script to check the partition alignment of your hard disks. For best performance partitions should start on a 4K boundary. CheckAlign.vbs.

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_DiskPartition")
For Each objItem in ColItems
    offset = (objitem.startingoffset / 4096)
    If Clng(offset) = offset then
        wscript.echo  objitem.DeviceID & " is 4K aligned"
    Else
        wscript.echo  objitem.DeviceID & " is NOT 4K aligned"
    End If
Next

Type cscript Checkalign.vbs to run it (or double-click on the vbs file):

cscript CheckAlign.vbs

Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

Disk #1, Partition #0 is 4K aligned
Disk #0, Partition #0 is NOT 4K aligned
Disk #0, Partition #1 is 4K aligned
Disk #0, Partition #2 is 4K aligned
Disk #2, Partition #0 is NOT 4K aligned
Disk #2, Partition #1 is NOT 4K aligned


Trouble using some disk utilities with some AF drives?

Most modern hard disks support 512e compatibility mode if they are AF drives, however some modern devices that contain Flash memory (such as USB FLash memory sticks, MP3 players, etc.) may not support 512e (and may not support XP or earlier operating systems).
Disk utilities (such as RMPrepUSB) work with direct access to disk sectors. This means that a read of 1 sector from a 4K sector device will fail if the device does not support compatibility (512e) mode. However, a direct read of 8 sectors (8*512bytes=4K) will work. You can test this using RMPrepUSB Disk Doctore (hit Ctrl-D in RMPrepUSB) - if you set the No. Sectors value to 8 and the Start to 0 and then click on Sequential REad, it should complete successfully a read from a 4K non-compatible device, however a Sequential Read with the No. Sectors value of less than 8 will fail if the device does not support 512-byte compatibility mode. You will need to set a Start value using a modulo 8 value (e.g. 0,8,16,24,32, etc.) for the read to be successful.