Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

SQL Server backup error 3201: cannot open backup device (operating system error 5, 3, 64 or 112)

Technical article
Backup & Recovery

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

Error 3201 means the SQL Server engine could not create or open the file (or other device) that the backup was meant to write to. The message carries an operating system error number, and that number decides the cause: on Microsoft's own list, error 5 is "Access is denied" and error 3 is "The system cannot find the path specified". The first thing to check is the account the SQL Server service runs as, not the person who typed the BACKUP command.

What the error means

Microsoft documents MSSQLSERVER_3201 (page metadata date 2022-08-15; applies to SQL Server 2017 to 2025) with the message text Cannot open backup device '%ls'. Operating system error %ls. It is raised when SQL Server "isn't able to create a new or open an existing backup device to perform a backup operation". The device can be a file, a tape or a virtual device, and the operating system error "provides key information to help you understand the root cause".

The error state narrows it further. Per the same page, states 1 and 3 mean the engine failed creating the backup file, state 2 means it failed opening one, and states 5 to 8 relate to tape and virtual devices. A failed BACKUP statement usually also reports error 3013, whose message template in Microsoft's error list for the 3000 range is "%hs is terminating abnormally." That second message is the consequence. The 3201 line is the cause.

The key mechanic is whose permissions apply. The BACKUP reference (page metadata date 2026-03-02) says ownership and permission problems on the backup device's physical file can interfere with a backup, and that the SQL Server startup account needs read and write permission on the backup device and the folder the files are written to. The Backup Devices page adds that, for a network share, "as long as the Sqlservr.exe process that is writing the backup has access, it is irrelevant whether the user sending the BACKUP command has access". Your own login being able to browse the folder proves nothing.

Network shares add a second rule. The same page says that when SQL Server runs as a service it runs in a separate session with no relation to your login session, so drive letters you mapped are normally not visible to it. Use the full UNC name, which has the form \\Systemname\ShareName\Path\FileName.

Which identity reaches the share depends on the service account. The service accounts page (page metadata date 2025-10-14) states that services running as virtual accounts, and as Network Service, access network resources using the computer account in the form <domain_name>\<computer_name>$. A domain user account is used when the service runs as one. A service running as Local Service reaches the network as a null session without credentials.

Likely causes

Cause What you see How to confirm
Service account lacks write permission on the target folder (OS error 5) Operating system error 5; state 1 or 3 when creating a new file Find the service account, then check that account's rights on the folder
Folder or file does not exist, or the path is mistyped (OS errors 3, 2) Operating system error 3 (path) or 2 (file) Browse the exact path as the engine sees it, from the SQL Server host
Share not reachable, or the share grants rights to the wrong identity (OS error 5, 53, 67, 64) Works from your session, fails for the Agent job or scheduled task Check the account the engine uses on the network (computer account or domain account) and the share name
Network name dropped during the write (OS error 64) Starts, then fails; intermittent Look for network resets or share-server restarts at the same time
Target volume full (OS error 112) Operating system error 112 Check free space on the target volume against the backup size
Mapped drive letter used in a job (typically OS error 3) Works in SSMS with your session, fails as a job Look for DISK = 'Z:\...' in the job step
Damaged or unreadable device (OS errors 1117, 21, 23, 27) I/O style errors, not path or permission errors Test whether any file can be written to and read from the device

The names behind the operating system numbers come from Microsoft's Win32 error list (MS-ERREF, date not shown): 3 is ERROR_PATH_NOT_FOUND, 5 is ERROR_ACCESS_DENIED, 64 is ERROR_NETNAME_DELETED ("The specified network name is no longer available."), 112 is ERROR_DISK_FULL ("There is not enough space on the disk."), 53 is ERROR_BAD_NETPATH and 67 is ERROR_BAD_NET_NAME. Microsoft's 3201 page itself lists errors 2, 3, 5, 6, 21, 23, 27 and 1117. It does not name 64 or 112; for those two, the meaning is the Win32 error name above. The 3201 page also lists error 1117 under both "insufficient permissions" and "damaged or corrupt device", so treat 1117 as ambiguous and test the device.

Prove the cause before changing anything

These commands and checks follow the Microsoft documentation named beside them. They have not been run or lab-tested. All of the first group are read-only.

  1. Read the exact operating system error and the state from the SQL Server error log or the job history. Do not guess from the number of the 3201 message alone.

  2. Find the account the engine runs as. The sys.dm_server_services view (page metadata date 2024-09-12) returns servicename, status_desc and service_account. On SQL Server 2019 and earlier it needs VIEW SERVER STATE, and on 2022 and later VIEW SERVER SECURITY STATE:

SELECT servicename, service_account, status_desc
FROM sys.dm_server_services;

Note that Microsoft describes service_account as "the account authorized to control the service". It is the service logon account. Confirm it against the Services console or SQL Server Configuration Manager if the value looks unexpected.

  1. Confirm the path exists as that account would see it. The 3201 page suggests navigating to the location and confirming the file or folder is present. Do this on the SQL Server host, with the UNC path rather than a drive letter.

  2. For a share, check that the identity from the service accounts page (the computer account DOMAIN\SQL01$ for virtual accounts and Network Service, or the domain account) has access to the share and write permission to the folder. The Backup Devices page says the service account must have the permissions needed to write to the share for backup and to read from it for restore.

  3. Check free space on the target volume. Per Backup Devices, "if a disk file fills while a backup operation is appending a backup to the media set, the backup operation fails", and "the maximum size of a backup file is determined by the free disk space available on the disk device".

  4. Look at the failing statement or job step for a relative path. Backup Devices says a file name or relative path puts the file in the instance's default backup directory, and recommends the full path in every DISK clause in scripts.

A test write confirms permissions without touching the real job. Use a small, non-critical database and a copy-only backup, which per the BACKUP page "creates a full backup that can't serve as a differential base". The syntax shape is from the BACKUP and Backup Devices pages:

BACKUP DATABASE [SmallTestDb]
TO DISK = N'\\FS01\SQLBackups\permission-test.bak'
WITH COPY_ONLY;

Delete the test file afterwards. Do not use the NUL device as a substitute. The BACKUP page says it "discards all information sent to it and should only be used for testing", and that "the backup still marks all pages as backed up". A permissions test must write a real file.

Fix

Make one change at a time and repeat the test write after each.

Operating system error 5 (access denied). Grant the account from step 2 read and write on the backup folder, or on the share and the folder beneath it. For a domain environment where the service runs as a virtual account or Network Service, grant the computer account. Microsoft's own wording for the permission is that the "SQL Server startup account needs to have read and write permissions to the backup device and the folder where the backup files are written to". Changing the service account itself is a restart-level change and should be planned. Microsoft notes the startup account is also granted rights by Setup on its own folders, for example Full control on Instid\MSSQL\backup and Instid\MSSQL\data.

Operating system error 3 or 2 (path or file not found). Create the missing folder or correct the path. If the path is a mapped drive, replace it with the UNC name. Do not rely on a mapped drive for a service.

Operating system error 64, 53 or 67 (network). Check the share server name, the share name and the network path from the SQL Server host. Microsoft advises that backing up over a network "can be subject to network errors" and recommends verifying the backup after it finishes with RESTORE VERIFYONLY. Consider writing locally and copying afterwards if the network link is unreliable.

Operating system error 112 (disk full). Free space or point the job at a larger volume. Deleting old backups is destructive. Before removing any file confirm that a newer backup exists and that you have restored from it. Do not add FORMAT to the BACKUP statement to push past an error. The BACKUP page says FORMAT "causes the backup operation to write a new media header on all media volumes" and "the existing contents of the volume become invalid", which can destroy an entire existing media set.

Logical backup devices. Per the BACKUP page, sp_addumpdevice "doesn't check file access permissions", so a logical device can look healthy until the first backup tries to use it.

Confirm the fix

Re-run the original backup, not only the test file, as the same Agent job or scheduled task that failed. Then check that the file exists on the target, that its size is plausible, and that the next scheduled run also succeeds. A backup that completes only proves the file was written. Proving it can be restored is a separate step: run a verify and, for important databases, a real restore to a scratch server.

Example (illustrative). The server SQL01 runs the database engine as NT SERVICE\MSSQLSERVER. A nightly Agent job writes to \\FS01\SQLBackups\Sales_full.bak. The job fails at 01:00 with Cannot open backup device '\\FS01\SQLBackups\Sales_full.bak'. Operating system error 5 (Access is denied.), state 1, while an administrator can write to the share from their own session. Following the checks above, the administrator finds the share grants rights only to the administrator group. Granting CONTOSO\SQL01$ write access fixes the job.

What to watch afterwards

  • Alert on any job failure containing 3201 or 3013, and record the operating system error number in the alert text, so the cause is visible without opening the log.
  • Recheck share and folder permissions whenever the SQL Server service account, the file server or the domain changes.
  • Track free space on the backup volume. A growing database makes a previously adequate volume fail months later.
  • Keep UNC paths in every DISK clause, and keep backups on a different disk from the data and log files. Microsoft recommends a different disk so the backups survive if the data or log disk fails.

Risks and limits

  • These commands have not been run or lab-tested. Test them on a non-production instance first.
  • This article covers Windows-hosted SQL Server instances. SQL Server on Linux, backup to URL and tape devices have different permission and error behaviour.
  • Microsoft's 3201 page does not list operating system errors 64 and 112. Their causes here follow from the Win32 error names and from the Backup Devices page, which says a full disk fails a backup.
  • Which identity reaches a network share depends on how the service is configured. Check the account on your own instance before changing share permissions.
  • Third-party backup agents that use the virtual device interface can raise 3201 from states 6 and 7. That path is out of scope.

Sources