Skip to main content

Short note: UNIX file system

Short answer

UNIX uses a hierarchical tree with a single root, where everything is a file (regular, directory, device). I-nodes hold metadata and block pointers (direct, indirect). Features: mounting to unify trees, hard and symbolic links, 9‑bit permissions, and buffer cache.

Write a short note on UNIX file system.

The UNIX file system is a hierarchical, tree-structured file system with a single root /. Everything is a file: ordinary files, directories and special (device) files, so the same system calls (open, read, write, close) are used for files and I/O devices.

Main features:

  • Hierarchical directories: a directory is a file containing (name, i-node number) entries; path names can be absolute (/usr/bin/ls) or relative; . and .. refer to the current and parent directory.
  • I-nodes: each file has an i-node with attributes and block addresses (10 direct, single, double and triple indirect pointers), so large files are supported and access is efficient.
  • Disk layout: boot block, superblock, i-node list, data blocks.
  • Mounting: other file systems are attached to a directory with mount, giving one unified tree.
  • Links: hard links (several names for one i-node) and symbolic links.
  • Protection: 9 permission bits (read, write, execute for owner, group, others), plus the set-UID, set-GID and sticky bits.
  • File types: regular, directory, character special, block special, pipe/FIFO, socket.
  • A buffer cache is used for performance, and free blocks are managed by a free list or bit map.
          /
   +------+------+
  bin    usr    dev
   |      |      |
  ls   +--+--+  tty0
      bin  lib

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 5 questions →