Ascertaining file name given a HD bad block number on 3B1

Thad P Floryan thad at cup.portal.com
Mon Nov 5 23:59:24 AEST 1990


Does anyone know if there's a method (or program) to ascertain to which
file on a mounted file system a bad block belongs?  The bad block could
be specified by any of physical sector, logical block, or cylinder/track/
sector.

I'm writing an article to accompany a program which assists mapping out
bad blocks (on the 3B1/UNIXPC), and a complete perusal of TFM revealed
nothing obvious, nor did the "fsanalyze -e" reveal any inodes whose files'
lengths were no longer copacetic due to a bad block now being mapped-out.

As you may have guessed, one HD on one system "grew" a bad sector and that
prompted the program and the article.  'Twas no big deal to fix, and my
program (hdhelper) and article should make it easier for others who encounter
their first bad block report, but I'm really curious to what file the bad block
was (is?) attached.

One discovery in TFM: given an inode number, the ncheck program would reveal
the file name.

Must the file system be traversed block by block with the (???) program
to derive this info?

Or am I missing something obvious, such that when a bad block is detected
the system (during its current boot incarnation) refuses to re-use the block
and/or (somehow) automatically moves recoverable data to another sector.  I
really don't believe that could happen, but I've been pleasantly surprised
by other things in the past, and if someone knows the answer I'll include it
in the article.

Thad Floryan [ thad at cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ]



More information about the Comp.sys.att mailing list