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

SQL Server Installation Fails with Sector Size Error on Azure VM

· 52CE 我爱测

Fixes the error (Cannot use file master.mdf because it was originally formatted with sector size 4096) when you install SQL Server on an Azure VM that uses an NVMe disk with an 8-KB sector size.

Applies to:   SQL Server, SQL Server on Azure VM - Windows

Summary

This article helps you fix a problem that occurs when you manually install a SQL Server instance on a Microsoft Azure virtual machine (VM) that runs Windows. When you install SQL Server on an Azure VM that uses an NVMe disk with a native sector size larger than 4 KB, setup fails because SQL Server data files like master.mdf can't be hosted on a volume with an 8-KB sector size. This article explains why the sector size mismatch occurs on newer Azure VM series, and how to force a 4-KB sector size so that SQL Server installation succeeds on the disk.

Symptoms

When you install a SQL Server instance on an Azure VM that runs Windows, the installation fails and the SQL Server error log shows the following message when the engine tries to start:

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.

The Summary.txt log file in the SQL Server setup folder also shows entries like the following:

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.

This issue can occur with on-premises installations, but you're more likely to see it when you install SQL Server on an Azure VM.

Cause

This issue occurs because of the sector size of the disk on some Azure VM sizes. Newer Azure VM series like Dadsv6, Eadsv6, and Fasv6 use an NVMe-only storage interface and require an OS image that supports NVMe. These VM series expose disks with a default native sector size of 8 KB, which SQL Server doesn't support for database files. SQL Server supports disks with native sector sizes of 512 bytes and 4 KB. If an Azure VM is deployed with an 8-KB sector size and you then install SQL Server, the installation can fail. For more information, see Storage types for SQL Server.

Note: This scenario applies only when you manually install SQL Server on an Azure VM. It doesn't apply when you deploy a SQL Server VM image from Azure Marketplace, because those images are preconfigured to use a 4-KB sector size.

Impacted disk and VM types

You most commonly see the sector size mismatch in these scenarios:

  • Local NVMe disks on v6 VM series (for example, Dadsv6, Eadsv6, Easv6, and Fasv6), which expose an 8-KB native sector size.
  • Premium SSD v2 and Ultra Disk when you create the disk with a logical sector size of 4096 bytes but present it through a host that reports an 8-KB physical sector size.

Standard HDD, Standard SSD, and Premium SSD (v1) data disks that you attach to earlier VM series typically present a 4-KB sector size and aren't affected.

Solution

To fix this problem, force the Azure VM to use a 4-KB sector size, and then reinstall SQL Server.

  1. If SQL Server is already installed, uninstall it. Otherwise, skip to the next step.

  2. Add the ForcedPhysicalSectorSizeInBytes registry key.

  3. Check that the sector size is 4 KB by running the following command at an elevated command prompt:

    fsutil fsinfo sectorinfo <volume pathname>
    
  4. Restart the Azure VM.

  5. Reinstall SQL Server.

The following screenshot shows the output of the fsutil fsinfo sectorinfo command for the E: drive, which has an 8-KB sector size:

The following screenshot shows the output of the same command for the E: drive after the registry key is added to use a 4-KB sector size:

The ForcedPhysicalSectorSizeInBytes registry key is an OS-level setting. All drives that are currently attached, and any drives that are attached later, use a 4-KB sector size until you remove this registry key.

Related content

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. 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 05/20/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

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

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