Skip to content

GhostFS/ghostfs

 
 

Repository files navigation

Ghost File System or simply GhostFS

Say hi to our mascot, his name is Ghoster:
    https://github.com/raphaelsc/ghostfs/blob/master/images/ghoster.jpg

File system created to allow an user to randomly access content of a remote
file as if the file were stored locally.

What does make GhostFS different than other network-based file systems?
To answer that, let me first introduce a new term:
Ghost File: Think of it as a symbolic link that is linked to a remote file.
GhostFS allows coexistence of ghost files that are linked to remote files from
different servers that use different protocols.
GhostFS was also designed to easily support new protocols, even those ones that
have no notion of files, such as SQL. GhostFS can also be seen as a powerful
tool to interact with cloud storage services, such as Google Drive and Dropbox.

Only HTTP and HTTPS protocols are supported at the moment, but the goal is to
add support to other protocols, such as FTP, SCP and even SQL.

GhostFS takes advantange of Linux filesystem interface to allow users to use
their existing tools on files stored in a GhostFS mount point.

How to build it?

Installing required packages for 
    Fedora:
    yum install -y fuse fuse-devel libcurl libcurl-devel python-devel
    
    Debian:
    apt-get install -y curl libcurl-dev fuse libfuse-dev libboost-all-dev libpython-dev

Build the project with:
    cmake .; make;

Install it with:
    sudo make install
    
Create a deb or rpm package with:
    sudo make package

How to use it?

1) Mount the file system:
    ./ghostfs /path/to/mount/point
2) Create an empty file:
    touch /path/to/mount/point/<file>
3) Set attribute url of the empty file using extended attribute:
    setfattr -n url -v http://<address> /path/to/mount/point/<file>

For debugging, GhostFS may be mounted as follow:
    ./ghostfs -d /path/to/mount/point

Steps 1, 2 and 3 can be done in a single step with:
    ./gmount /path/to/mount/point http://<address> <file>

And that's all. Now you can randomly access content of the remote file.

For example, let's do that with a remote video file:

1) Mount the file system:
    mkdir ./my_ghost_fs; ./ghostfs ./my_ghost_fs
2) Create a file in ./my_ghost_fs pointing to the remote video:
    touch ./my_ghost_fs/video.mp4
    setfattr -n url -v \
    http://bollywoodmp4.net/videos/2016/saala-khadoos/hq/saala-khadoos-bollywoodmp4-net.mp4 \
    ./my_ghost_fs/video.mp4

Now you can watch the video by opening ./my_ghost_fs/video.mp4

NOTE: In the future, we may replace extended attribute with symbolic link, so
step 2 and 3 (of 'How to use it?') would be replaced by:
    ln -s /path/to/mount/point/<file> http://<address>
Simpler, no?

NOTE: By the way, a protocol plugin system was recently added to GhostFS (kudos
to Pericles (@gogo40)), so adding support to new protocols may be relatively easy.
Take a look at /protocol for a better understanding of how it works.

For further information, feel free to reach me at:
    [email protected]

Thanks.

Releases

No releases published

Packages

No packages published

Languages

  • C++ 79.0%
  • CMake 19.6%
  • Shell 1.4%