Proof of concept. A FUSE filesystem implemented atop crdt_tree.
MaidSafe website | Safe Network Forum |
---|
EXPERIMENTAL: For testing purposes only
Important: Any data stored in the filesystem is wiped upon unmount. Do not use with an non-empty directory!
The sn_fs filesystem demonstrates use of the crdt-tree data type to store filesystem metadata such as directory structure, hard and soft links, filenames, and file attributes.
File content is stored on disk in the underlying filesystem beneath the mountpoint, but these files are not visible to other processes.
At present, the filesystem functions as a hybrid memory/disk filesystem. All metadata (directories, symlinks, inodes, filenames) is stored in RAM and the actual file contents are stored on disk. All data is lost/wiped upon unmount. RAM is freed and the on-disk files containing file content are wiped, to leave the mountpoint in original (empty) condition as when it was mounted.
Thus far, sn_fs has mainly been tested on Linux. It builds and runs on Mac OSX however is reported to exhibit several problems that make it mostly unusable. It cannot be built on Windows at this time.
For some background, see this thread.
- Directories (mkdir, rmdir)
- Files
- Symlinks (ln -s)
- Hard links (ln)
- Ownership (uid/gid) changes (chown, chgrp)
- Mode changes (chmod)
- Timestamps (mtime, ctime, crtime)
- xattr extended attributes
- Phase 1: Implement crdt_tree.
- Phase 2: Demonstrate a local fuse filesystem built atop crdt_tree.
- Phase 3: Resolve how best to store file content as CRDT operation.
- Phase 4: Integrate with Safe Network
- Phase 5: Local cache that persists between mounts.
- Phase 6: Implement an API for developers to read/write files to Safe Network without requiring a local mount.
- You need rust 1.46.0 or higher installed.
- You need fuse development package installed, eg
libfuse-dev
on Ubuntu. $ git clone https://github.com/maidsafe/sn_fs
$ cd sn_fs && cargo build
note: On Mac, you will need to first install osxfuse.
You must have FUSE installed. This is normally installed by default on Linux distributions.
$ cargo run /path/to/mountpoint
You can also run sn_fs directly:
$ sn_fs /path/to/mountpoint
Note that the directory mountpoint
must be empty.
Once the filesystem is mounted, you can perform regular file operations within it including chown, chmod, mkdir, link, ln, rm, tree, etc.
To view debug output, mount instead with:
$ RUST_LOG=debug cargo run /path/to/mountpoint
In another terminal/shell, run:
$ fusermount -u /path/to/mountpoint
note: On Mac with osxfuse, you can just use regular umount
command.
Please report in the issue tracker.
This Safe Network software is dual-licensed under the Modified BSD ( https://opensource.org/licenses/BSD-3-Clause) or the MIT license ( https://opensource.org/licenses/MIT) at your option.
Want to contribute? Great 🎉
There are many ways to give back to the project, whether it be writing new code, fixing bugs, or just reporting errors. All forms of contributions are encouraged!
For instructions on how to contribute, see our Guide to contributing.