Xref: utzoo comp.sys.att:10792 unix-pc.general:6404 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!mips!twg.com!david From: david@twg.com (David S. Herron) Newsgroups: comp.sys.att,unix-pc.general Subject: Re: Ascertaining file name given a HD bad block number on 3B1 Message-ID: <8258@gollum.twg.com> Date: 11 Nov 90 00:12:23 GMT References: <35622@cup.portal.com> Reply-To: david@twg.com (David S. Herron) Followup-To: comp.sys.att Organization: The Wollongong Group, Palo Alto, CA Lines: 34 In article <35622@cup.portal.com> thad@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, <- Formerly: David Herron -- NonResident E-Mail Hack <- <- Use the force Wes!