I have a hard drive with 3 bad sectors. I know the sector numbers and the computer can still boot into Windows. I want to run sector repair from an HDD diagnostics tool from the manufacturer, but before I do that, I'd like to know what files are affected. Is there a way to figure out what file or files are occupying those sectors?

link|improve this question
feedback

5 Answers

Here's the process using WinHex, a handy hex editor that can examine and edit drives directly. Be very careful; this tool can damage your system if used inappropriately. Open disks read-only whenever possible.

alt text

  1. Since you have the bad sector locations already, you can open the drive in WinHex directly ("Open Disk" toolbar button) and then navigate to the sector to view the data ("Go to Sector" toolbar button). Assuming your sector locations are physical sector addresses, you need to open your physical drive in this step.

    This won't identify the file directly, but the left-hand pane should identify the partition that contains this sector and its corresponding relative sector address.
    alt text

  2. If the partition you've identified is an NTFS or FAT partition, we can open the partition directly ("Open Disk" again). This will open the partition in a new tab, so you can switch back and forth as needed. In the partition tab, use the "Go to Sector" function again, but this time input the translated sector (the "relative sector" identified in the drive view).

    Now, in the left-hand pane, you should see a section on "Alloc. of visible drive space". Under this is the cluster #, physical sector #, logical (relative) sector #, and the filename if this sector actually belongs to a file.
    alt text

If these steps don't give you an immediate answer, your bad sectors may not be in use. If the results are unclear, you may have to do some more digging to find your answer.

link|improve this answer
the downloadable version claims to be an evaluation version, but seems very capable. i'm not sure what the trial period is. see here for license options: x-ways.net/winhex/order.html – quack quixote Jan 21 '10 at 7:49
WinHex was the bomb....Found what files where affected by the bad sectors (absolute sectors from surface scan) in minutes. Awesome tutorial. Thanks I would vote u up "quack quixote" but I don't have the 15 reputation necessary...... – user102373 Oct 21 '11 at 6:03
feedback

as far as i know when a drive hits a certain number of read errors on a sector it gets marked as bad and its contents are copied away to another place on the drive. this usually happens before the data on that sector has become completely unreadable.

I try to dig up a source for that, just read it yesterday but cannot remember where.

from man hdparm (8)

Note also that the --repair-sector flag can be used to restore (any) bad sectors when they are no longer needed, including sectors that were genuinely bad (the drive will likely remap those to a fresh area on the media).

Bottom line: you don't have to care about bad sectors, the harddrives firmware does that for you. only thing you have to do is get a new drive before there are too many of them and your drive dies.

link|improve this answer
I'm pretty sure that reallocation happens on write and not on read. The SMART data of the drive seems confirms that. The number of pending sectors is high (larger than 0) while the Sector Reallocation Count is 0. For me that means: There are bad sectors marked for reallocation but they have not yet been reallocated. – ChrisWue Jan 25 at 20:54
have you tried CHKDSK? en.wikipedia.org/wiki/CHKDSK – Walter Maier-Murdnelch Jan 25 at 21:01
look at the /r option – Walter Maier-Murdnelch Jan 25 at 21:02
getting info out about the files stored in that sector seems to be not possible though. – Walter Maier-Murdnelch Jan 25 at 21:05
feedback

Most defragmenting programs show a disk-map displaying all the clusters on the disk which you can then click (look for the ones marked as bad) to view the file(s) located in that cluster.

As Walter said, any disk and OS combo from the past decade or so will make sure to relocate files from bad sectors automatically (drive firmware usually handles this, but disk tools like chkdsk or defragmenters will usually do this as well).


Defraggler:

enter image description here

Defrag-a-File:

enter image description here

Vopt:

enter image description here

link|improve this answer
Looks promising, I'll give it a go. – ChrisWue Jan 25 at 21:13
feedback

RunTime's DiskExplorer allows you to examine a drive by sector. It's payware ($70 for the NTFS version) but free to try. They have versions for NTFS, FAT and Linux (ext2/3).

alt text

link|improve this answer
This looked promising, but sadly it doesn't work. DiskExplorer displays "Invalid MFT entry" for every sector of the drive. – Jason81 Jan 20 '10 at 1:26
i expect there's a configuration step you're missing if it shows that for all sectors, but i haven't used this tool in a long time so i can't give you direct instructions with it. i'll add another answer with a separate tool; perhaps someone else will chime in with proper usage of this one. – quack quixote Jan 21 '10 at 7:41
feedback

DiskView from Sysinternals performs exactly this function: to display a diskmap of the drive and let you see what files occupy what clusters.

Unfortunately, there does not seem to be a way of displaying the names of system files.

DiskView main window DiskView system file

link|improve this answer
feedback

Your Answer

 
or
required, but never shown