Page 1 of 1

Wondering what exactly the disk repair function does

Posted: 2023.11.25. 00:50
by ASLDBL
Hi there, just wondering if I could get some specifics on what exactly the disk repair function does when it runs into a bad sector? I have read the help page on it, but it doesn't go into the gory details.

For sectors that are unallocated, I assume it just overwrites the sector. But what does it do when it runs into a sector that belongs to a file?

Also, in the disk contents inspector (when you click a block) the repair button is usually greyed out. Curious why this might be the case.

There's no data on the line here, this is just pure curiosity and wanting to know what goes on under the covers.

Thanks in advance!

Re: Wondering what exactly the disk repair function does

Posted: 2023.11.27. 12:17
by hdsentinel
Generally the Disk Repair test performs a read scan and when it finds an unreadable sector (which is usually a weak/pending sector: a damaged sector which is still in use by the drive, so not yet reallocated, not yet marked as bad sector) then the Disk Repair test

- performs different techniques to attempt to read/recover the data from affected sector. It attempts multiple times (3 by default but it can be adjusted before starting the test)
- if it can read the data, it automatically writes back, refreshing the actual sector. This should ensure that later (eg. when we want to backup/save the affected file) it should be readable "easier" without errors
- if the data can't be read back at all (for example if the data never actually recorded because of a power loss, power failure or the sector is damaged in a way that the data can't be retrieved), the Disk Repair test forces the disk drive to repair the sector by performing the reallocation (replace with spare sector and mark the original as bad to prevent future use) or restore the status to normal (for example if the sector is not physically damaged just a previous power loss caused an unfinished write). The decision (if the sector is marked as bad) depends on the actual situation and the disk drive manufacturer, model, firmware (not Hard Disk Sentinel).

In any ways, as a result, the affected file (if the sector is a part of a file) can be read back and saved, even if it was previously not readable.
In worst case, it may have a sector-size "empty" spot in it which may be minor issue (eg. a damaged frame during playback if it was an audio/video file) and still better than losing an entire file if it can't be otherwise saved.

After the Disk Repair test finished, the bottom log area shows the affected sectors and Hard Disk Sentinel determines the file(s) affected and the sector position inside the file. So it is possible to quickly check the affected file(s) and verify their possible damage.


> Also, in the disk contents inspector (when you click a block) the repair button is usually greyed out. Curious why this might be the case.

If a sector is readable, so you can inspect the actual contents -> then there is nothing to repair: it is completely normal and expected that the Repair button is greyed out in this case.

The Repair button is available (not greyed) only when the appropriate sector is not readable and just an error message appears instead of the real contents of the sector. Then you can use this Repair button to manually try to repair of the affected sector, without launching the Disk Repair test.