Unable to lock disk for exclusive use - Access is denied

Post here if you encounter any problems or bugs with the software.
bugman
Posts: 2
Joined: 2015.09.15. 17:20

Unable to lock disk for exclusive use - Access is denied

Post by bugman »

Just purchased HD Sentinel Pro, trying to run a read+WRITE+read test on a drive, getting this error:

"Unable to lock disk for exclusive use. Error: 5 Access is denied"

Disk is a Western Digital 1T disk with 2 basic NTFS partitions, one houses all my DATA, the other stores BACKUPS.

Operating system is NOT on this disk.

Please help!!

bugman
User avatar
hdsentinel
Site Admin
Posts: 3019
Joined: 2008.07.27. 17:00
Location: Hungary
Contact:

Re: Unable to lock disk for exclusive use - Access is denied

Post by hdsentinel »

Something is still in use and prevents Hard Disk Sentinel from locking the drive.

Maybe one file / folder opened from any of the partitions - or an antivirus software, Windows indexing service is reading/writing file(s) on one of the partitions.
Yes, if this happens, it is not possible to lock the hard disk for exclusive use (which required for write type testing).

For write type tesing, the partitions need to be locked and un-mounted to completely prevent access to the file system by other software.

May I ask what is repoted in the text description of Hard Disk Sentinel about this drive?
It may be better to run the Disk menu -> Surface test -> Read test first and use the write type test only if really required.
Generally the read+WRITE+read test is more designed for flash-based storage (SSDs, memory cards, pendrives) to "re-fresh" stored data, it may not required on hard disks at all (that's why other tests recommended at http://www.hdsentinel.com/faq.php#tests ).
bugman
Posts: 2
Joined: 2015.09.15. 17:20

Re: Unable to lock disk for exclusive use - Access is denied

Post by bugman »

Windows had been running CHKDSK every time the machine booted, but it would never complete properly - CHKDSK would hang (no longer show any indication of progress) after about 2 minutes (I let it sit for over an hour). That's what prompted me to want to try HD Sentintel.

I initiated a Disk Check from within Windows Explorer, checking both boxes (Automatically fix errors and Attempt recovery of bad sectors). That completed fine (much quicker than I expected actually - about a minute!)... I then restarted the machine, and CHKDSK ran again but this time went through to completion in about 5 minutes. Since then the machine boots & runs fine, CHKDSK no longer runs at startup.

Last night I ran HD Sentinel's READ test, it reported no errors. But when I start HD Sentinel, and select this disk in the left pane, the OVERVIEW tab reports this:

The drive found 44 bad sectors during its self test.
There are 56 weak sectors found on the disk surface. They may be remapped any time in the later use of the disk.
At this point, warranty replacement of the disk is not yet possible, only if the health drops further.
It is recommended to examine the log of the disk regularly. All new problems found will be logged there.

Confuses me that CHKDSK (after finally completing) reported no further errors, and HD Sentinel's READ test reported no errors, so why does the Overview tab report the errors mentioned above, but if there are indeed bad sectors I'd like to mark them to not be used (HD Sentinel can do that, right?).

But HOW?, if I can't get the read+WRITE+read test to run???

Thanks for your help....

bugman
User avatar
hdsentinel
Site Admin
Posts: 3019
Joined: 2008.07.27. 17:00
Location: Hungary
Contact:

Re: Unable to lock disk for exclusive use - Access is denied

Post by hdsentinel »

Yes, in case of hard disk problems, this is completely normal.

Chkdsk usually does not find or repair problems with the hard disk, but finds and "repairs" problem only with the logical volume / partition. Even if sounds surprising, this may be independent form the actual hard disk status:
chkdsk may never find problems (with the logical volume/partition) even if the hard disk is dying - and may find problems on completely perfect hard disk.

The Support -> Knowledge Base -> Hard Disk Cases -> Hard disk case: weak sectors ( http://www.hdsentinel.com/hard_disk_cas ... ectors.php ) page shows exactly a such situation: if weak sectors reported, chkdsk may try to "fix" them by isolating the sectors.
But this is not a real fix, as (for example)
- if you re-partition the hard disk / re-install the system, the problematic sectors will be used again and may cause data corruption / data loss
- if you backup/restore (mirror) the drive to a new one, the "bad sectors" created by chkdsk will be also mirrored to the new, perfect hard disk, even if that shows 100% health with no problems.

So chkdsk should not be used on a hard disk drive with problems. Data recovery companies may also not recommend this - as this may cause even more corruption of the logical volume / partition, resulting more loss of data.


> I initiated a Disk Check from within Windows Explorer, checking both boxes (Automatically fix errors and Attempt recovery of bad sectors).

This is 100% same as chkdsk does, so there is no difference in the results as well.


> Last night I ran HD Sentinel's READ test, it reported no errors.

This sounds good. Then it seems the hard disk already found the problematic sectors, reallocated them (if required) and now the hard disk status seems stable. Even if it's not perfect, the drive may still be used, but if it's health is low, then I'd recommend only for secondary storage (to not store important data on it) and immediate backup upon any, even minor new problem(s).


> Confuses me that CHKDSK (after finally completing) reported no further errors,

Yes. This is completely normal.
Bad sectors found and "fixed" by chkdsk are still used by the hard disk and can cause problems.

In contrast "real" bad sectors (if these reported in the text description in Hard Disk Sentinel) are no longer used by the hard disk: they are already reallocated. So the spare area is used for all reads and writes targeting those bad sectors. This means that no software access those sectors: so chkdsk should show no problems - and also the READ test in Hard Disk Sentinel should show no problems (if all such sectors already fixed this way).

This is good, as this way you can be sure that the original (bad) area does not contain important data and can't risk data loss.

This is why the detected and reported bad sectors can NEVER cause problems, regardless of their position because that problematic area is never used any more.
This is why manufacturers (really shame but work this way) "allow" some bad sectors and may not offer warrantly replacement, just if the amount of bad sectors reach a (usually very high) threshold level.

Also when there are high number of bad sectors on the hard disk and its health is low, there is high chance that new and new problems will occur, new and new bad sectors will be reported. These (and the reallocation procedure) may cause performance decrease (in best case), system instability - but can cause system freezes/sudden restarts/data corruption or data loss.


> and HD Sentinel's READ test reported no errors, so why does the Overview tab report the errors mentioned above,
> but if there are indeed bad sectors I'd like to mark them to not be used (HD Sentinel can do that, right?

Exactly for this situation, if you confirm that all previous bad sectors are already fixed, Hard Disk Sentinel has a mechanism to clear the error-counters.
Hard disk drives record problems found in their lifetime and these are not cleared by default.
But if you used the test, verified that the status is stable, it is possible to "acknowledge" the errors detected and reported. This way the problems will be removed from the text description and the health also restores (ideally to even 100%) until no new problems detected.
So then Hard Disk Sentinel shows only such new problems / degradations.
See Support -> Frequently Asked Questions -> How to repair hard disk drive? How to eliminate displayed hard disk problems?
( http://www.hdsentinel.com/faq_repair_ha ... _drive.php )
which exactly describes this.


> But HOW?, if I can't get the read+WRITE+read test to run???

For write tests, it is required to lock the hard disk for exclusive use.
But if any other software has one (or more) open files / folders on the hard disk, then it is not possible to lock the hard disk for exclusive use.
Please try to close other software which may use the affected hard disk.

While Hard Disk Sentinel works differently (performs disk low-level testing instead of testing only partitions) this is slightly similar to chkdsk: if you enter chkdsk D: /F (assuming D: is on the affected hard disk) chkdsk will show that it can't perform the test as the drive can't be locked/unmounted.
This is also caused by an other software / tool which has open file(s) or folders on that drive.
This can be antivirus software, Windows indexing software - or even a hidden malware.
rippro
Posts: 2
Joined: 2015.11.12. 23:42

Re: Unable to lock disk for exclusive use - Access is denied

Post by rippro »

reformat drive from NTFS to a linux partition ext4. Windows wont want anything to do with it and HDS will be able to lock and do a write test.
User avatar
hdsentinel
Site Admin
Posts: 3019
Joined: 2008.07.27. 17:00
Location: Hungary
Contact:

Re: Unable to lock disk for exclusive use - Access is denied

Post by hdsentinel »

The problem was that one or more file(s) or folder(s) used by any installed software.
This may be sometimes hard to tell if no software seems running, as it is even possible that a background defragmenter / antivirus / indexer service was actually using / monitoring one or more files/folders.

Yes, formatting to a partition which can't be read/written by Windows (and any other software) is a good solution, but may be complicated.
It may be enough to simply
- perform a quick format of the partition (to surely clear it completely)
or
- delete the partition(s) from the drive

as then we can be sure that no software can use/lock any file or folder.
Post Reply