Skip to content

Commit f41ada9

Browse files
authored
Merge pull request #8654 from sevend2/CI5314
AB#5314: Improvements to SQL article - disk sector size greater than 4KB
2 parents 410a738 + c95bba1 commit f41ada9

File tree

1 file changed

+57
-21
lines changed

1 file changed

+57
-21
lines changed

support/sql/database-engine/database-file-operations/troubleshoot-os-4kb-disk-sector-size.md

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Troubleshooting operating system disk sector size greater than 4 KB
2+
title: Troubleshoot Operating System Disk Sector Size Greater Than 4 KB
33
description: 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.
4-
ms.date: 03/10/2025
4+
ms.date: 04/17/2025
55
ms.custom: sap:File, Filegroup, Database Operations or Corruption
6-
ms.reviewer: dplessMSFT, briancarrig, suresh-kandoth, rdorr, jopilov
6+
ms.reviewer: dpless, briancarrig, sureshka, rdorr, jopilov
77
author: WilliamDAssafMSFT
88
ms.author: wiassaf
99
---
@@ -12,13 +12,43 @@ ms.author: wiassaf
1212

1313
This article provides solutions for troubleshooting errors during installation or starting an instance of SQL Server on Windows. This article is valid for all released versions of SQL Server.
1414

15-
The errors discussed in this article are related to system disk sector size greater than 4 KB.
15+
This article discusses errors related to system disk sector size greater than 4 KB. When you try to install a SQL Server instance on a machine with system disk sector size greater than 4 KB, you might encounter the following scenarios:
1616

1717
_Applies to_:   SQL Server all versions
1818

19-
## Symptoms
19+
## Scenario 1: Move the file to a volume with a compatible sector size
2020

21-
**Scenario #1:** You install any version of SQL Server. Then, you see errors similar to the following message for the Database Engine Services component of SQL Server:
21+
If you try to use sector size greater than 4 KB, you see the following error message:
22+
23+
```output
24+
Error: 5179, Severity: 16, State: 1.
25+
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.
26+
```
27+
28+
## Scenario 2: Could not find the Database Engine startup handle
29+
30+
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:
31+
32+
> 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.
33+
34+
Additionally, you can see the following information in the **Summary.txt** log file in the SQL Server setup folder:
35+
36+
```output
37+
Detailed results:
38+
Feature: Database Engine Services
39+
Status: Failed
40+
Reason for failure: An error occurred during the setup process of the feature.
41+
Next Step: Use the following information to resolve the error, uninstall this feature, and then run the setup process again.
42+
Component name: SQL Server Database Engine Services Instance Features
43+
Component error code: 0x851A0019
44+
Error description: Could not find the Database Engine startup handle.
45+
```
46+
47+
For more information, see [SQL Server installation fails with sector size error on a Windows Server 2022 Azure virtual machine](../../azure-sql/sql-installation-fails-sector-size-error-azure-vm.md).
48+
49+
## Scenario 3: Wait on the Database Engine recovery handle failed
50+
51+
When you install any version of SQL Server, you see errors that resemble the following message for the Database Engine Services component of SQL Server:
2252

2353
```output
2454
Feature: Database Engine Services
@@ -30,40 +60,46 @@ Component error code: 0x851A001A
3060
Error description: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes.
3161
```
3262

33-
Or, you see errors in the SQL Server Error Log similar to:
63+
Or, you see the following errors in the SQL Server error Log:
3464

3565
```output
3666
2025-02-26 20:01:16.79 spid14s Starting up database 'master'.
3767
2025-02-26 20:01:16.80 spid14s Error: 5178, Severity: 16, State: 1.
3868
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.
3969
```
4070

41-
**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:
71+
## Scenario 4: There have been 256 misaligned log IOs which required falling back to synchronous IO
72+
73+
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:
4274

4375
```output
4476
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.
4577
```
4678

47-
**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:
79+
## Scenario 5
80+
81+
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:
4882

4983
```output
5084
Faulting application name: sqlservr.exe, version: 2019.150.2000.5, time stamp: 0x5d8a9215
5185
Faulting module name: ntdll.dll, version: 10.0.22000.120, time stamp: 0x50702a8c
5286
Exception code: 0xc0000005
5387
Fault offset: 0x00000000000357ae
5488
Faulting process id: 0x1124
55-
Faulting application start time: 0x01d7bf67449d262c
89+
Faulting application start time: 0x01d7bf67449d262c
5690
Faulting application path: C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Binn\sqlservr.exe
5791
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
5892
```
5993

60-
**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:
94+
## Scenario 6: Move the file to a volume with a sector size that is the same as or smaller than the original sector size
95+
96+
You install LocalDB on a Windows 11 device and the setup fails. In the SQL Server error log, you notice the following entries:
6197

6298
```output
6399
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.
64100
```
65101

66-
In the Windows 11 Application Event Log, you notice entries similar to:
102+
In the Windows 11 Application Event Log, you notice the following entries:
67103

68104
```output
69105
Message : Windows API call WaitForMultipleObjects returned error code: 575. Windows system error message is: {Application Error}
@@ -75,20 +111,13 @@ Source : SQLLocalDB 11.0
75111
> [!Note]
76112
> 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.
77113
78-
**Scenario #5:** If you try to use sector size higher than 4 KB, you see the following error message:
79-
80-
```output
81-
Error: 5179, Severity: 16, State: 1.
82-
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.
83-
```
84-
85114
## Cause
86115

87116
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.
88117

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

91-
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.
120+
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.
92121

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

@@ -111,7 +140,9 @@ Additionally, be aware of the Windows support policy for file system and storage
111140
112141
## Resolutions
113142

114-
- 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. You must reboot the device after adding the registry key for this change to take effect. There is no need to add Trace Flag 1800 for this scenario.
143+
- 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.
144+
145+
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.
115146

116147
> [!IMPORTANT]
117148
> 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](../../../windows-server/performance/windows-registry-advanced-users.md#back-up-the-registry) article.
@@ -124,6 +155,8 @@ Additionally, be aware of the Windows support policy for file system and storage
124155
1. Right-click the name, select **Modify**, and type `* 4095` in the **Value data** field.
125156
1. Select **OK** and close Registry Editor.
126157

158+
You must reboot the device after adding the registry key for this change to take effect.
159+
127160
### [Command Prompt](#tab/command-prompt)
128161

129162
1. Run Command Prompt as an administrator.
@@ -158,6 +191,9 @@ Additionally, be aware of the Windows support policy for file system and storage
158191

159192
- 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.
160193

194+
> [!CAUTION]
195+
> If you've 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.
196+
161197
## More information
162198

163199
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.

0 commit comments

Comments
 (0)