Question

Is there a way to bind one directory to another via fusermount, specifically for Ubuntu? I would like to avoid using just mount so that sudo is not needed, and I would also like to avoid the need to compile extra driver types (I'm hoping that binding a directory is a standard type).

Here are my hit-and-miss attempts:

$ cat /etc/issue
Ubuntu 12.04.2 LTS \n \l
$ fusermount --version
fusermount version: 2.8.6
$ ls
src
$ fusermount ~+/src ~+/dest
fusermount: extra arguments after the mountpoint
$ fusermount -o -t none ~+/src ~+/dest
fusermount: extra arguments after the mountpoint
$ fusermount -o -t rw ~+/src ~+/dest
fusermount: extra arguments after the mountpoint
$ fusermount -o -t bind ~+/src ~+/dest
fusermount: extra arguments after the mountpoint
$ fusermount -o --bind ~+/src ~+/dest
fusermount: extra arguments after the mountpoint
$ fusermount --bind ~+/src ~+/dest
fusermount: unrecognized option '--bind'

The following worked for mount --bind (had to create directory first)

$ sudo mount --bind ~+/src ~+/dest
Was it helpful?

Solution

Well, came back to this question, Googled, saw the FUSE manual, this post, then bindfs which does exactly what I had wanted.

This usage worked for me:

bindfs -n ~+/src ~+/dest

Without -n, --no-allow-other, then FUSE gave me an error:

fusermount: failed to open /etc/fuse.conf: Permission denied
fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf

Odd that it wants to allow other users by default.

It's available in Ubuntu 12.04,

sudo apt-get install bindfs
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top