next up previous contents
Next: File System and Directory Up: Managing Storage Previous: Adding Swap Space   Contents

UNIX File System Structure UFS

A UFS file system is made of:

New blocks allocated to a file are obtained from the free-block list to which blocks are returned when a file is deleted.

The superblock is followed by blocks containing inodes and associated inumber pairs. An inode describes an individual file with one inode for each file in the file system. For each file system is allocated a maximum number of inodes and therefore a maximum number of files. The maximum values depend on the the file system size.

Inode 1 on each file system is unnamed and unused. Inode 2 must correspond to the file system root directory that supports all other files in the file system. Inodes after inode 2 are free and can be any file. Inodes and blocks are not allocated in any particular order.

A directory entry, file or link, consists of the name and the inumber representing the file. The link count indicates the number of directory entries that refer to the same file. A file is deleted if the link count is zero. When the file is deleted the associated inode is returned to the free-inode list and its associated blocks are returned to the free-block list.


next up previous contents
Next: File System and Directory Up: Managing Storage Previous: Adding Swap Space   Contents
luvisetto
2001-10-02