A custom Unix-style file system built in C that provides persistent storage, directory management, free-space allocation, and file operations on a virtual disk volume.
This project implements a simplified file system from the ground up using C.
The system manages its own:
- Virtual disk volume
- Volume Control Block (VCB)
- Free-space bitmap
- Directory structures
- File metadata
- File I/O operations
- Shell interface
Instead of relying on the host operating system's file system, all data is stored inside a custom volume file and managed through filesystem-specific operations.
- Creates and mounts custom filesystem volumes
- Stores filesystem metadata on disk
- Maintains state between program executions
- Create directories
- Navigate directory hierarchy
- Track current working directory
- List directory contents
- Create files
- Read file contents
- Rename files
- Delete files
- Copy files into the custom filesystem
- Bitmap-based block allocation
- Block release and reuse
- Persistent allocation tracking
Built-in filesystem shell supporting commands such as:
ls
cd
pwd
md
touch
cat
cp
mv
rm
cp2fs
cp2l
Stores critical filesystem metadata:
- Block size
- Volume size
- Root directory location
- Filesystem signature
Each directory stores:
- File names
- Metadata
- Block locations
- Parent-child relationships
Tracks available disk blocks using a bitmap structure to efficiently allocate and release storage.
Provides filesystem-level file operations independent of the host operating system.
- C
- GNU Make
- Linux
- Low-Level Storage Management
- File System Design
- Operating Systems Concepts
| File | Purpose |
|---|---|
| fsInit.c | Filesystem initialization and mounting |
| mfs.c | Core filesystem operations |
| directory.c | Directory management |
| freespace.c | Free-space allocation |
| b_io.c | Buffered file I/O |
| volumeControlBlock.c | Volume metadata management |
| fsshell.c | Interactive shell interface |
make
Run the filesystem:
./fsshell demo.fs 10000000 512
pwd
md documents
cd documents
pwd
cp2fs linux_test.txt testfile.txt
cat testfile.txt
mv testfile.txt renamed.txt
cat renamed.txt
- File system architecture
- Persistent storage
- Block allocation
- Directory structures
- Metadata management
- Linux systems programming
- Low-level I/O operations
- Operating systems fundamentals