How to Fix SQL Server Error 3201 Cannot Open Backup Device
SQL Server error 3201 means SQL Server cannot open or create the backup file you named. SQL Server names the reason as an operating system error at the end of the message. Operating system error 5 (Access is denied) is the most common one and a folder permission fix solves it.
You see this message in SSMS during a BACKUP or a RESTORE. This guide explains the operating system errors, the checks that find the real cause and five fixes in the order you should try them.
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'D:\SQLBackups\LedgerDB.bak'. Operating system error 5(Access is denied.).
Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.
Quick SummarySQL Server error 3201 means SQL Server cannot open the backup device. Find the operating system error number in the message first. Error 5 needs folder access for the SQL Server service account. Errors 2 and 3 need a correct path. Network shares need a UNC path and share access. Errors 21, 23, 27 and 1117 point to a damaged device. Test the fix with a small backup.
What Does SQL Server Error 3201 Mean?
According to Microsoft, SQL Server error 3201 appears when SQL Server cannot create a new backup device or open an existing one. Backup devices include files, tapes and virtual devices.
Operating system errors point to the root cause. Error states add a hint. Microsoft explains that states 1 and 3 mean SQL Server failed to create the backup file and state 2 means it failed to open the file. Details sit on the MSSQLSERVER_3201 page.
| OS error | Meaning | Fix |
|---|---|---|
| 2 | The system cannot find the file specified | Correct the file name and path |
| 3 | The system cannot find the path specified | Create the folder or correct the path |
| 5 | Access is denied | Grant the service account access to the folder |
| 6 | The handle is invalid | Confirm the device exists and is online |
| 21, 23, 27, 1117 | Device not ready, data error, sector not found or I/O device error | Test and repair or replace the device |
What Causes Error 3201 in SQL Server?
- Missing folder permission. The account that starts SQL Server has no access to the backup folder. Your own login does not matter here.
- Wrong path. The folder does not exist or the file name has a typo. BACKUP creates the file but not the folder.
- Network share problem. The path points to a mapped letter like Z: or to a share that the service account cannot open.
- Damaged device. The disk or tape reports a data or sector error.
- Cloud credential problem. A backup to URL has no valid shared access signature token or managed identity.
Do You Know?According to Microsoft, SQL Server needs to open the file with the account that starts the SQL Server process. Microsoft states it is irrelevant whether the user who sends the BACKUP command has access.
How to Find the Cause Before Fixing SQL Server Error 3201?
Find the operating system error number at the end of the message and match it with the table above. Then find the account that starts SQL Server on your instance.
SELECT servicename, service_account
FROM sys.dm_server_services;
Note the account name in the service_account column. Method 1 grants that account access to the folder.
How to Fix SQL Server Error 3201?
Examples use the database LedgerDB and the folder D:\SQLBackups. Replace the names with your own values.
Method 1: Grant the Service Account Access to the Backup Folder
Use this method for operating system error 5. Microsoft advises granting the SQL Server startup account access to the backup device. Modify permission on the folder applies to both backups and restores.
- Right click the backup folder and select Properties.
- Open the Security tab and select Edit, then Add.
- Enter the service account from the query above and select OK.
- Tick Modify under Allow and select Apply.
Command Prompt does the same task in one line. Use NT Service\MSSQLSERVER for a default instance and NT Service\MSSQL$InstanceName for a named instance.
icacls "D:\SQLBackups" /grant "NT Service\MSSQLSERVER:(OI)(CI)M"
Method 2: Correct the Path or Create the Folder
Use this method for operating system errors 2 and 3. Confirm that the folder exists on the server and that the path in the BACKUP command matches it. Type the path again instead of pasting it from a document because hidden characters break the name.
BACKUP DATABASE LedgerDB
TO DISK = N'D:\SQLBackups\LedgerDB.bak'
WITH INIT, STATS = 10;
Paths belong to the server and not to your computer. D:\SQLBackups must exist on the machine that hosts SQL Server.
Method 3: Use a UNC Path for Network Shares
Mapped letters like Z: exist only in your own Windows session. According to Microsoft, SQL Server starts as a service in a separate session that has no relation to your login session.
Microsoft tells you to specify the fully qualified UNC name of the file. Either the service account or the computer account needs access to the share.
BACKUP DATABASE LedgerDB
TO DISK = N'\\BackupServer\SQLShare\LedgerDB.bak'
WITH INIT;
Method 4: Move the File When a Restore Fails
Restores fail with error 3201 when the backup file sits in a folder the service account cannot open. Files saved to Desktop or Downloads fall into this group because those folders belong to your user profile. Copy the file to D:\SQLBackups and restore from there.
RESTORE DATABASE LedgerDB
FROM DISK = N'D:\SQLBackups\LedgerDB.bak'
WITH RECOVERY, STATS = 10;
Method 5: Test the Device When the Error Shows a Hardware Code
Operating system errors 21, 23, 27 and 1117 point to a damaged device. Microsoft advises working with your system administrator to confirm the device is intact and to repair or replace a damaged one. Copy a test file to the volume and open it again. Move the backups to a healthy volume when the test fails.
Backup to URL needs a valid shared access signature token or a managed identity for the Azure resource. Create a new token when the old one expired.
Heads UpNever grant Full Control to Everyone on the backup folder. Grant Modify to the SQL Server service account only.
Which Errors Appear Together With Error 3201?
| Message | Cause | Fix |
|---|---|---|
| Msg 3013 BACKUP DATABASE is terminating abnormally | The backup stopped because of error 3201 | Fix the device error and execute BACKUP again |
| Msg 3041 BACKUP failed to complete the command | SQL Server logs this after any backup failure | Check the SQL Server error log for the first error |
| Msg 3202 Write on the device failed | The volume has no free space or reports a disk error | Free space or move the backup to another volume |
Databases that remain in RESTORING state after a successful restore need another step. Fix SQL Database Stuck in Restoring State explains it. Restores that open the file but stop with a database mismatch message have a different cause. Fix SQL Server Error 3154 covers that case.
Frequently Asked Questions
Does SQL Server Error 3201 Mean the Backup File Is Damaged?
No. Permissions and paths cause most cases. Damage shows only with operating system errors 21, 23, 27 or 1117.
Which Account Needs Access to the Backup Folder?
Your SQL Server service account needs access. Your own login does not matter because SQL Server opens the file and not you.
Does Operating System Error 5 Always Mean a Permission Problem?
Yes. Microsoft lists error 5 (Access is denied) under insufficient permissions. Grant the service account Modify access to the folder.
Can a Mapped Network Share Cause Error 3201?
Yes. SQL Server starts in its own session as a service and cannot see letters you mapped in your login session. Use a UNC path like \\BackupServer\SQLShare instead.
Can You Test the Fix Without a Large Backup?
Yes. Take a backup of a small database like model in the same folder. Success messages prove that SQL Server can open and create the file.
Does the Same Fix Work for a RESTORE Command?
Yes. Same error text appears when a restore cannot open the backup file. Grant the service account access to the folder or move the file.
Will the Backup Work After You Grant Permission?
Yes. Execute the BACKUP command again and check the success message. Confirm the file with RESTORE VERIFYONLY.
Final Words on SQL Server Error 3201
SQL Server error 3201 always points to a device problem and the operating system error names it. Match the number with the table and apply the fix for that number.
Test every new backup folder with a small backup before the scheduled backups need it.
Key Takeaways
- The operating system error number in the message names the cause.
- Error 5 needs Modify access for the SQL Server service account.
- Network shares need a UNC path and not a mapped letter.
- Test the folder with a small backup before you rely on it.
Next Read