Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

krishadya/FileSystem

Repository files navigation

File System Implementation

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.

Overview

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.


Features

Persistent Virtual Disk

  • Creates and mounts custom filesystem volumes
  • Stores filesystem metadata on disk
  • Maintains state between program executions

Directory Management

  • Create directories
  • Navigate directory hierarchy
  • Track current working directory
  • List directory contents

File Operations

  • Create files
  • Read file contents
  • Rename files
  • Delete files
  • Copy files into the custom filesystem

Free Space Management

  • Bitmap-based block allocation
  • Block release and reuse
  • Persistent allocation tracking

Interactive Shell

Built-in filesystem shell supporting commands such as:

ls
cd
pwd
md
touch
cat
cp
mv
rm
cp2fs
cp2l

Architecture

Volume Control Block (VCB)

Stores critical filesystem metadata:

  • Block size
  • Volume size
  • Root directory location
  • Filesystem signature

Directory System

Each directory stores:

  • File names
  • Metadata
  • Block locations
  • Parent-child relationships

Free Space Manager

Tracks available disk blocks using a bitmap structure to efficiently allocate and release storage.

Buffered File I/O

Provides filesystem-level file operations independent of the host operating system.


Screenshots

Filesystem Initialization

Startup

Directory Management

Directories

Copying and Reading Files

File Copy

File Rename Operation

Rename

Persistent Storage Demonstration

Persistence


Technologies Used

  • C
  • GNU Make
  • Linux
  • Low-Level Storage Management
  • File System Design
  • Operating Systems Concepts

Project Components

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

Building

make

Run the filesystem:

./fsshell demo.fs 10000000 512

Example Session

pwd
md documents
cd documents
pwd
cp2fs linux_test.txt testfile.txt
cat testfile.txt
mv testfile.txt renamed.txt
cat renamed.txt

Concepts Demonstrated

  • File system architecture
  • Persistent storage
  • Block allocation
  • Directory structures
  • Metadata management
  • Linux systems programming
  • Low-level I/O operations
  • Operating systems fundamentals

About

Custom Unix-style file system built in C with persistent storage, directory management, free-space allocation, and file operations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /