How do inodes work?

Don Lewis truckman at FreeBSD.org
Sun May 16 12:33:46 PDT 2004


On 16 May, David Malone wrote:
> On Sun, May 16, 2004 at 02:25:37AM -0300, Marc G. Fournier wrote:
>> so I take there are 'gaps' in the inode list?  it doesn't re-use freed
>> ones but keeps climbing until maybe it rolls around or something?
> 
> A particular numbered inode always lives in the same place on the
> disk. When choosing what inode to use for a new file, the filesystem
> tries to pick a inode to put the file close to the directory it is
> being created in. This is the dirpref optimisation introduced a few
> years ago - previously inodes were chosen from a part of a disk that
> had the most nearby free space.

The preferred location of inodes for regular files has always been in
the same cylinder group as their parent directory.  The dirpref
optimization changed the policy for selecting the cylinder group when
new directories are created.



More information about the freebsd-hackers mailing list