error 5

Asked by Ronald Pritchard on 2012-03-07

When I try to write the image it say there is an error when trying to lock the volume error 5 access denied

Question information

English Edit question
Image Writer Edit question
No assignee Edit question
Last query:
Last reply:
Jeff B (skydiver38) said : #1

What version of image writer?

What are you writing to?

sounds like something else is already accessing the drive while you're attempting to write to it.

Paul Dunbar (merlin-6) said : #2

I'm seeing the same problem on my windows 7 professional dell latitude e6500. Encountered on freshly-formatted SD card in the laptop's SD slot with app run as administrator.

Jeff B (skydiver38) said : #3

Is this consistant? Does changing the card help?

Paul Dunbar (merlin-6) said : #4

This happens every time with all versions. I've verified that no files on the card are open using process explorer (have also rebooted). Changing cards had no effect.

This happens when reading and writing.

Frank Smith (franks-h) said : #5

I concur with all the above comments.
No matter what I try, fresh boots, newly formatted chips.... all produce Error 5

Jeff B (skydiver38) said : #6

I really don't know how to proceed with this. I can't reproduce, so I can't narrow down the problem.

I'm open to suggestions.

Paul Dunbar (merlin-6) said : #7

I'm willing to run a custom version of the application which captures any kind of event/environment info that you may find useful.

Matt (hkmatt) said : #8

Close the explorer window of the drive you want to write the image to. That worked for me.

Jeff B (skydiver38) said : #9

Paul - somehow I missed your response. That might be a possibility. Let me know if Matt's latest response helps you.

Matt - well, yes. ImageWriter can't lock the device while other programs (IE: Windows Explorer) are accessing it. That's what I suspected when I mentioned it in my comment on 3/7. Hopefully that will help someone having this problem....

Paul Dunbar (merlin-6) said : #10

I can confirm that the application reads my SD card when the explorer window for that drive is closed. You might want to consider this a UI issue, especially considering the fact that in many environments the default action upon card insertion is to open a new explorer window for the drive.

I'd like to offer a small piece of respectful advice:

It might be worth it to handle this exception with a more informative error dialog.
Also it may be good to close any explorer processes with open file handles on the selected drive before attempting to lock the drive.

Jeff B (skydiver38) said : #11

Paul - thanks for the suggestions. I'm glad that the suggestion worked for you.

I'm not sure that one app (ImageWriter) can close another app's (Windows Explorer) open windows. Even if it can, I'm not sure how to tell which window is focused on the device that we're trying to lock, so that we could tell which precise ones to close. I'm sure Tobin would be happy to accept a patch that displays this behavior, however.

A more informative error message may be a possibility. We do have messages that include the hint: "This usually means something is currently accessing the device; please close all applications and try again." Whether we have them in all the applicable places though, is something that I'll look at.

Personally, I don't consider it an ImageWriter UI issue. Perhaps a "Windows" UI issue, but that's out of our hands. It's fine that people configure their default behavior to open an explorer window - I also think it's fine to expect them to close that window if they want to use the device with ImageWriter.

Jeff B (skydiver38) said : #12

Close any application that is accessing the device (including "windows explorer") prior to attempting to write to that device.

Jeff B (skydiver38) said : #13

Different error number, but seemingly same issue.

Jeff B suggests this article as an answer to your question:
FAQ #1928: “Error 21 - The device is not ready.”.

Steve Lee (tigerucla) said : #14

I'm having the same problem using version 0.5:

<An error occurred when attempting to get a handle on the device.
Error 5: Access is denied.>

Windows 7 32 bit, freshly formatted 4GB flash drive not open in Windows Explorer, no other programs accessing the drive.

Any suggestions?

Jeff B (skydiver38) said : #15

If nothing is accessing the drive, it sounds like a permissions problem - are you using an administrator acct?

Steve Lee (tigerucla) said : #16

I am not, but I will try it using an admin acct.

I'm not sure why that would make a difference since I have never had an issue accessing the drive for any other purpose. I've used it without problem to transfer files since I posted on Friday. But I will give it a try!

Scott Flowers (flowerss) said : #17

The reason you need to use an admin account is because you are not overwriting files, you are overwriting the filesystem (like formatting the drive). Normal users in Windows 7 don't have the permissions necessary to overwrite a filesystem. Right-clicking on the application and running it as an admin account works.

Don Easton (don-easton) said : #18


This is an older post, but the issue still exists. I was able to get around it by running the app from the command line, using the path to the IMG file as a parameter.

Make sure to run CMD as an admin.

Zaggan (ganso-orco) said : #19

Here is the best solution i could find, you just download Process Explorer software click on find, then find handle, then you type the devise adress, example E:\ , you are going to be able to see the programs that are using the device, you just click CTRL+ALT+SUPR and close it manually, hope solves it for everyone!!! PD hope my english is not that bad, im mexican!!!

David Thorp (db-thorp) said : #20

For feedback Zaggan's tip at #19 sorted my error 5/access denied problem.
Another program (Realplayer downloader) was using the USB. Killing that process and then running as administrator allowed the img write to start.
Many thanks

P-L Guidez (guidez-pl) said : #21

I solved this problem by closing defraggler. Such a simple fix

It's easy to reproduce. Run the subst command. Access a program in the subst location, run win32 disk imager.

Tobin Davis (gruemaster) said : #23

Ben, thanks for this tip. Can you open a bug and include detailed steps to reproduce this?

Hate to say it, but I have been extremely busy since v0.7 released, both at work and at home. I hope to push a v0.8 in May with as many bug fixes I can get in.

Rolf Blijleven (rbli63) said : #24

I had the same error 5 and none of the above resolved it.
What did resolve it was to do a quick format with SD formatter 4 from here:

After that, Image Writer proceeded without errors.

The solution I found on the Raspberry Pi forum. (I'm burning an image for my Pi).

Can you help with this problem?

Provide an answer of your own, or ask Ronald Pritchard for more information if necessary.

To post a message you must log in.