Normally, this would be the cause of "locked" SD cards, use the adapter that accompanied the SD card when you bought it, it has a lock switch on the side, insert the sd card, then slide the lock switch from LOCK to UNLOCK, then try the pluging your SD card again and see if it works.
I've reset the lock slider (locked and unlocked a couple of times), removed and re-connected my card reader on 2 different USB ports (not on a hub). I have full access to the card and have formatted, read and written to it after each change to confirm that's not an issue. I've tried a couple of images from and get the "Access denied error 5" each time. The only thing I've not been able to test is with a different memory card.
Ran into this, you are likely on Vista or Windows 7. The issue is that you need to run Win32 Disk Imager "As Administrator" when you starting it. Raw writing to a block device is an admin function so trying to run the program as a limited user will cause this error.
"Run as administrator" (which I am already) doesn't help with the Lock Error 5 on my Win 7. For writing the diskpart utility can be used to clean it and that releases whatever lock the OS has on it but I can find no way to read it without the Error 5. Help!
Hi, Don't know if you're still having this problem but I found that my music player (MusicBee, but I would assume others such as winamp and Foobar2000 will do the same) had locked my card as it wanted to sync music to it. I stopped it from trying and the image wrote fine.
Indeed a quick scan from google indicate that the API changed with Vista forward. Since we still build with MinGW API (XP and earlier), this is probably where our problem lies and will hopefully be resolved when we can update our build environment to a newer opensource API (mingw64?).
Thought I'd share I ran into the same issue tonight and had no luck working through the error. I run a program called 'Unlocker' which will tell me the programs that are keeping my files locked. It initially found some random software locking my SD card but even after I unlocked it 'Error 5' persisted.
In the end I moved my work from my desktop to laptop which is also running Win7 Home Premium 64 bit. The Image Writer software worked perfectly on my laptop. Oddly enough I just installed a new HDD in it about a month ago and I've been working through all the OS updates. So I just confirmed its fully up to date with all the pending updates and it didn't experience an issue.
I've had this problem. I now have about 5 SD cards that I use with my RPi, none allow me to read using win32 disk imager. I've tried running as administrator, even running in safe mode. Doesn't work. I then tried a new card, straight out of the packaging. This worked fine, no error 5. However, I then wrote Raspbian onto the SD and installed it in the Pi. Later, I then tried reading it again - and then I got Error 5 again....
Found a steady way to simulate/duplicate this problem on Windows 7 desktop.
I put a Windows 7/Embeded OS into a 4G or 8G CF card (I also tried CFast, the same;probably SD card will also be similar via SATA-SD converter)'s NTFS partitions(s).
Then if I use a USB2->SATA converter and then a SATA->CF converter, to read and write a gain, write is always failed half way. (Windows 7 detect the card as hard disk drive)
My theory is
1. I sense that MS Windows 7 is constantly meddling with NTFS hard disk drive, even if there is no explorer window/instance open.
2. much less meddling if it's NTFS partition on removable media (but not hard disk, as detected by OS)
3. maybe current way of identify card by drive letter list is a bad idea (must have a letter assigned, but once doing so, windows 7 start to fool around with the card's NTFS journals non-stop; but we totally can strip off the assigned letter by "Manage" tool from "My Computer" right click menu)
4. there was a WinXP tool before called "SelfImage", which uses disk ID and partition ID to identify the drive and partition, which means we totally can just take away assigned the drive letter, but shield off Windows from meddling with card, even via interfacing SATA converter tool in between (man! SATA Cfast converter HW are way much cheaper than USB Cfast reader!) . Can we have something similar to the "SelfImage" way?
Just some points missed out during my previous submit:
(Point 3. more:) Even if it's detected as hard disk (via SATA converter), if there is no letter assigned, Windows 7 seems to refrain from touching the NTFS partitions. Maybe an easy way to simulate is just to use a USB2->2.5" notebook SATA drive, but the content in the SATA drive has a windows 7 on it. Try to backup/read and restore/write on a different PC/desktop, using Win Imager32.
I formated the USB memory stick and the format application informed me that the USB stick was used by another application and if I wanted to continue. I confirmed to continue and once the formating was complete I tried again using the Disk imager and it worked. That is how it worked for me with Error 5!
The Process Explorer tool from www.sysinternals.com has an option under "Find / Find Handle or DLL".
Then enter the drive letter (in my case it was i:) and it will show all processes with your SD drive open.
In my case it was process recordingmanager.exe from Real Networks.
Kill the processes and the write will go smoothly.
There is one easy way around this.
1. Format the USB/Media device using the windows format tool in explorer.
2. Then copy the image to the media.
If any processes are using the partition the format tool will close them after prompting.
I had to use CMD and DISKPART to format the drive, after which I was able to write the image to the HDD. You just need to follow the CMD steps in this video =hmKKKfBYsmU Basically I made my external HDD bootable.
Possible solution, apologies if this is a repeat: I had the same Access Denied Error 5 message when trying to burn to a 16GB USB drive . When I gave up and tried to eject my USB, windows claimed it was in use by another program.
The first few sectors written to the the device are likely to contain the partition information. Apps, either OS or 3rd party, scanning for drives for whatever reason are able to read that as soon as it is written so they try to get an handle on the partition / device, effectively blocking the writing process.
Skip the first chunk of data (first 1024 sectors?) and write everything else. This will be meaningless data to the OS. Finally, after the write loop is done, go back and write the first chunk of data.
I cannot get Disk Imager to read from an micro SD card. I get the following error:
Lock Error: An error occurred when attempting to lock the volume. Error 5: Access is denied.
There are no programs using the micro SD card and no windows open which I believe are using the img file.
I have tried rebooting the computer and the SD card adaptor is unlocked.
I have also tried several card readers and different cards both SD and micro SD.
Could you provide a little more information? This sounds like you don't have admin priviledges or something. I have not been able to reproduce these occasional errors that users report, but having admin access usually solves the problem.
Hi,
I am running as admin and I even use the "Run as Administrator" option.
I have tried several SD cards of various flavours, changed the lock position just in case. I have tried internal and external card readers.
Nothing at the link helped. I discovered another reader in a box and tried out of desperation - it worked. There were no problems reading the SD card.
It seems after four card readers only one seems to work!! Not sure what it is about them which stops them working though???
That is indeed very odd. I wish I could point to a utility that you could run that would give me more info to see if I can figure it out. I really hate having to shrug and move on, simply because I don't have enough information to go on.
well the problem is simple and a easy way to fix it, when format the device, just leave all to default? don't use NTFS, if possible restore all to default in format Window, after that, check device and try format now in FAT32 is default, and is all, you don't got any error and write going very well, have fun.
In case anyone else encounters this issue, as I did, this is what solved it for me:
After receiving the "access denied" message, I removed the SD card WITHOUT closing Win32 Disk Imager, and then re-inserted it again. Win32 Disk Imager recognized the SD again once inserted and then I pressed the "Read" button. This time I didn't receive the "access denied" message and the contents of the SD card was read into the file I specified at the beginning of the whole process.
Just wanted to share,
Good Luck!
Ditto thanks @Shtutnik. Using a USB, I had the same error, reboot, no difference. Removed the USB and reinserted it while Win32 Disk Imager was running, and Win32 Disk Imager couldn't find E: drive. BUT... closed and restarted Win32 Disk Imager et voila! Works!
I'll try to look at this more closely next time I can free up development time. I believe Windows Explorer or some other process is latching on to the device and not allowing exclusive access to Win32DiskImager. Probably some function call I need to make to take control of the device.
Hi, I encountered the same problem of reading error for imaging an sd card, I've tried to remove and reinsert the sd card while win32diskimager running or not but no success. Finally I have to kill the explorer process in task manager to unlock the reading on my sd card.
Hi, same problem. Windows 10, using Process Explorer to find out which process was using E:, terminated that in Task Manager, still error 5 running win32Diskimager as Administrator. This was on the built-in SD-card reader on my laptop. Then I tried the SD-card via a USB-adapter, same drive letter, and it worked. Go figure.
Hi mate, would you be willing to test, if the same error appears in my software - Link ? It provides the same functionality as Win32 DI, but it's more modern and has some extra features. I'm curious, if it's going to work or not. I'm also willing to fix that error, if it appears.
e59dfda104