Fixed: Access Denied under Windows 7 on flash drive

Bug reports concerning HxD.
Post Reply
tripley
Posts: 1
Joined: 24 Nov 2010 12:54

Fixed: Access Denied under Windows 7 on flash drive

Post by tripley »

Hi.
I have a system running WindowsXP or Windows 7. When running under XP I can take an image of a working compact flash as a physical disk and write it to a new compact flash without any problem. This is right from sector 0 to include the MBR.
If I run under 7, start HxD (Right click and enable Administrator), I can write anywhere up as far as sector 63 but writes to sector 64 and above give an Access Denied message. This is the same for FAT16, FAT32 and NTFS formatted drives. The 'border' seems to move depending on the flash size. 512MB and above is Sector 64, 256MB and 16MB is sector 32.
I can write to anywhere on the IDE drive that I am booting from.

My motherboard has an on board compact flash socket and I also have a USB to Compact flash adapter. Both work / fail in the same way. I have also used a USB memory stick and this has the same problem.

Any ideas ?

HxD Version 1.7.7.0
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Access Denied under Windows 7 on flash drive

Post by Maël »

Since Vista drives are protected from editing if they aren't unmouted before. That is you can only edit the sectors which aren't part of the filesystem, such as the MBR for example.
HxD will do the unmounting/locking automatically in future. But the boot/system drive can never be unmounted/locked.

See also http://forum.mh-nexus.de/viewtopic.php?f=3&t=193 for more details.
nickpelling
Posts: 2
Joined: 06 Dec 2010 16:21

Re: Access Denied under Windows 7 on flash drive

Post by nickpelling »

Hi Maël,

Much like tripley, I'm trying to use HxD to write raw data to a 2GB MicroSD card under Windows 7 - specifically, I'm trying to write ~8K to the card starting from sector #3854318. I'm first unmounting the logical drive (h:) [as you suggested in the other thread], but am still getting "Access denied" error messages when I try to File-->Save the data to the card.

I'm able to copy files to the card while its logical volume is mounted, so there's no obvious reason why this should fail. Short of reverting to Windows XP :-) , is there anything else I should be trying ? Any suggestions would be much appreciated!

Thanks, ....Nick Pelling....
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Access Denied under Windows 7 on flash drive

Post by Maël »

I don't have any other suggestion currently than mentioned above and in the link, I am afraid.

Maybe there is another program that can do what you want until HxD will be enhanced.
nickpelling
Posts: 2
Joined: 06 Dec 2010 16:21

Re: Access Denied under Windows 7 on flash drive

Post by nickpelling »

Hi Maël,

Problem (eventually) solved - I was unable to write sectors to the SD card while the adaptor was plugged into a USB hub, but the minute I plugged it directly into a USB port, it worked first time. D'oh! :D

Best regards, ....Nick Pelling....
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Access Denied under Windows 7 on flash drive

Post by Maël »

Nick, thanks for reporting back on the solution. It's bit puzzling why it makes a difference having it plugged into a USB-hub vs. a USB-port.
Giventofly08
Posts: 2
Joined: 06 Jan 2011 03:32

Re: Access Denied under Windows 7 on flash drive

Post by Giventofly08 »

Hey Mael, great tool so far from what I've used; much more robust than others that are offered for free.

You may have answered this (but from what I can tell not quite to my specifications).

I am receiving the same problem as others have said; only I am attempting to use HxD directly to another hard drive (not the boot drive). It's essentially an external hard drive that I am trying to tinker with for a project I'm working on for my University. I'm presently using an IDE to USB converter (which doesn't seem to be the issue). I can add files through the windows explorer, but not in the hex values from HxD.

I have unmounted the drive and using HxD anything after sector 62 (sector 63 starts the boot partition) it reads as access denied when I try to save anything. I was wondering if you might have any suggestions? I am running Windows 7 at the moment, and am making sure to be set as the admin. Is the problem mainly in Windows Vista/7, meaning if I switch to Windows XP there should be no problems like this and I can edit the disk using HxD with no complications? Any insight you could provide would be greatly appreciated.
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Access Denied under Windows 7 on flash drive

Post by Maël »

Hi Giventofly08,

If the unmounting doesn't help then it's probably because the drive also needs to be locked, which can only be done by HxD internally (i.e. the program that will write to the disk has to be the one that locks the drive and therefore and external tool will not suffice). That means you'll have to use Windows XP until it's implemented in HxD.

Note that unmounting means you cannot edit logical drives under Windows Vista/7 currently and you have to edit physical drives instead. Now, when you want to edit a physical drive you have to make sure that all logical drives are unmounted before you can edit the physical drive.
If you did that and it still doesn't work then what I wrote above applies (i.e. use Windows XP).

Hope this helps.
Giventofly08
Posts: 2
Joined: 06 Jan 2011 03:32

Re: Access Denied under Windows 7 on flash drive

Post by Giventofly08 »

Okay, thank you for the good explanation. I will take your advice and acquire a XP system for further use on my research. Thanks again!
Peter
Posts: 1
Joined: 19 Feb 2011 14:25

Re: Access Denied under Windows 7 on flash drive

Post by Peter »

Giventofly08 wrote:Okay, thank you for the good explanation. I will take your advice and acquire a XP system for further use on my research. Thanks again!

Hi,

Is the problem already solved, or am I missing something?

In my case, I can't write the the SD Micro Flash, not directly, nor through the adapters (SD -> USB) and not through any of the hubs. I tried unmounting (from the Command Processor, run as an Administrator). No effect. Windows 7 does not give up.

Everything is OK. when I am using my LapTop XP. This Windows 7 is the problem.

Thanks to the Author for the nice program. A clean interface and a number of very useful alternatives (for the programmers) and the fast display response makes it nice to work with. A couple of suggestios, however:

1. While doing what you have to do, when opening the filesystem and/or the disk, you have to figure out the "parameters". Why not making these "parameters" available to the user? I mean, the Partition Table (basics), MBR location, FAT location, DIR area location, etc. At least for the single partition FAT -based file systems. How the whole filesys is located on the physical media ... A separate Quick Info Display for this stuff. Well ... I know it's hard, because there are so many alternatives.

2. A Quick Backup/Restore Button would be nice. Backing/Restoring up/down the whole contents, all *physical* sectors, one-to-one, into/from the Image File. There are not too many programs to do this thing in an easy way.

OK, this was an Enhancement Request, but anyways ... :o) ...

Peter
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Access Denied under Windows 7 on flash drive

Post by Maël »

Peter wrote:In my case, I can't write the the SD Micro Flash, not directly, nor through the adapters (SD -> USB) and not through any of the hubs. I tried unmounting (from the Command Processor, run as an Administrator). No effect. Windows 7 does not give up.
Everything is OK. when I am using my LapTop XP. This Windows 7 is the problem.
Exactly. It works under Windows XP, but not Windows Vista and up. The new version that fixes this isn't out yet.
Peter wrote:A couple of suggestios, however:
Please create a new thread for each request so that so commenting and closing them when they are implemented is possible. Also that avoids having duplicate requests spread across several threads, otherwise it's hard to keep an overview.
PetkoP
Posts: 1
Joined: 11 May 2014 06:59

Re: Access Denied under Windows 7 on flash drive

Post by PetkoP »

There is a workaround for this problem. Not very "safe" but working :)
You need first to break the MBR - for exapmle by writing 0x00 in the Type Code of the partition (http://www.pjrc.com/tech/8051/ide/fat32.html).
This should be possible according to the Microsoft's description (http://msdn.microsoft.com/en-us/library ... 85%29.aspx) and it worked for me (FAT32 formatted 64GB SD Card).
Then you "Eject" the drive and re-insert it.
Windows won't recognize a filesystem and won't deny any writes!
Now you can do your bad deeds and at the end restore the MBR.
After one more "Eject" and re-insert my SD Card was recognized again as FAT32 and I had my raw changes applied.
Jonas_Wilde
Posts: 1
Joined: 26 Sep 2015 05:57

Re: Access Denied under Windows 7 on flash drive

Post by Jonas_Wilde »

This is an old thread but I had the same problem and found a solution that worked for me. I run HxD using "run as administrator" and there was no more write problems. I also had to reboot my Windows 7 system before run as administrator worked but once solved it did not reappear.

HxD is an AWESOME tool. Thank you for it!
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Access Denied under Windows 7 on flash drive

Post by Maël »

HxD 2.0 RC implements automatic unmounting and write locking of disks if possible, which should solve most of the access denied problems transparently.
You do not need to do anything special, simply edit a drive and save.

As mentioned earlier in this thread, since Windows Vista hard disk access is enforced in a more strict way, so it is impossible to fix this in general.
But especially for removable disks/thumb drives, it should work in many cases now.
If access still is denied, using a boot cd/DVD or a preinstall environment like WinPE will allow HxD to edit any disk, since those environments do not hinder any writes.

So, if you had problems like this in the past, try out HxD 2.0 RC.
https://mh-nexus.de/downloads/HxDSetup.zip
Post Reply