Question: 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?
Answer: Try nfi.exe – Windows NT File System (NTFS) File Sector Information Utility. Download from Microsoft OEM Support Tools Phase 3 SR2.
> nfi.exeDumps information about an NTFS volume, and optionally determineswhich volume and file contains a particular sector.Usage: nfi drive-letter [logical-sector-number] ?Drive-letter can be a single character or a character followed ?by a colon (i.e., C or C: are acceptable). ?Logical-sector-number is a decimal or 0x-prefixed hex ?number, specifying a sector number relative to the volume ?whose drive letter is given by drive-letter. If not ?specified, then information about every file on the volume ?is dumped. ?nfi NT-device-path physical-sector-number ?Determines which volume a given physical sector on a drive is ?within, and then which file on the volume it is in. ?NT-device-path is the NT-style path to a physical device. ?It must not include a partition specification. ?Physical-sector-number is a decimal or 0x-prefixed hex ?number, specifying a sector number relative to the physical ?drive whose device path is given by NT-device-path. ?nfi full-win32-path ?Dumps information about a particular file. full-win32-path ?must start with a drive letter and a colon.
Note you must omit the “\?” prefix of the block device path. Example:
C:UsersadminDownloads>nfi DeviceHarddisk0DR0 28521816NTFS File Sector Information Utility.Copyright (C) Microsoft Corporation 1999. All rights reserved.***Physical sector 28521816 (0x1b33558) is in file number 5766 on drive C.IMAGESwin7HDD.vhd ?$DATA (nonresident) ?physical sectors 32863720-34098663 (0x1f575e8-0x2084de7) ?physical sectors 28519912-32863719 (0x1b32de8-0x1f575e7) ?physical sectors 25727944-26291143 (0x18893c8-0x1912bc7) ?physical sectors 95163976-115106143 (0x5ac1648-0x6dc615f)