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

David S. Herron david at twg.com
Sun Nov 11 11:12:23 AEST 1990


In article <35622 at cup.portal.com> thad at cup.portal.com (Thad P Floryan) writes:
>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.

Part of the inode is a list of logical block numbers allocated to
that inode.  Therefore, if you have a logical block number, then
a traversal of all blocks allocated to inodes will tell you where
the block is allocated.  Then you use ncheck & that will tell you
the file(s) which correspond to that inode.

But, probably, as soon as the OS discovers the bad block -- if it
does bad block replacement -- then it will replace the logical
block, and maybe the block assignment in the inode, behind your
back.  So the old bad block would no longer be referenced by any
inode.  I know the SysVr3.2.2 system I've been using does bad block
replacement since it was doing that a couple times a week until I
replaced the drive.


The logical block number -> physical disk address (cyl/track/sector)
is done inside the kernel between the file system & disk driver.  It's
in a routine you cannot access from user level programs.  So given
a physical disk address it might be hard to come up with the LBN
and thus the inode number & file name.



-- 
<- David Herron, an MMDF & WIN/MHS guy, <david at twg.com>
<- Formerly: David Herron -- NonResident E-Mail Hack <david at ms.uky.edu>
<-
<- Use the force Wes!



More information about the Comp.sys.att mailing list