NAME¶
mount_fusefs —
mount a Fuse file system
daemon
SYNOPSIS¶
| mount_fusefs |
[-A]
[-S]
[-v]
[-D
fuse_daemon]
[-O
daemon_opts]
[-s
special]
[-m node]
[-h]
[-V]
[-o option
...] special node
[fuse_daemon ...] |
DESCRIPTION¶
The most basic way of usage is as follows: before calling
mount_fusefs, one starts a fuse daemon on the given
special (in practice, the daemon gets one automatically,
which can then be indentified via
fstat(1)), and that
special file can then be mounted by
mount_fusefs.
However, the procedure of spawning a daemon can be automated so that it's also
performed by
mount_fusefs. If the command invoking a given
fuse_daemon is appended to the list of arguments,
mount_fusefs will call then
fuse_daemon via that command, in a way that
fuse_daemon will be instructed to attach itself to
special. From that on mounting goes as in the simple
case. (See also
DAEMON MOUNTS.)
The
special argument can be utilized by
mount_fusefs in the following ways:
- Basicly, it will be treated as the path of the special
file to mount.
- However, if auto is passed as
special, then mount_fusefs will
look for a suitable free fuse device by itself.
- Moreover, if special is an
integer, then it will be interpreted as the number of the file descriptor
of an already open fuse device (used when the Fuse library invokes
mount_fusefs, cf.
DAEMON MOUNTS).
The options are as follows:
- -A,
--reject-allow_other
- Prohibit the allow_other mount flag.
Intended for to be used in scripts and the sudoers(5)
file.
- -S,
--safe
- Run in safe mode, that is, reject invoking a filesystem
daemon.
- -v
- Be verbose.
- -D,
--daemon daemon
- Call the specified daemon.
- -O,
--daemon_opts opts
- Add opts to the daemon's command
line.
- -s,
--special special
- Use special as special.
- -m,
--mountpath node
- Mount on node.
- -h,
--help
- Show help.
- -V,
--version
- Show version information.
- -o
- Mount options are specified via -o. The
following options are available (and also their negated versions, by
prefixing them with “no”):
- default_permissions
- Enable traditional (file mode based) permission
checking in kernel.
- allow_other
- Do not apply
STRICT ACCESS POLICY.
Only root can use this option.
- max_read=n
- Limit size of read requests with
n.
- private
- Refuse shared mounting of the daemon. This is the
default behaviour, to allow sharing, use expicitly
-o noprivate.
- neglect_shares
- Don't refuse unmounting if there are secondary
mounts.
- push_symlinks_in
- Prefix absolute symlinks with mountpoint.
Besides the above mount options, there is a set of pseudo-mount options which
are supported by the Fuse library. One can list these by passing
-h to a Fuse daemon. Most of these options have effect only
on the behaviour of the daemon (that is, their scope is limited to userspace).
However, there are some which do require in-kernel support. Currently the
following ones are supported by the kernel:
- direct_io
- Bypass the buffer cache system.
- kernel_cache
- By default, cached buffers of a given file are flushed at
each open(2). This option disables this behaviour.
DAEMON MOUNTS¶
Usually users don't need to use
mount_fusefs directly, as the
Fuse library enables Fuse daemons to invoke
mount_fusefs by
themselves. That is,
fuse_daemon mountpoint
has the same effect as
mount_fusefs auto mountpoint
fuse_daemon
This is the recommended way of usage, unless you want to go beyond basic usage
(eg, run daemon on a low privilege level, but mount it as root).
STRICT ACCESS POLICY¶
The strict access policy for Fuse filesystems lets one to use the filesystem
only if the filesystem daemon has the same credentials (uid, real uid, gid,
real gid) as the user.
This is applied for Fuse mounts by default, and only root can mount without the
strict access policy (cf. the
allow_other mount option).
The reason is to shield users from the daemon “spying” on their I/O
activities.
Users might opt for willingly relax strict access policy (as far they are
concerned) by doing their own secondary mount (cf.
SHARED MOUNTS).
SHARED MOUNTS¶
A Fuse daemon can be shared, ie. mounted multiple times. When doing the first
(primary) mount, the spawner and the mounter of the daemon must have the same
uid, or the mounter should be the superuser.
After the primary mount is in place, secondary mounts can be done by anyone
(unless this feature is disabled by
private). The behaviour
of a secondary mount is analogous to that of symbolic links: they redirect all
filesystem operations to the primary mount.
Doing a secondary mount is like signing an agreement: by this action, the
mounter agrees that the Fuse daemon can trace her I/O activities. From that
on, she is not banned from using the filesystem (either via her own mount or
via the primary mount), regardless whether
allow_other is
used or not.
The device name of a secondary mount is the device name of the corresponding
primary mount, followed by a '#' character and the index of the secondary
mount, like
/dev/fuse0#3.
SECURITY¶
System administratos might want to use a custom mount policy (ie., one going
beyond the
vfs.usermount sysctl). The primary tool for
such purposes is
sudo(8). However, given that
mount_fusefs is capable of invoking an arbitrary program,
one must be careful about this.
mount_fusefs is designed in
a way such that it makes that easy. For this purpose, there are options which
disable certain risky features (cf.
-S and
-A), and command line parsing is done in a flexible way:
mixing options and non-options allowed, but processing them stops at the third
non-option argument (after the first two has been utilized as device and
mountpoint). The rest of the command line specifies the daemon and its
arguments. (Alternatively, the daemon, the special and the mount path can be
specified using the respective options.) Note that
mount_fusefs ignores the environment variable
POSIXLY_CORRECT and always behaves as described.
In general, to be as scripting /
sudoers(5) friendly as
possible, no information has a fixed position in the command line, but once a
given piece of information is provided, subsequent arguments/options cannot
override it (maybe with the exception of some non-critical ones).
ENVIRONMENT¶
MOUNT_FUSEFS_SAFE
- Setting this has the same effect as the
-S option.
MOUNT_FUSEFS_VERBOSE
- Setting this has the same effect as the
-v option.
MOUNT_FUSEFS_IGNORE_UNKNOWN
- If this is set, mount_fusefs will ignore
uknown mount options.
MOUNT_FUSEFS_CALL_BY_LIB
- Adjust behaviour to the needs of the FUSE library.
Currently it has effect on help output.
Although the following variables don't have effect on
mount_fusefs itself, they affect the behaviour of fuse
daemons:
FUSE_DEV_NAME
- Device to get attached to. If not set, the multiplexer path
/dev/fuse is used.
FUSE_DEV_FD
- File desciptor of an opened Fuse device to use. Overrides
FUSE_DEV_NAME.
FUSE_NO_MOUNT
- If this is set, the library won't attempt to mount the
filesystem, even if a mountpoint argument is supplied.
FILES¶
- /dev/fuseN
- Fuse devices by which the kernel and Fuse daemons can
communicate.
- /dev/fuse
- The multiplexer path. An open(2)
performed on it automatically gets passed to a free Fuse device by the
kernel (which might be just created for this puprose).
EXAMPLES¶
Mounting the example filesystem of the Fuse distribution (from its directory):
either
./fusexmp /mnt/fuse
or
mount_fusefs auto /mnt/fuse
./fusexmp
Doing the same in two steps, using
/dev/fuse0:
FUSE_DEV_NAME=/dev/fuse0 ./fusexmp
&&
mount_fusefs /dev/fuse0 /mnt/fuse
A script wrapper for fusexmp which ensures that
mount_fusefs
doesn't call any external utility and also provides a hacky (non race-free)
automatic device selection:
#!/bin/sh -e
n=`ls /dev/fuse* | awk 'END{ print FNR
}'`
FUSE_DEV_NAME=/dev/fuse$n fusexmp
mount_fusefs -S /dev/fuse$n /mnt/fuse
“$@”
A better (race-free) script wrapper:
#!/bin/sh -e
exec 3<>/dev/fuse
FUSE_DEV_FD=3 fusexmp
mount_fusefs -S 3 /mnt/fuse
“$@”
SEE ALSO¶
fstat(1),
mount(8),
umount(8),
sudo(8)
CAVEATS¶
Secondary mounts are to be unmounted via their device name. If they attempted to
be unmounted via their filesystem root path, the unmount request will be
forwarded to the primary mount path. In general, unmounting by device name is
less error-prone than by mount path (although the latter will also work under
normal circumstances).
If the daemon is specified via the
-D and
-O
options, it will be invoked via
system(3), and the daemon's
command line will be also appended a “&” sygill, so that we
don't have to wait for its termination. That is, you'd better use a simple
command line when invoking the daemon via these options.
HISTORY¶
mount_fusefs appears as the part of the FreeBSD implementation
of the Fuse userspace filesystem framework (see
http://fuse.sourceforge.net).
This user interface is FreeBSD specific.
BUGS¶
special is treated as a multiplexer if and only if it's
literally the same as
auto or
/dev/fuse.
Other paths which are equivalent with
/dev/fuse (eg.,
/../dev/fuse) are not.