From: "Joseph D. Wagner" Subject: RE: Files, Inodes, and Blocks Date: Sat, 4 Oct 2003 15:09:15 -0500 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <000001c38ab3$638f2350$0201a8c0@joe> References: <20031004193941.GK24824@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT Cc: Return-path: Received: from ssa8.serverconfig.com ([209.51.129.179]:11687 "EHLO ssa8.serverconfig.com") by vger.kernel.org with ESMTP id S262748AbTJDUJQ convert rfc822-to-8bit (ORCPT ); Sat, 4 Oct 2003 16:09:16 -0400 To: "'Matthew Wilcox'" In-Reply-To: <20031004193941.GK24824@parcelfarce.linux.theplanet.co.uk> List-Id: linux-fsdevel.vger.kernel.org Thanks. Per your advice I got: Pate, Steve D. UNIX Filesystems: Evolution, Design, and Implementation. Wiley: Indianapolis, Indiana. 2003. ISBN: 0-471-16483-6 US$45.00 http://www.amazon.com/exec/obidos/tg/detail/-/0471164836/ Based upon the table of contents, it should answer 99.999% of my questions and keep me occupied for a very long time. Joseph Wagner > -----Original Message----- > From: Matthew Wilcox [mailto:willy@debian.org] > Sent: Saturday, October 04, 2003 2:40 PM > To: Joseph D. Wagner > Cc: linux-fsdevel@vger.kernel.org > Subject: Re: Files, Inodes, and Blocks > > On Sat, Oct 04, 2003 at 02:10:03PM +0600, Joseph D. Wagner wrote: > > There is a 1:1 relationship between the number of files and the number > of > > used inodes. In other words, each file has only one corresponding > inode. > > > > There is a 1:many relationship between the number of used inodes (1) and > the > > number of used blocks (many). In other words, one inode can refer to > many > > blocks. > > Assuming you're talking about a "classic" Unix filesystem like ext2, yes. > I think you probably need to read some of the classic texts on Unix > filesystems. Many libraries have this available: > > Leffler, Samuel J., Marshall Kirk McKusick, Michael J. Karels, and John > S. Quarterman, The Design and Implementation of the 4.3BSD UNIX Operating > System, Addison-Wesley, Reading, MA, 1989. $40 ISBN 0-201-06196-1. > > which was how I learned about how Unix filesystems work. I'm sure there > are other good books. > > FWIW, in BSD's FFS and several other filesystems (not ext2 though), > there are ways for multiple files to share the same block (fragments or > tail-packing), so blocks <-> files can be many-to-many. > > The other thing that tends to confuse people new to Unix filesystems is > that an inode is a file, but files can have 0-or-more names. That is, > a file will continue to exist as long as there is a reference to it, > where a reference can be an open file handle or a directory entry. And > multiple directory entries can refer to the same file (see ln(1)). > > -- > "It's not Hollywood. War is real, war is primarily not about defeat or > victory, it is about death. I've seen thousands and thousands of dead > bodies. > Do you think I want to have an academic debate on this subject?" -- Robert > Fisk