Fuse module

This text is about a port of [WWW]Fuse to FreeBSD. To get the context of this work, see my personal wiki page, CsabaHenk.

In the sequel I describe how to get started with Fuse under FreeBSD.

The main part of Fuse for FreeBSD is a kernel module which provides a kernel messaging interface to the Fuse library in userspace which is compatible with that of the Linux module. The userspace part is pretty portable. A lightweight patch is enough to get that compile and work.

The module can be excepted to work with RELENG_6 and HEAD (ie., 7.x) snapshots.

What can be considered as a public homepage for the project is [WWW]http://wikitest.freebsd.org/moin.cgi/FuseFilesystem; for updates, further info go there. Get in contact with me via the soc-chenk email addrees of the FreeBSD organization (freebsd.org).

Installation

I'll describe here the installation of the core Fuse components and a Fuse based filesystem, sshfs, which lets you mount a machine remotely by means of an ssh conncetion.

Downloads

You need to get a bunch of things.

Compilation

Let's start with the module.

Now go for the fuse userspace. We will assume that you have my module at ../fuse4bsd.

You have successfully installed fuse libs. Go on to sshfs.

Congratulations, you have all components prepared!

Using the Fuse based ssh filesystem

Here we will show how to setup Fuse so that non-privileged users can use it, too.

As the superuser, do

kldload fuse_module/fuse.ko
sysctl vfs.usermount=1

Now you'll have to act as a user belonging to the operator group. (A different access policy could be set by [WWW]devfs(8); eg., deleting all barriers would look like devfs rule add path 'fuse*' mode 666. Think of permissions of fuse devices directly as mount permissions of Fuse filesystems.)

Proceed on with the user you chose (nevertheless, we will assume you use the same user as the one who did the installation).

Pick your favourite ssh accessible account (though maybe you'd better stick to servers running OpenSSH -- I've seen commits in sshfs' CVS for better interoperability with other servers, which show there might occur problems with them), say, it's foo@bar.baz.

Go to sshfs' directory. First prepare the mount:

mkdir -p ~/fuse &&
export LD_LIBRARY_PATH=~/meta/fuse-2.4.0/lib/
and also make sure that mount_fusefs (of FreeBSD Fuse) is in your path. Then do:
mount_fusefs auto ~/fuse ./sshfs foo@bar.baz:

If you want the daemon print the messages she gots from the kernel, you can append the -d flag to the end of the mount command (standard Fuse flag, as debug). However, this can be a little annoying, as the daemon will go to background, but will also muck up the terminal with its reports (unlike when you use -d under Linux). To keep it foreground, you can do the following:

env FUSE_DEV_NAME=/dev/fuse0 ./sshfs foo@bar.baz: -d
Then open another terminal, and type there:
mount_fusefs /dev/fuse0 ~/fuse
(If /dev/fuse0 happens to be busy, use any other free Fuse device /dev/fuseN; most free of all is the one who doesn't exist.)

Finally, you will have to umount the filesystem by umount ~/fuse.

For more details, see the man page (mount_fusefs(8)).

Miscellaneous

You can get more info on Fuse based filesystems under FreeBSD at the Fuse wiki, [WWW]http://fuse.sourceforge.net/wiki/index.php/FileSystemsOnFreeBSD. Feel encouraged to add your experiences.

Bugs

See the respective section of mount_fusefs(8).

TODO