Skip to content
/ UCUTag Public

Tag-based filesystem for Linux, written as OS course project

License

Notifications You must be signed in to change notification settings

yewhenp/UCUTag

Repository files navigation

UCUTag - tag file system

Fuse-based tag-oriented file system

C++ Fuse MongoDB CMake Arch

Authors:

Tsapiv Volodymyr Hilei Pavlo Pankevych Yevhen

Project description

This project is our OS course project at APPS UCU.

Tag-oriented file system means that instead of regular directories, we use tags. Just like tags you use in Instagram, Telegram or other social network.

You can create files just like regular files, create tags just like regular directory. Then after you create file-tag association, you can search for this file with tag. You can associate many tags with files, and use same tag for different files.

The benefits of this file system association is more natural and convenient way of file search:

  • User don't usually remember exact path to the file, but remember different keywords about it. When filtering with tags, order doesn't matter (but filename should be at the end if you specify it), and you don't have to specify all tags associated with this file. For example instead of "/home/username/Documents/studying/year3/os/lab10" on hierarchical filesystem, you can just filter files like that "/studying/os/lab10" or "lab10/year3/Documents" with tags on tag file system
  • Speed. To find file on hierarchical file system you'll have to goo through all files on the computer, which takes linear time (O(n)), but on tag file system, this takes ~ O(log(n)) time on out file system (assuming you're using ext4, that uses B+ tree to find files in directory).

How to get ucutag?

Install with AUR

yay ucutag-git

Compile from sources

Prerequisites

  • cmake 3.15+
  • GCC 11
  • boost
  • mongo-cxx-driver
  • mongodb v5
  • fuse v2

Install prerequisites on ArchLinux:

yay gcc cmake boost boost-libs fuse2 mongo-cxx-driver mongodb

Compile:

./compile.sh
cd build
sudo make install
sudo systemctl enable --now mongodb.service

Usage

export UCUTAG_FILE_DIR enviroment variable to use it as a "trash" directory, where ucutag stores actual files. You can change it to "create" another file system. Make sure you have all permissions to it. Default is /opt/ucutag/files

NOTE! - mountpoint should be an absolute path

Mount file system with name:

ucutag --name myfs --mount /path/to/mountpoint -d 

NOTE! running with -d makes ucutag not exit immediately, and wait for all debug messages (if compiled in Debug mode). Currently please run only in debug, mode, due to some bugs. You can enter mountpoint from other terminal. Stop with <Ctrl-C>. You don't have to umount after running in debug.

Remove file system with some name (all files will be lost):

ucutag -r myfs

Umount file system ():

ucutag -u /path/to/mountpoint

Creating files, tags, creating associations example: (./presentation_scenario/scenario2)

alias mktag=mkdir                   # just for readability
touch BMW Audi Mercedes             # create cars (files)
mktag car_makers                    # create tag for car manifactures (tag)
touch Yamaha Honda Kawasaki         # create motorcycles (files)
mktag moto_makers                   # create tag for motorcycles manifactures (tag)
mv BMW car_makers/ && mv Audi car_makers/ && mv Mercedes car_makers/    # create association car manifacturer - car_makers
mv Yamaha moto_makers/ && mv Kawasaki moto_makers/
mv Honda car_makers/moto_makers/    # honda makes care and motorcycles
ls                                  # show all tags
ls car_makers                       # Audi  BMW  Honda  Mercedes             
ls moto_makers                      # Honda  Kawasaki  Yamaha
ls car_makers/moto_makers           # Honda
ls moto_makers/car_makers           # Honda

mv car_makers/Mercedes Mercedes     # remove tag car_makers from Mercedes 

About

Tag-based filesystem for Linux, written as OS course project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published