Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| fusefs [2005/10/12 14:20] – CsabaHenk | fusefs [2022/08/15 04:58] (current) – Replace link (with text) to taken over domain/project page KubilayKocak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Fuse module ====== | + | ===== FUSEFS |
| - | This text is about a port of [http:// | + | FUSE (Filesystem in USErspace) implements a file system that is serviced by a userspace program. |
| - | see my personal wiki page, CsabaHenk. | + | |
| - | In the sequel I describe how to get started with Fuse under %%FreeBSD%%. | + | ===== History ===== |
| - | The main part of Fuse for %%FreeBSD%% is a kernel | + | The FUSE module |
| - | 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. | + | * CsabaHenk, for Google Summer of Code 2007 (" |
| + | * IlyaPutsikau, | ||
| + | * AttilioRao and GeorgeNevilleNeil finished Ilya's %%GSoC%% project and imported it into the base system in 2012. | ||
| + | * AlanSomers overhauled the driver and added a test suite in 2019, sponsored by the %%FreeBSD%% Foundation. | ||
| - | What can be considered as a public homepage for the project is | + | ===== Status ===== |
| - | [[[http:// | + | |
| - | for updates, further info go there. Get in contact with me via | + | |
| - | the '' | + | |
| - | ('' | + | |
| - | ===== Installation ===== | + | As of 31-July-2019, |
| + | * FUSE_IOCTL | ||
| + | * BATCH_FORGET | ||
| + | * flock(2) (implemented in-kernel, so it doesn' | ||
| + | * posix_fallocate(2) | ||
| + | * FUSE_AUTO_INVAL_DATA | ||
| + | * FUSE_READDIRPLUS | ||
| + | * poll(2) (works for pipes and sockets, but not for regular files) | ||
| + | * FUSE_ASYNC_DIO | ||
| + | * FUSE_NO_OPEN_SUPPORT | ||
| - | I'll describe here the installation of the core Fuse components and a Fuse | + | ===== Links ===== |
| - | based filesystem, //sshfs//, which lets you mount a machine remotely by means | + | |
| - | of an ssh conncetion. | + | |
| - | ==== Downloads ==== | + | * [[https:// |
| - | You need to get a bunch of things. | + | ---- |
| - | * Fuse itself. Get Fuse 2.4.0 from their [http:// | + | {{tag>Stale}} |
| - | * The %%FreeBSD%% module. Source tarballs are provided at [[[http:// | + | {{tag>NeedsContent}} |
| - | + | ||
| - | < | + | |
| - | darcs get http:// | + | |
| - | | + | |
| - | | + | |
| - | (you can use this latter link for online source code browsing). | + | |
| - | + | ||
| - | '' | + | |
| - | + | ||
| - | <!> ''' | + | |
| - | * Fuse sshfs. The latest release (1.2 as of writing this) should do, fetch the sshfs-fuse package also from the | + | |
| - | | + | |
| - | + | ||
| - | === Compilation === | + | |
| - | + | ||
| - | Let's start with the module. | + | |
| - | + | ||
| - | * From your Fuse distribution copy over {{{kernel/ | + | |
| - | * For older snapshots, you'll need a special make flag. If you use a 6.x kernel and its {{{__FreeBSD_version}}} is lesser than | + | |
| - | | + | |
| - | | + | |
| - | {{{ | + | |
| - | awk '/# | + | |
| - | | + | |
| - | * Type {{{make}}}. If you want normal quantity of debug output, use the make flag {{{-DDEBUG2G}}}, | + | |
| - | use {{{-DDEBUG}}}. | + | |
| - | + | ||
| - | Now go for the fuse userspace. We will assume that you have my module at {{{../ | + | |
| - | + | ||
| - | * Apply the patch with {{{ | + | |
| - | patch -Np1 < ../ | + | |
| - | * Do | + | |
| - | {{{ | + | |
| - | cp ../ | + | |
| - | cp ../ | + | |
| - | (as {{{fuse_kernel.h}}} is used by both of kernel and userspace, the necessary patch is separated from the all-over userspace patch, | + | |
| - | and is kept by the module code). | + | |
| - | * We will do a non-privileged install (I'd say that's easier than set up a jail), I'll use | + | |
| - | | + | |
| - | Type the following commands: | + | |
| - | {{{ | + | |
| - | mkdir junk && | + | |
| - | ln -s / | + | |
| - | ln -s / | + | |
| - | echo 'echo " | + | |
| - | echo 'echo " | + | |
| - | chmod a+x junk/mkdir junk/ | + | |
| - | | + | |
| - | | + | |
| - | make && | + | |
| - | make install)}}} | + | |
| - | + | ||
| - | You have successfully installed fuse libs. Go on to sshfs. | + | |
| - | + | ||
| - | * Edit {{{sshfs.c}}}: | + | |
| - | * Type | + | |
| - | {{{ | + | |
| - | env PKG_CONFIG_PATH=~/ | + | |
| - | + | ||
| - | Congratulations, | + | |
| - | + | ||
| - | === 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/ | + | |
| - | 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 [http:// | + | |
| - | all barriers would look like {{{devfs rule add path ' | + | |
| - | 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=~/ | + | |
| - | 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 '' | + | |
| - | 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=/ | + | |
| - | Then open another terminal, and type there: | + | |
| - | {{{ | + | |
| - | mount_fusefs /dev/fuse0 ~/fuse}}} | + | |
| - | (If {{{/ | + | |
| - | who doesn' | + | |
| - | + | ||
| - | Finally, you will have to umount the filesystem by {{{umount ~/ | + | |
| - | + | ||
| - | 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, | + | |
| - | [http:// | + | |
| - | + | ||
| - | == Bugs == | + | |
| - | + | ||
| - | See the respective section of {{{mount_fusefs(8)}}}. | + | |
| - | + | ||
| - | == TODO == | + | |
| - | * Make autotools play nice with Fuse (generating configure files doesn' | + | |
| - | + | ||
| - | /!\ ''' | + | |
| - | * Implement attr/name caching (with timeouts) | + | |
| - | * Implement various missing parts, optimize | + | |
| - | + | ||
| - | </ | + | |