Xref: utzoo comp.sys.att:5499 unix-pc.general:2211 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!rutgers!bpa!manta!brant From: brant@manta.pha.pa.us (Brant Cheikes) Newsgroups: comp.sys.att,unix-pc.general Subject: Re: From blocks to files (on a UNIXpc) Summary: This is the right idea. Message-ID: <464@manta.pha.pa.us> Date: 10 Feb 89 05:13:15 GMT References: <462@manta.pha.pa.us> <848@ttrde.UUCP> Reply-To: brant@manta.pha.pa.us (Brant Cheikes) Organization: Soul of the Gnu Machine, Philadelphia Lines: 31 You all know the question. In article <848@ttrde.UUCP> pfales@ttrde.UUCP (Peter Fales) writes: >As it turns out, I am working on a program that does exactly this. [...] >My program is a few weeks >(months?) away from being a useable product, but I can post it if there >is enough interest. I'm interested, so either post it or mail it to me, thanks. >The way I am doing it - the only way so far as I know - is to search >through the inode list, and look the list of blocks that belong to >each inode. Then you can do a find -inum to find the file with that >inode. This is correct, though you should not overlook the freelist. >There are a few other things to consider. For example, the bad block >may be in the swap area, or (shudder) the inode list. I believe these are easy computations given knowledge of the sizes of partitions 0, 1, and 2, and the total number of inodes. My understanding of the Unix filesystem is that the inode blocks are the first blocks of partition 2. So given 800 total inodes, and 8 inodes per block, the first 100 blocks of partition 2 are reserved for the inodes. -- Brant Cheikes University of Pennsylvania, Department of Computer and Information Science brant@manta.pha.pa.us, brant@linc.cis.upenn.edu, bpa!manta!brant