File System

File System

Disks are divided into multiple partitions, each with an independent file system. Sector 0 is used for booting the computer, followed immediately by the partition table which provides the start and end addresses of each partition.

Partition Layout

Starting from the boot block, the superblock contains key information parameters of the file system:

  • inode
  • Data blocks

Hard Links and Soft Links

A hard link creates an alias for an existing file, pointing to the same inode node, but cannot be created for directories. A soft link has its own separate inode and data block, where the user data block stores the path name pointing to another file, without the many restrictions of hard links.

File System Consistency

UNIX has fsck, which can perform both block consistency and file consistency checks.

File System Cache

Block caching can reduce the number of disk accesses Bidirectional linked list LRU + hash table for storage management.