Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open backup device. Operating System error 5

People also ask

How do I fix OS error 5 access is denied?

To fix, I did the following: Added the Administrators Group to the file security permissions with full control for the Data file (S:) and the Log File (T:). Attached the database and it works fine. Also, it may help to start SQL Server Management Studio as Admin, not just the server service.

Is incorrectly formed SQL Server Cannot process this media family restore Headeronly is terminating abnormally Microsoft SQL Server Error 3241?

And, get an error message that reads: 'Restore HEADERONLY is terminating abnormally, Microsoft SQL Server error 3241'. It happens when the backup you're trying to restore is corrupt. In that case, check if you have any other backup copy you can use to restore the database or create a new backup set.


Yeah I just scored this one.

Look in Windows Services. Start > Administration > Services

Find the Service in the list called: SQL Server (MSSQLSERVER) look for the "Log On As" column (need to add it if it doesn't exist in the list).

This is the account you need to give permissions to the directory, right click in explorer > properties > Shares (And Security)

NOTE: Remember to give permissions to the actual directory AND to the share if you are going across the network.

Apply and wait for the permissions to propogate, try the backup again.

NOTE 2: if you are backing up across the network and your SQL is running as "Local Service" then you are in trouble ... you can try assigning permissions or it may be easier to backup locally and xcopy across outside of SQL Server (an hour later).

NOTE 3: If you're running as network service then SOMETIMES the remote machine will not recognize the network serivce on your SQL Server. If this is the case you need to add permissions for the actual computer itself eg. MyServer$.


Go to the SQL server folder in start menu and click configuration tools Select SQL Server configuration manager On SQL server services, on the desired instance change the (Log On as) to local system


The SQL Server service account does not have permissions to write to the folder C:\Users\Kimpoy\Desktop\Backup\


I had this issue recently as well, however I was running the backup job from server A but the database being backed up was on server B to a file share on server C. When the agent on server A tells server B to run a backup t-sql command, its actually the service account that sql is running under on SERVER B that attempts to write the backup to server C.

Just remember, its the service account of the sql server performing the actual BACKUP DATABASE command is what needs privileges on the file system, not the agent.


I face the same problem with SQL Express 2014 SP1 on Windows 10.

Solution which work

  1. Open Service by typing Services
  2. Locate and open the SQL Server (SQLExpress)
  3. Go to the LogOn Tab
  4. Choose Local System Account ( Also Check for Allow Services to interact with desktop )
  5. Click OK . Stop the service . Restart the service.
  6. Problem solved

In order to find out which user you need to give permission to do the restore process, you can follow the following steps:

You need to go to your server where SQL Server is installed. Find SQL Server Configuration Manager

enter image description here

Next, you need to go to "SQL Server Services"

enter image description here

Under your SQL Server (MSSQLSERVER) instance there will be an account with column "Logon As", in my case it is NT Service\MSSQLSERVER.

That is the account which you need to add under Security tab of your source .bak location and give that user the "Read" permissions so that the backup file can be read.

Let's say your backup file is present at "D:\Shared" folder, then you need to give permissions like this:

enter image description here


One of the reason why this happens is you are running your MSSQLSERVER Service not using a local system. To fix this issue, use the following steps.

  1. Open run using Windows + R
  2. Type services.msc and a services dialog will open
  3. Find SQL Server (MSSQLSERVER)
  4. Right click and click on properties.
  5. Go to Log on tab
  6. Select Local System account and click on "Apply" and "OK"
  7. Click on Stop link on the left panel by selecting the "SQL Server (MSSQLSERVER)" and Start it again once completely stopped.
  8. Enjoy your backup.

Hope it helps you well, as it did to me. Cheers!