Custom file system built in C using block-level I/O and a FAT-style volume, with full file and directory operation support via a shell interface.
- Custom volume format and initialization
- FAT-style free space management
- Directory entries with full metadata
- File Control Blocks with buffered read/write
- Persistent storage across runs
- Command-line shell with built-in commands
Supported commands:
ls
– list directory contentscd <dir>
– change current directorymd <dir>
– make a new directorypwd
– print current directorytouch <file>
– create an empty filecat <file>
– display file contentsrm <file>
– delete a filecp <src> <dest>
– copy a filemv <src> <dest>
– move/rename a filecp2fs <host_file>
– copy file from host into virtual file systemcp2l <fs_file>
– copy file from virtual file system to hosthelp
– list available commands
- src/*.c # C source files
- include/*.h # Header files
- obj/*.o # Compiled object files
- Makefile # Build script
- Dockerfile # Docker image configuration
git clone https://github.com/keyprocedure/linux-file-system.git
cd linux-file-system
Option 1: Using Docker:
# Build the Docker image
docker build -t linux-fs .
# Run the shell in a Docker container
docker run -it -v $(pwd)/volume:/app/volume linux-fs
Option 2: Run Natively on Linux:
# Compile the system
make
# Launch the shell
make run
- VCB: Tracks volume info and root dir location
- FAT: Manages used/free blocks in a linked list style
- Directories: Support nested structures and metadata (
.
,..
) - Buffered I/O: Efficiently reads/writes to disk in blocks
- Persistence: All state is saved to a volume file between runs