Afuse development and hosting have moved to:

https://github.com/pcarrier/afuse

This page remains for historical purposes only.

Afuse - An automounter implemented with FUSE

Overview
Download and Installation
Example Usage
More Information

Overview

Afuse is an automounting file system implemented in user-space using FUSE. Afuse currently implements the most basic functionality that can be expected by an automounter; that is it manages a directory of virtual directories. If one of these virtual directories is accessed and is not already automounted, afuse will attempt to mount a filesystem onto that directory. If the mount succeeds the requested access proceeds as normal, otherwise it will fail with an error. See the example below for a specific usage scenario.

The advantage of using afuse over traditional automounters is that afuse is designed to run entirely in user-space by individual users. This way an automounting action can take advantage of the invoking users environment, for example allowing access to an ssh-agent for password-less sshfs mounts, or allowing access to a graphical environment to get user input to complete a mount (i.e. popping up a window asking for a password).

Afuse is distributed under the GPL license, details of which can be found in the COPYING file provided in afuse distributions. Please note that while afuse is intended to be useful it is provided with ABSOLUTELY NO WARRANTY.

Download and Installation

To download the latest release please visit the afuse SourceForge project page. A working installation of FUSE version 2.3 or greater is also required to use afuse. Please follow your operating systems install procedure to install fuse, or the instructions on the FUSE website.

Once a suitable version of FUSE is installed and an afuse release downloaded, the following should install and make afuse ready for use:
tar xzvf afuse-<VERSION>.tar.gz
cd afuse-<VERSION>
./configure
make
make install # <- run as root

Example Usage

Precisely what mount operation is performed when a virtual directory is accessed depends on how afuse is invoked. For example, afuse could be used in conjunction with sshfs to automount remote filesystems over SSH like so:

Start afuse managing a directory called ~/sshfs/ using sshfs for automounting:
afuse -o mount_template="sshfs %r:/ %m" -o unmount_template="fusermount -u -z %m" ~/sshfs/
(note: the unmount template above specifies a lazy unmount (-z), this is important for a clean unmount)
Now assuming the current user can log into foobarhost.com without a password, a listing of the root directory of foobarhost.com can be achieved in a shell as follows:
ls ~/sshfs/foobarhost.com/
Indeed any virtual directory which is a valid arguemnt in place of %r in the command above can be used to browse remote filesystems, for example to browse foobarhost.com's filesystems as user tmpvar we could use:
ls ~/sshfs/tmpvar@foobarhost.com/
The only limitation is that the mount must not require any user interaction such as a password to be entered. However because afuse can be run as any user, it can be started by a user who runs an ssh-agent providing secure keys to access remote hosts without needing to enter a password.

To unmount the afuse managed filesystem use:
fusermount -u -z ~/sshfs/
This will unmount the directory and all the automounts as and when they are no longer being accessed by any processes.

More Information

For quick information on all afuse options, simply run afuse --help. For more detailed information refer to the README file included with releases.

For all other help/discussion please use the afuse-discussion mailing list, details of which can be found on the afuse SourceForge project page.

Copyright © 2006 Jacob Bower Hosted by:
SourceForge.net Logo