Why This Error Happens
Error 3644 with the “Prefaulter task failed” message typically occurs when SQL Server 2025’s database engine attempts to pre-allocate or “pre-fault” memory pages for a data file during startup or recovery, but the underlying I/O subsystem returns an unexpected error code. This is most commonly caused by file system permission restrictions on the SQL Server service account, disk-level corruption on the volume hosting the .mdf/.ndf/.ldf files, or a conflict with antivirus/EDR software intercepting file handle operations. In rarer cases, this surfaces when the file resides on a network share or storage tier that does not fully support the sparse file or instant file initialization APIs required by the prefaulting mechanism.
Step-by-Step Resolution Guide
Step 1: Verify File and Folder Permissions
- Open File Explorer and navigate to the SQL Server data directory (commonly
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA). - Right-click the affected file, go to Properties > Security, and confirm the SQL Server service account (e.g.,
NT Service\MSSQLSERVER) has Full Control. - If permissions are missing, run the following in an elevated PowerShell prompt:
icacls "C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\yourfile.mdf" /grant "NT SERVICE\MSSQLSERVER:(F)"
Step 2: Check Disk Health and File Integrity
- Run
chkdsk C: /f /rfrom an elevated Command Prompt and schedule a restart if the volume is locked. - Inspect the Windows Event Viewer under Windows Logs > System for Disk or Ntfs warnings correlating with the SQL error timestamp.
- If corruption is confirmed, restore the affected database file from the most recent verified backup using
RESTORE DATABASE ... WITH REPLACE.
Step 3: Exclude SQL Server Paths from Antivirus/EDR Scanning
- Open your antivirus console (Windows Defender or third-party) and add exclusions for:
- The SQL data directory (
...\MSSQL\DATA) - The SQL log directory (
...\MSSQL\LOG) sqlservr.exeprocess itself- Restart the SQL Server (MSSQLSERVER) service via
services.mscto apply changes immediately.
Step 4: Confirm Instant File Initialization (IFI) and Storage Compatibility
- Ensure the SQL Server service account has the Perform Volume Maintenance Tasks right via
secpol.msc > Local Policies > User Rights Assignment. - If the file resides on a network share, migrate it to local NVMe/SSD storage, as prefaulting operations are not reliably supported on all remote file systems.
Alternative or Verification Steps
- After applying fixes, restart the SQL Server service and check the SQL Server Error Log (
ERRORLOGfile) for recurrence of Error 3644; also runDBCC CHECKDBon the affected database to confirm no residual corruption. - If the issue persists, temporarily disable instant file initialization via
sp_configureand test a clean restart — if the error disappears, the root cause is confirmed to be storage/IFI related rather than permissions.