THE TECH PALACE / COMMUNITY

Report a comment

Tell us what needs attention. Your report is reviewed in the editorial studio.

Reason

Library / Tools & experiences

TOOLS & EXPERIENCES

Install SQL Server on Windows 11: Fix disk sector size issue

Learn how to fix SQL Server installation error on Windows 11 caused by disk sector size with our detailed guide

Editorial readingKeep exploring
Install SQL Server on Windows 11: Fix disk sector size issue

If you are trying to install Microsoft SQL Server 2022 on a Windows 11 system and you encounter the following error:

Microsoft SQL Server 2022 installer

Error:
Failed to wait for database engine recovery handle. Check the SQL Server error log for possible causes.

Don’t panic! This issue is often caused by the disk sector size exposed by some NVMe storage devices, which exceeds 4 KB, a limit that SQL Server does not yet fully handle. In this article, I will guide you step by step to fix this problem and complete the installation successfully.

Check your system environment

Before you begin, make sure you have administrative privileges on your system. The error mainly occurs on disks with a logical sector size greater than 4 KB. This situation can be checked via Command Prompt or PowerShell:

Get-PhysicalDisk | Select-Object DeviceId, Size, LogicalSectorSize

If the displayed logical size exceeds 4096 bytes, you will need to make the adjustments described below:

1. Add a key to the Windows Registry

To resolve this issue, we will force Windows to use a sector size of 4095 bytes for the affected disk.

Method 1: Edit the Registry manually
  1. Open Registry Editor (type regedit in the Windows search bar and open it with administrator rights).

  2. Navigate to the following path:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device
  3. From the Edit menu, select New, then Multi-String Value.

  4. Give the new value the following name:

    ForcedPhysicalSectorSizeInBytes
  5. Double-click this value and enter:

    *4095
  6. Click OK and close Registry Editor.

Method 2: Use Command Prompt

To avoid editing the Registry manually, you can run the following commands in a Command Prompt as administrator:

REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t REG_MULTI_SZ /d "* 4095" /f

To verify that the key was added successfully:

REG QUERY "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes"
Method 3: Use PowerShell

If you prefer PowerShell, run the following command:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" -Name "ForcedPhysicalSectorSizeInBytes" -PropertyType MultiString -Value "* 4095" -Force

Then check:

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

2. Restart the system

Once the registry key is added, restart your computer to apply the changes.

3. Restart the SQL Server installation

Reopen the SQL Server Setup Wizard and follow the steps as before. The error should no longer appear, and the installation should complete successfully.


This issue highlights the importance of the interaction between software and hardware. By modifying the system configuration, you can work around this limitation and take full advantage of the features of SQL Server 2022. If you encounter other issues, please feel free to consult the official Microsoft support pages for additional guidance.

More ideas to explore.

The conversation

Share your view. Messages with links or suspicious content are reviewed before they appear.