Mini-FS is a containerized filesystem built on FUSE (Filesystem in Userspace). It operates by mounting a container file, allowing all files and directories created within the mount point to be stored within this container file.
This project has been tested on Archlinux with Rust 1.77.
This project relies on the following crates:
- FUSE and the Rust crate fuser for handling filesystem-related calls.
- notify-rust for desktop notifications.
- serde and bincode for binary serialization.
- heapless for easily serializable structures.
- clap for parsing command-line parameters.
- anyhow for handling errors throughout the entire program.
[FUSE for Linux] is available in most Linux distributions and usually called fuse
or fuse3
. See installation guide for most distributions.
cargo build
Mini-FS includes unit tests that can be executed as follows:
cargo test
Additionally, there's a basic filesystem test script provided. After mounting a
container filesystem on mountpoint/
(refer to usage), run the
following command:
./test.sh mountpoint
This script conducts file creation, reading, writing, and deletion operations based on basic shell operations.
To mount the container file container_file
to ./mountpoint/
, follow these steps:
mkdir mountpoint
./target/debug/mini-fs mountpoint container_file
Once mounted, you can use mountpoint/
as a directory, and all files and directories will be stored in container_file
.
For example:
mkdir mountpoint/ocean
echo "Whale swim like otters" > mountpoint/ocean/whale.txt
cat mountpoint/ocean/whale.txt
This creates a directory ocean
inside mountpoint/
, writes a text file whale.txt
with the specified content, and then displays the contents of whale.txt
.
Mini-FS features a basic notification system that can be enabled using the option -n
or --allow-notification
.
To enable notifications, use one of the following commands:
./target/debug/mini-fs mountpoint container_file -n
./target/debug/mini-fs mountpoint container_file --allow-notification
However, be cautious as enabling this feature may result in frequent notifications, which could potentially become very annoying.
Mini-FS is not a fully-fledged filesystem and lacks several operations, including:
- Removing a directory.
- Changing file permissions (currently fixed at 777).
- Renaming files or directories.
- Names limited to 30 bytes.
- (Probably) not thread-safe.
Additionally, the container structure exhibits some inefficiencies that could be addressed for improved performance:
- Excessive read and write operations.
- Failure to release sectors when directories or files are truncated.
- Absence of a cache system.
- Fragmentation issues.
Dual-licensed under Apache 2.0 or MIT.