Troubleshooting Guide: SQL Server Error 5531
Why This Error Happens
Error 5531 occurs when SQL Server’s Transaction File System Resource Manager (TxF/CLFS) fails to switch its logging mode (typically between “full” and “undo” logging) on the underlying volume. This is most commonly caused by the SQL Server service account lacking sufficient NTFS/CLFS permissions on the log directory, the Common Log File System (CLFS) driver being disabled or corrupted on Windows Server 2025/Windows 11, or the target volume not supporting Transactional NTFS (TxF) features due to filesystem configuration or third-party filter drivers (antivirus/backup software) interfering with the log stream. In some cases, the resource manager container file itself (the .blf log file) may be corrupted or locked by another process.
Step-by-Step Resolution Guide
Step 1: Verify CLFS Driver and Service Status
- Open an elevated PowerShell/Command Prompt and run
sc query clfsto confirm the Common Log File System driver is present and running. - If stopped or disabled, run
sc config clfs start=autofollowed bysc start clfs. - Check Event Viewer under Windows Logs > System for any CLFS-related driver load failures.
Step 2: Validate NTFS Permissions on the Resource Manager Path
- Navigate to the path referenced in the error message (e.g.,
C:\Program Files\Microsoft SQL Server\MSSQL17.MSSQLSERVER\MSSQL\DATA\). - Right-click the folder, go to Properties > Security, and ensure the SQL Server service account (e.g.,
NT SERVICE\MSSQLSERVER) has Full Control. - Apply permissions recursively using
icacls "C:\Path\To\Data" /grant "NT SERVICE\MSSQLSERVER:(OI)(CI)F" /T.
Step 3: Check for Filter Driver or Antivirus Interference
- Temporarily disable real-time antivirus/backup agent filters (e.g., via
fltmc filtersto list andfltmc unload <FilterName>to remove a suspect filter). - Add exclusions in your antivirus console for the SQL Server data and log directories.
- Restart the SQL Server service and reproduce the operation that triggered Error 5531.
Step 4: Rebuild or Remove the Corrupted Resource Manager Log File
- Stop the SQL Server service via
net stop MSSQLSERVER. - Locate the
.blf(base log file) and associated container files in the TxF resource manager path named in the error. - Rename or move the corrupted
.blffiles to a backup folder, then restart SQL Server to force regeneration:net start MSSQLSERVER.
Step 5: Confirm Volume Supports Transactional NTFS Features
- Run
fsutil resource info "C:"to validate the volume’s Transactional NTFS resource manager status. - If TxF is deprecated/unsupported on that specific volume (common on ReFS or certain Storage Spaces configurations), move the SQL Server data/log files to a standard NTFS volume.
- Update storage configuration using SQL Server Configuration Manager to point to the new NTFS path.
Alternative or Verification Steps
- Verify the fix by checking SQL Server Error Log (via
EXEC sp_readerrorlog) for the absence of Error 5531 after restarting the service and running a transaction that previously triggered the failure. - If the issue persists, run
DBCC CHECKDBon the affected database to rule out underlying corruption, and consider restoring from a known-good backup if the resource manager remains unstable.