Troubleshoot errors related to system disk sector size greater than 4 KB
Article
This article provides solutions for troubleshooting errors during installation or starting an instance of SQL Server on Windows 11 and Windows Server 2022. This article is valid for all released versions of SQL Server.
The errors discussed in this article are related to system disk sector size greater than 4 KB.
Applies to: SQL Server all versions
Symptoms
Scenario #1: You install any version of SQL Server on a Windows 11 device. Then, you see errors similar to the following message for the Database Engine Services component of SQL Server:
Output
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.
Scenario #2: 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 and in the SQL Server error log, you notice entries similar to:
Output
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 #3: 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 entries similar to:
Scenario #4: You install LocalDB on a Windows 11 device. The setup fails and in the SQL Server error log, you notice entries similar to:
Output
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 11 Application Event Log, you notice entries similar to:
Output
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.
Scenario #5: If you try to use sector size higher than 4 KB, you see the following error message:
Output
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.
Cause
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.
On systems running Windows 11, some new storage devices and device drivers exposes a disk sector size greater than the supported 4-KB sector size.
When this occurs, SQL Server will be 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:
Console
fsutil fsinfo sectorinfo <volume pathname>
For example, to analyze the E: volume, run the following command:
Console
fsutil fsinfo sectorinfo E:
Look for the values PhysicalBytesPerSectorForAtomicity and PhysicalBytesPerSectorForPerformance, returned in bytes, and 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.
Microsoft is currently investigating this problem.
Consider one of the following solutions:
If you have multiple drives on this system, you can specify a different location for the database files after installation of SQL Server is complete. Make sure that drive reflects a supported sector size when querying the fsutil commands. SQL Server currently supports sector storage sizes of 512 bytes and 4096 bytes.
You can add a registry key, which will cause the behavior of Windows 11 and later to be similar to Windows 10. This forces the sector size to be emulated as 4 KB. To add the ForcedPhysicalSectorSizeInBytes registry key, use the Registry Editor or run commands as described in the PowerShell as Administrator section. You must reboot the device after adding the registry key in order for this change to take effect.
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
Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device.
On the Edit menu, point to New, and then select Multi-String value. Name it ForcedPhysicalSectorSizeInBytes.
Modify the new value, type in * 4095. Select OK and close the Registry editor.
You can start SQL Server by specifying the trace flag 1800. For more information, see DBCC TRACEON. This trace flag isn't enabled by default. Trace flag 1800 forces SQL Server to use 4 KB as the sector size for all read and write operations. When you are running SQL Server on disks with physical sector size greater than 4 KB, using the trace flag 1800 will simulate a native 4 KB drive, which is the supported sector size for SQL Server.
Install SQL Server on available Windows 10 devices instead.
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.
The 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 are using. 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>
Azure HPC is a purpose-built cloud capability for HPC & AI workload, using leading-edge processors and HPC-class InfiniBand interconnect, to deliver the best application performance, scalability, and value. Azure HPC enables users to unlock innovation, productivity, and business agility, through a highly available range of HPC & AI technologies that can be dynamically allocated as your business and technical needs change. This learning path is a series of modules that help you get started on Azure HPC - you
Administer an SQL Server database infrastructure for cloud, on-premises and hybrid relational databases using the Microsoft PaaS relational database offerings.