Xref: utzoo comp.sys.att:10740 unix-pc.general:6358 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!portal!cup.portal.com!thad From: thad@cup.portal.com (Thad P Floryan) Newsgroups: comp.sys.att,unix-pc.general Subject: Ascertaining file name given a HD bad block number on 3B1 Message-ID: <35622@cup.portal.com> Date: 5 Nov 90 12:59:24 GMT Organization: The Portal System (TM) Lines: 30 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@cup.portal.com (OR) ..!sun!portal!cup.portal.com!thad ]