You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: support/sql/database-engine/database-file-operations/troubleshoot-os-4kb-disk-sector-size.md
+44-40Lines changed: 44 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Troubleshooting operating system disk sector size greater than 4 KB
3
3
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: 01/10/2025
4
+
ms.date: 03/10/2025
5
5
ms.custom: sap:File, Filegroup, Database Operations or Corruption
# Troubleshoot errors related to system disk sector size greater than 4 KB
12
12
13
-
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.
13
+
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.
14
14
15
15
The errors discussed in this article are related to system disk sector size greater than 4 KB.
16
16
17
17
_Applies to_: SQL Server all versions
18
18
19
19
## Symptoms
20
20
21
-
**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:
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:
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.
39
+
```
40
+
33
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:
34
42
35
43
```output
@@ -78,7 +86,7 @@ Cannot use file 'data file path', because it is on a volume with sector size 819
78
86
79
87
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.
80
88
81
-
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.
89
+
Some new storage devices and device drivers expose a disk sector size greater than the supported 4-KB sector size.
82
90
83
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.
84
92
@@ -103,56 +111,52 @@ Additionally, be aware of the Windows support policy for file system and storage
103
111
104
112
## Resolutions
105
113
106
-
Microsoft is currently investigating this problem.
107
-
108
-
Consider _one_ of the following solutions:
109
-
110
-
- 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.
111
-
112
-
- 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](#registryeditor) or run commands as described in the [PowerShell as Administrator](#powershellasadmin) section. You must reboot the device after adding the registry key in order for this change to take effect.
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.
113
115
114
116
> [!IMPORTANT]
115
117
> 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.
116
118
117
-
<aid="registryeditor"></a>**Registry Editor**
118
-
119
-
1. Navigate to `Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device`.
120
-
1. On the **Edit** menu, point to **New**, and then select **Multi-String value**. Name it `ForcedPhysicalSectorSizeInBytes`.
121
-
1. Modify the new value, type in `* 4095`. Select **OK** and close the Registry editor.
122
-
123
-
<aid="commandpromptadmin"></a>**Command Prompt as Administrator**
- You can start SQL Server by specifying the trace flag 1800. For more information, see [DBCC TRACEON](/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql#tf1800). 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.
- 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.
156
160
157
161
## More information
158
162
@@ -179,7 +183,7 @@ The following table provides a comparison of the sector sizes reported by the op
- [SQL Server storage types for data files](/sql/sql-server/install/hardware-and-software-requirements-for-installing-sql-server-2019?view=sql-server-ver16&preserve-view=true#StorageTypes)
185
189
- [KB3009974 - FIX: Slow synchronization when disks have different sector sizes for primary and secondary replica log files in SQL Server AG and Logshipping environments](https://support.microsoft.com/topic/kb3009974-fix-slow-synchronization-when-disks-have-different-sector-sizes-for-primary-and-secondary-replica-log-files-in-sql-server-ag-and-logshipping-environments-ed181bf3-ce80-b6d0-f268-34135711043c)
0 commit comments