Search code examples
linuxfilesystemsmountfusemount-point

Mount using offline file system (OFS+FUSE)


I am trying to explore OFS (Offline file system) built on the top of FUSE and still exploring it.

http://offlinefs.sourceforge.net/wiki/

I installed it on both Fedora and Ubuntu 14.04,however whenever I try to mount any local directory using mount utility, I get the “Transport endpoint not connected” for mount directory.

This is how I am running it :

mount –t ofs file:/home/user/Downloads/src /home/user/Downloads/mountdir

The above executes without error and if I run mount command on ../mountdir ,it correctly says

ofs on /mountdir type fuse.ofs.

However when I try to browse /mountdir I get “Transport endpoint not connected”.I even tried unmounting and restarting the machine,no use!

Can someone point me to a right direction.


Solution

  • You're using it incorrectly, you must have two forward slashes in the URI that is specified as the mount device i.e. file://.

    As an e.g.

    $ sudo mount -t ofs file://usr /tmp/mnt
    $ ls /tmp/mnt
    bin/  etc/  games/  include/  lib/  lib32/  libx32/  local/  sbin/  share/  src/
    $ sudo umount /tmp/mnt
    

    with a single file:/ we have:

    $ sudo mount -t ofs file:/usr /tmp/mnt
    $ ls /tmp/mnt
    ls: cannot access /tmp/mnt: Transport endpoint is not connected
    $ sudo umount /tmp/mnt
    

    Now if you're intending to use a remote filesystem with OFS, which is the primary use-case, you have to first install the relevant remote filesystem packages on the OS you're using, then use, for example, if we've got cifs, which is the newer name for smb/samba:

    sudo mount -t ofs cifs://127.0.0.1/Music /tmp/music
    

    Now, if you need to pass options to cifs, such as the password/username/a config file, you can use the remoteoptions parameter, so for example for guest account access:

    sudo mount -t ofs -o remoteoptions=guest cifs://127.0.0.1/Music /tmp/music
    

    or, if you're using a credentials file (see mount.cifs manual page), you can use:

    sudo mount -t ofs -o remoteoptions=credentials=/etc/remotecreds.conf cifs://127.0.0.1/Music /tmp/music
    

    for remote options, you use a : as the separator (it gets swapped for a , when passed into the underlying mount command), so to mount as an explicit user/password:

    sudo mount -t ofs -o remoteoptions=username=mike:password=mike1 cifs://127.0.0.1/Music /tmp/music