Unix-Style Filesystem

An inode-based filesystem implemented from scratch in C over a 256 MB virtual block store, with persistent storage and a POSIX-like API

Technology Stack
C
Systems Programming
Operating Systems

Project Overview

A complete inode-based filesystem written from scratch in C, layered over a 256 MB virtual block store. It supports formatting, mounting, unmounting, and persistent storage that survives across sessions, exposing a POSIX-like API for file and directory operations.

Key Features

  • • Format, mount, unmount, and persistent storage across sessions over a 256 MB virtual block store
  • • Three-level block addressing scheme (6 direct pointers, single indirect, and double indirect) enabling large-file support with on-demand block allocation
  • • Full read/write/seek semantics tracked per file descriptor
  • • POSIX-like API: create, open, close, remove, move, link, and get_dir, with hard links via inode reference counting
  • • Absolute-path directory traversal and a bitmap-managed free inode table

Technical Approach

  • • Inode-based design mirroring classic Unix filesystem architecture
  • • Indirect and double-indirect block pointers to scale to large files without wasting metadata
  • • Reference counting to support hard links while safely reclaiming freed inodes
  • • Bitmap allocation for efficient tracking of free inodes and blocks

Results & Insights

Performance

The filesystem successfully supports large files and directories with efficient block allocation, demonstrating the effectiveness of the inode-based design. The use of indirect pointers allows for scalable file sizes without excessive metadata overhead.

Development Insights

This was a long term project for my Operating Systems course, and it provided valuable experience in low-level systems programming, memory management, and filesystem design. Through this project I found a real joy in solving and debugging low level problems, especially the more difficult issues.

256 MB

Virtual Block Store

3-Level

Block Addressing