Skip to main content

SQL Server Backup Failed? Here’s How to Fix It

By December 1, 2026Blog

How to Fix “Cannot Open Backup Device” Error in SQL Server – Complete Troubleshooting Guide

SQL Server database backup is one of the most important activities in database administration. Regular backups help Database Administrators (DBAs) protect critical business data and recover databases during unexpected failures.

However, while performing database backup or restore operations, SQL Server users may encounter the following error:

“Cannot open backup device. Operating system error 5 (Access is denied).”

Sometimes, the error may also appear with operating system error 2 (The system cannot find the file specified).

This issue generally occurs when SQL Server cannot access the specified backup file or directory due to permission restrictions, an incorrect file path, or storage-related problems.

In this blog, we will explore the causes of the Cannot Open Backup Device error in SQL Server and learn different methods to troubleshoot and resolve it.

 

 What Is the Cannot Open Backup Device Error in SQL Server?

The “Cannot Open Backup Device” error occurs when SQL Server cannot access the destination file or location specified in a BACKUP DATABASE command.

For example, when executing the following query:

BACKUP DATABASE EmployeeDB
TO DISK = 'C:\SQLBackups\EmployeeDB.bak'
WITH INIT, COMPRESSION;

SQL Server may return an error similar to:

Msg 3201, Level 16, State 1
Cannot open backup device
'C:\SQLBackups\EmployeeDB.bak'.

Operating system error 5:
Access is denied.

Msg 3013, Level 16, State 1
BACKUP DATABASE is terminating abnormally.

This means SQL Server cannot write the backup file to the specified location.

Common Causes of the Cannot Open Backup Device Error

Understanding the root cause helps resolve the issue more efficiently.

1. Insufficient Folder Permissions

The SQL Server Database Engine service account may not have the required permissions to write files into the backup directory.

2. Incorrect Backup File Path

If the specified directory does not exist or the file path contains an incorrect folder name, SQL Server cannot create the backup file.

3. SQL Server Service Account Restrictions

SQL Server accesses backup locations using the Database Engine service account, not necessarily the Windows account currently logged in.

4. Existing File or File Access Restrictions

An existing backup file may be read-only, locked by another process, or inaccessible due to security restrictions.

5. Network Backup Location Issues

When backing up to a shared network folder, the SQL Server service account may not have the required share and NTFS permissions.

How to Fix Cannot Open Backup Device Error in SQL Server

Let’s explore practical troubleshooting methods with examples.

Method 1: Verify the Backup Directory Exists

First, verify whether the backup directory exists on the SQL Server machine.

For example:

C:\SQLBackups\

If the directory does not exist, create it manually.

Then execute the backup command again:

BACKUP DATABASE EmployeeDB
TO DISK = 'C:\SQLBackups\EmployeeDB.bak'
WITH INIT, COMPRESSION;

Important: The backup path must exist on the SQL Server machine, not necessarily on the computer where SSMS is running.

Method 2: Grant Permissions to the SQL Server Service Account

This is one of the most common solutions for operating system error 5 (Access is denied).

Follow these steps:

  1. Open SQL Server Configuration Manager.
  2. Navigate to SQL Server Services.
  3. Identify the SQL Server Database Engine service.
  4. Check the service account under the Log On As column.
  5. Open the backup folder properties.
  6. Navigate to the Security tab.
  7. Add the SQL Server service account.
  8. Grant the required Modify or Write permissions.
  9. Apply the changes.

Now execute the backup command again.

Note: Grant only the permissions required for the backup operation. Avoid granting unnecessary Full Control access.

 

Method 3: Identify the SQL Server Service Account Using T-SQL

You can also identify the SQL Server service account by executing the following query:

SELECT
    servicename,
    service_account,
    status_desc
FROM sys.dm_server_services;

This query displays the SQL Server service name, service account, and service status.

Use the Database Engine service account when configuring backup folder permissions.

Method 4: Verify the Backup File Path

Check whether the backup path is correct.

Incorrect example:

BACKUP DATABASE EmployeeDB
TO DISK = 'D:\Backup\EmployeeDB.bak';

If the D:\Backup directory does not exist on the SQL Server machine, the backup operation will fail.

Correct the directory path or create the missing folder before executing the backup.

Method 5: Use a Different Backup Location

If the existing backup directory has permission or storage-related issues, try using another directory where the SQL Server service account has the required permissions.

Example:

BACKUP DATABASE EmployeeDB
TO DISK = 'C:\SQLBackups\EmployeeDB_Full.bak'
WITH INIT, COMPRESSION, STATS = 10;

The STATS option displays backup progress in percentage.

Method 6: Check Permissions for Network Backup Locations

If you are backing up a database to a shared network folder, verify the following:

  • The network path is accessible from the SQL Server machine.
  • The SQL Server service account has appropriate share permissions.
  • The SQL Server service account has appropriate NTFS permissions.
  • The network location is available during backup execution.

Example:

BACKUP DATABASE EmployeeDB
TO DISK = '\\FileServer\SQLBackups\EmployeeDB.bak'
WITH INIT, COMPRESSION;

Important: Use a UNC network path instead of a mapped network drive. Mapped drives created in an interactive Windows session may not be available to the SQL Server service.

Method 7: Check Whether the Backup File Is Read-Only

If the destination backup file already exists, verify whether it has the Read-only attribute.

You can check the file properties in Windows Explorer.

If the file is read-only, remove the attribute if appropriate and verify that the SQL Server service account has permission to modify the file.

Also check whether another process is locking the backup file.

 

How to Perform a Successful SQL Server Database Backup

After resolving the permission or path-related issue, execute the following command:

BACKUP DATABASE EmployeeDB
TO DISK = 'C:\SQLBackups\EmployeeDB_Full.bak'
WITH
    INIT,
    COMPRESSION,
    CHECKSUM,
    STATS = 10;

To verify the backup file, execute:

RESTORE VERIFYONLY
FROM DISK = 'C:\SQLBackups\EmployeeDB_Full.bak'
WITH CHECKSUM;

This checks whether the backup set is readable and complete according to SQL Server’s verification checks. However, it does not replace an actual test restore.

Difference Between Operating System Error 2 and Error 5

Understanding these errors helps DBAs identify the correct troubleshooting approach.

ErrorMeaningPossible Solution
Operating System Error 2The system cannot find the file specifiedVerify the file or directory path
Operating System Error 5Access is deniedGrant the required folder or file permissions
Operating System Error 3The system cannot find the path specifiedVerify that the complete directory path exists

Best Practices to Avoid SQL Server Backup Errors

Follow these practices to reduce backup-related failures:

  1. Create dedicated folders for database backups.
  2. Provide appropriate permissions to the SQL Server service account.
  3. Use valid local paths or UNC network paths.
  4. Monitor available disk space before performing backups.
  5. Schedule regular Full, Differential, and Transaction Log backups based on recovery requirements.
  6. Use backup compression to reduce storage consumption where appropriate.
  7. Execute RESTORE VERIFYONLY for backup verification.
  8. Perform periodic test restores to validate recovery procedures.
  9. Monitor SQL Server backup job failures through SQL Server Agent.
  10. Maintain backup copies in a separate storage location.

Frequently Asked Questions (FAQs)

1. Why am I getting Cannot Open Backup Device error in SQL Server?

This error generally occurs when SQL Server cannot access the specified backup file or folder because of insufficient permissions, an incorrect path, or a missing directory.

2. How do I fix Operating System Error 5 in SQL Server?

Grant the SQL Server Database Engine service account the required Write or Modify permissions on the backup folder.

3. Which account does SQL Server use to create database backups?

SQL Server uses the Database Engine service account to access the backup destination.

4. Can I take a SQL Server backup to a network location?

Yes. You can use a UNC network path, provided the SQL Server service account has the required network share and NTFS permissions.

5. How can I verify a SQL Server backup file?

Use the RESTORE VERIFYONLY command to check the backup set’s readability and completeness. Perform a test restore to validate actual recovery.

 

Conclusion

The “Cannot Open Backup Device” error in SQL Server is commonly caused by insufficient permissions, incorrect backup paths, missing directories, or network access restrictions.

By identifying the SQL Server Database Engine service account, verifying folder permissions, checking the backup path, and validating network access, DBAs can troubleshoot this issue effectively.

Understanding SQL Server backup and restore operations is an essential skill for every SQL Server Database Administrator.

At SQL School Training Institute, learn SQL Server Administration through practical demonstrations, real-time scenarios, database backup and recovery exercises, and hands-on DBA training.

Learn SQL Server DBA from Industry Expert Mr. Sai Phanindra (20+ Years of Experience) at SQL School!

🚀 100% Hands-On Training | Real-Time Projects | Expert Guidance

📞 Contact: +91 96664 40801 | +91 99514 40801

 

 

#SQLServer #SQLServerDBA #SQLServerBackup #BackupAndRestore #SQLServerErrors #CannotOpenBackupDevice #SQLErrorFix #DatabaseAdministration #SQLDBA #SQLServerTroubleshooting #DatabaseBackup #TSQL #MicrosoftSQLServer #SQLTraining #SQLSchool #SaiPhanindra