大网数据广告活动
数据库与应用安全

Troubleshoot Operating System Disk Sector Size Greater Than 4 KB

· 52CE 我爱测

This article troubleshoots SQL Server installation or startup failures related to some new storage devices and device drivers exposing a disk sector size greater than the supported 4-KB sector size.

Summary

This article provides solutions to troubleshoot SQL Server installation and startup failures that are caused by a system disk sector size greater than the supported 4 KB. These errors occur when modern storage devices, such as NVMe solid-state drives (SSDs), report a system disk sector size larger than 4 KB. Symptoms include SQL Setup failures, errors 5178 and 5179, a failed Database Engine startup or recovery handle, "misaligned log IOs" warnings, and ntdll.dll application faults. The solutions apply to all released versions of SQL Server, including LocalDB.

Installing SQL Server on a machine with a system disk sector size greater than 4 KB can result in the following scenarios.

Scenario 1: Move the file to a volume with a compatible sector size

When you try to use sector size greater than 4 KB, you see the following error message:

Error: 5179, Severity: 16, State: 1.
Cannot use file 'data file path', because it is on a volume with sector size 8192. SQL Server supports a maximum sector size of 4096 bytes. Move the file to a volume with a compatible sector size.

Scenario 2: Could not find the Database Engine startup handle

When you try to install a SQL Server instance on an Azure virtual machine (VM) running Windows, the installation fails, and you receive the following error message in the SQL Server error log when the engine tries to start during the installation:

Cannot use file '...\master.mdf' because it was originally formatted with sector size 4096 and is now on a volume with sector size 8192. Move the file to a volume with a sector size that is the same as or smaller than the original sector size.

Additionally, you can see the following information in the Summary.txt log file in the SQL Server setup folder:

Detailed results:
  Feature:                       Database Engine Services
  Status:                        Failed
  Reason for failure:            An error occurred during the setup process of the feature.
  Next Step:                     Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
  Component name:                SQL Server Database Engine Services Instance Features
  Component error code:          0x851A0019
  Error description:             Could not find the Database Engine startup handle.

For more information, see SQL Server installation fails with sector size error on a Windows Server 2022 Azure virtual machine.

Scenario 3: Wait on the Database Engine recovery handle failed

When you install any version of SQL Server, you see the following error for the Database Engine Services component of SQL Server:

Feature: Database Engine Services 
Status: Failed 
Reason for failure: An error occurred during the setup process of the feature. 
Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again. 
Component name: SQL Server Database Engine Services Instance Features 
Component error code: 0x851A001A 
Error description: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes. 

Or, you see the following errors in the SQL Server error Log:

2025-02-26 20:01:16.79 spid14s     Starting up database 'master'.
2025-02-26 20:01:16.80 spid14s     Error: 5178, Severity: 16, State: 1.
2025-02-26 20:01:16.80 spid14s     Cannot use file 'C:\Program Files\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQL\DATA\master.mdf' because it was originally formatted with sector size 4096 and is now on a volume with sector size 8192. Move the file to a volume with a sector size that is the same as or smaller than the original sector size.

Scenario 4: There have been 256 misaligned log IOs which required falling back to synchronous IO

You install any version of SQL Server on a Windows 10 device. Then, you upgrade the operating system (OS) on the device to Windows 11. When you try to start SQL Server on a Windows 11 device, the service fails to start. In the SQL Server error log, you notice the following entries:

2021-11-05 23:42:47.14 spid9s There have been 256 misaligned log IOs which required falling back to synchronous IO. The current IO is on file C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\master.mdf. 

Scenario 5: SQL Server application error from ntdll.dll

You install any version of SQL Server on a Windows 10 device. Then, you upgrade the OS on the device to Windows 11. When you try to start SQL Server on a Windows 11 device, the service fails to start. In the SQL Server error log, you notice the following entries:

Faulting application name: sqlservr.exe, version: 2019.150.2000.5, time stamp: 0x5d8a9215 
Faulting module name: ntdll.dll, version: 10.0.22000.120, time stamp: 0x50702a8c 
Exception code: 0xc0000005 
Fault offset: 0x00000000000357ae 
Faulting process id: 0x1124 
Faulting application start time: 0x01d7bf67449d262c
Faulting application path: C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Binn\sqlservr.exe 
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll 

Scenario 6: Move the file to a volume with a sector size that is the same as or smaller than the original sector size

You install LocalDB on a Windows 11 device and the setup fails. In the SQL Server error log, you notice the following entries:

2021-12-15 23:25:04.28 spid5s      Cannot use file 'C:\Users\Administrator\AppData\Local\Microsoft\Microsoft SQL Server Local DB\Instances\TestInstance\master.mdf' because it was originally formatted with sector size 4096 and is now on a volume with sector size 16384. Move the file to a volume with a sector size that is the same as or smaller than the original sector size.

In the Windows Application Event Log on the Windows 11 device, you notice the following entries:

Message            : Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error}
                     The application was unable to start correctly (0x%lx). Click OK to close the application.
                     Reported at line: 3621.
Source             : SQLLocalDB 11.0

Note: You might encounter the failures mentioned in the previous scenarios for a SQL Server instance you installed manually or on a LocalDB instance installed by applications.

Cause of disk sector size errors in SQL Server

During service startup, SQL Server begins the database recovery process to ensure database consistency. Part of this database recovery process involves consistency checks on the underlying filesystem before you try to open system and user database files.

Some new storage devices and device drivers expose a disk sector size greater than the supported 4-KB sector size.

When this issue occurs, SQL Server is unable to start due to the unsupported file system as SQL Server currently supports sector storage sizes of 512 bytes and 4 KB.

You can confirm that you encounter this specific issue by running the command:

fsutil fsinfo sectorinfo <volume pathname>

For example, to analyze the E: volume, run the following command:

fsutil fsinfo sectorinfo E:

Look for the values PhysicalBytesPerSectorForAtomicity and PhysicalBytesPerSectorForPerformance, returned in bytes. If they're different, retain the largest one to ascertain the disk sector size. A value of 4096 indicates a sector storage size of 4 KB.

Additionally, refer to the Microsoft support policy for 4-KB sector hard drives in Windows article.

Note: There's no released version of SQL Server compatible with sector sizes greater than 4 KB. For more information, see Hard disk drive sector-size support boundaries in SQL Server.

Resolution steps for disk sector size errors in SQL Server

  • Currently, the ForcedPhysicalSectorSizeInBytes registry key is required to successfully install SQL Server when using modern storage platforms, such as NVMe, that provide a sector size larger than 4 KB. This Windows operating system registry key forces the sector size to be emulated as 4 KB.

    To add the ForcedPhysicalSectorSizeInBytes registry key, use Registry Editor or run commands as described in the Command Prompt or PowerShell section. There's no need to add Trace Flag 1800 for this scenario.

    [!IMPORTANT] This section contains steps that tell you how to modify the Windows registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see the How to back up and restore the registry in Windows article.

    Registry Editor

    1. Run Registry Editor as an administrator.
    2. Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device.
    3. Select Edit > New > Multi-String value and name it as ForcedPhysicalSectorSizeInBytes.
    4. Right-click the name, select Modify, and type * 4095 in the Value data field.
    5. Select OK and close Registry Editor.

    You must reboot the device after adding the registry key for this change to take effect.

    Command Prompt

    1. Run Command Prompt as an administrator.

    2. Run the following command to add the key:

      REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t   REG_MULTI_SZ /d "* 4095" /f
      
    3. Run the following command to check if the key is added successfully:

      REG QUERY "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v 
      "ForcedPhysicalSectorSizeInBytes"
      

    PowerShell

    1. Run PowerShell as an administrator.

    2. Run the following command to add the key:

      New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" -Name   "ForcedPhysicalSectorSizeInBytes" -PropertyType MultiString        -Force -Value "* 4095"
      
    3. Run the following command to check if the key is added successfully:

      Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" -Name   "ForcedPhysicalSectorSizeInBytes"
      

  • If you don't add the registry key and you have multiple drives on this system, you can specify a different location for the database files after the installation of SQL Server is complete. Make sure that the drive reflects a supported sector size when querying the fsutil commands. SQL Server currently supports sector storage sizes of 512 bytes and 4,096 bytes.

Caution: If you already created a storage pool with disks that have a sector size greater than 4 KB to host SQL Server files, you must first remove the storage pool, apply one of the troubleshooting methods mentioned in this article, and then rebuild the storage pool before attempting to install SQL Server on the storage pool or pools.

More information

Windows 11 native NVMe drivers were updated to include the actual sector size reported directly by the NVMe storage devices. This was done rather than relying on the information that's emulated from the filesystem drivers.

Windows 10 drivers don't report the source sector size of the physical storage.

The improved Windows 11 drivers disregard the emulation that common NVMe storage devices use. As an example, fsutil displays a sector size of 8 KB or 16 KB, rather than emulating the required 4-KB sector size required by Windows.

The following table provides a comparison of the sector sizes reported by the operating systems. This example illustrates the differences between Windows 10 and Windows 11 using the same storage device. For the values of PhysicalBytesPerSectorForAtomicity and PhysicalBytesPerSectorForPerformance, Windows 10 displays 4 KB and Windows 11 displays 16 KB.

Sample output of fsutil fsinfo sectorinfo <volume pathname>

Windows 10 Windows 11
LogicalBytesPerSector : 512 LogicalBytesPerSector : 512
PhysicalBytesPerSectorForAtomicity : 4096 PhysicalBytesPerSectorForAtomicity : 16384
PhysicalBytesPerSectorForPerformance : 4096 PhysicalBytesPerSectorForPerformance : 16384
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096 FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
Device Alignment : Aligned (0x000) Device Alignment : Aligned (0x000)
Partition alignment on device : Aligned (0x000) Partition alignment on device : Aligned (0x000)
No Seek Penalty No Seek Penalty
Trim Supported Trim Supported
Not DAX capable Not DAX capable
Not Thinly-Provisioned Not Thinly-Provisioned

Related content

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors (upstream author metadata: WilliamDAssafMSFT). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 06/25/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。