MiniFS is a from-scratch file system written in C that runs on top of a simulated block device (disk.img). It was built to replicate the core architecture of a real operating system filesystem layer, including superblocks, inodes, block allocation, bitmaps, and directory management.
The goal of MiniFS is not just to store files, but to demonstrate how structured storage systems are designed, organized, and maintained at the block level. It operates directly on raw disk blocks, managing metadata, allocation, and consistency without relying on external libraries or abstractions. This project reflects the foundational mechanisms used in real-world file systems.
MiniFS includes a command-driven shell interface that translates user input into filesystem operations, simulating how an OS exposes storage functionality to users and applications. Supported commands include:
- 'format'
- 'mount'
- 'create '
- 'rm '
- 'write '
- 'read '
- 'ls'
- 'stats'
- 'help.'
MiniFS is structured around:
-
Superblock — Stores global filesystem metadata, including total blocks, total inodes, free inodes, free blocks, and layout configuration.
-
Inode Table — Each file is represented by an inode containing file size, direct block pointers, and directory flags.
-
Bitmaps — Efficient allocation tracking for both inodes and data blocks.
-
Root Directory — Stored in a fixed data block, mapping filenames to inode numbers.
-
All disk operations are performed using low-level block access functions (read_block and write_block). The filesystem is responsible for allocation, deallocation, metadata updates, and maintaining structural consistency across its components.
MiniFS demonstrates:
-
Low-level storage management
-
Block-based allocation strategies
-
Filesystem metadata design
-
Directory structure implementation
-
Resource tracking via bitmaps
-
Persistent state management
-
Command parsing and system-style interfaces
-
Separation between logical filesystem operations and physical disk access
-
This project represents a complete minimal filesystem layer with persistent storage behavior and structured metadata control. It models the fundamental principles behind real operating system storage subsystems, implemented entirely in C.
-
MiniFS was developed as a systems-focused project to deepen understanding of how operating systems manage data at the lowest practical level.
-
It emphasizes correctness, structure, and architectural clarity while remaining intentionally minimal.
Compile manually:
- gcc -Wall -Wextra -std=c11 main.c fs.c disk.c -o fs
Run:
-
./fs
-
This launches the MiniFS shell, where you can format the disk, mount it, and interact with the filesystem.