From b5a3c9b39059f4e50bcd7597231bef9e7ab1f000 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Mon, 9 Jan 2006 14:31:25 +0000 Subject: updated FAQ and Filesystems --- FAQ | 183 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 180 insertions(+), 3 deletions(-) (limited to 'FAQ') diff --git a/FAQ b/FAQ index 758ff25..5a79d8c 100644 --- a/FAQ +++ b/FAQ @@ -1,4 +1,4 @@ -This was generated on 2005/09/27 from +This was generated on 2006/01/09 from http://fuse.sourceforge.net/wiki/index.php/FAQ @@ -8,8 +8,8 @@ new entries there. General ======= -How can I umount a filesystem ------------------------------ +How can I umount a filesystem? +------------------------------ Filesystems mounted without sysadmin privileges can be umounted with the command @@ -46,6 +46,53 @@ but it turned out to be an unfortunate choice. The author has since vowed never to name a project after a common term, not even anything found more than a handful of times on Google. +Is it possible to mount a fuse filesystem from fstab? +----------------------------------------------------- + +Yes, from version 2.4.0 this is possible. The filesystem must adhere +to some rules about command line options to be able to work this +way. Here's an example of mounting an sshfs filesystem: + +sshfs#user@host:/ /mnt/host fuse defaults 0 0 + +The mounting is performed by the /sbin/mount.fuse helper script. + +Licensing issues +~~~~~~~~~~~~~~~~ + +Under what license is FUSE released? +------------------------------------ + +The kernel part is released under the GNU GPL. + +Libfuse is released under the GNU LGPL. + +All other parts (examples, fusermount, etc) are released under the GNU GPL. + +Under what conditions may I modify or distribute FUSE? +------------------------------------------------------ + +See the files COPYING and COPYING.LIB in the distribution. + +More information can be found at http://www.gnu.org/licenses/ + +Under what conditions may I distribute a filesystem which uses libfuse? +----------------------------------------------------------------------- + +See COPYING.LIB in the distribution. + +In simple terms as long as you are linking dynamically (the default) +there are no limitations on linking with libfuse. For example you may +distribute the filesystem itself in binary form, without source code, +under any propriatery license. + +Under what conditions may I distribute a filesystem that uses the raw +--------------------------------------------------------------------- +kernel interface of FUSE? +------------------------- + +There are no restrictions whatsoever for using the raw kernel interface. + API === @@ -102,9 +149,106 @@ the operation? Yes: fuse_get_context()->uid, etc. +How should threads be started? +------------------------------ + +Miscellaneous threads should be started from the init() method. +Threads started before fuse_main() will exit when the process goes +into the background. + +Is it possible to store a pointer to private data in the +-------------------------------------------------------- +fuse_file_info structure? +------------------------- + +Yes, the 'fh' filed is for this purpose. This filed may be set in the +open() and create() methods, and is available in all other methods +having a struct fuse_file_info parameter. Note, that changing the +value of 'fh' in any other method as open() or create() will have no +affect. + +Since the type of 'fh' is unsigned long, you need to use casts when +storing and retrieving a pointer. Under Linux (and most other +architectures) an unsigned long will be able to hold a pointer. + +This could have been done with a union of 'void *' and 'unsigned long' +but that would not have been any more type safe as having to use +explicit casts. The recommended type safe solution is to write a +small inline function that retrieves the pointer from the +fuse_file_info structure. + Problems ======== +Version problems +~~~~~~~~~~~~~~~~ + +Why do I get Connection Refused after mounting? +----------------------------------------------- + +Library is too old (< 2.3.0) + +You can check which version of the library is being used by foofs by +doing 'ldd path_to_foofs'. It will return something like this + + libfuse.so.2 => /usr/local/lib/libfuse.so.2 (0xb7fc9000) + libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7fb9000) + libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb7f39000) + libc.so.6 => /lib/tls/libc.so.6 (0xb7e04000) + +Then do 'ls -l path_to_libfuse' + +> ls -l /usr/local/lib/libfuse.so.2 +lrwxrwxrwx 1 root root 16 Sep 26 13:41 /usr/local/lib/libfuse.so.2 -> libfuse.so.2.2.1 + +Why does fusermount fail with an Unknown option error? +------------------------------------------------------ + +Errors like 'fusermount: Unknown option -o' or 'fusermount: Unknown +option --' mean, that an old version of fusermount is being used. You +can check by doing 'which fusermount'. + +If you installed FUSE from source, then this is probably because there +exists a binary package on your system which also contains a +fusermount program, and is found first in the path, e.g. in +/usr/bin/fusermount. + +The solution is to remove the binary package. + +Installation problems +~~~~~~~~~~~~~~~~~~~~~ + +Why is there an error loading shared libraries? +----------------------------------------------- + +If you get the following error when starting a FUSE-based filesystem: + + foofs: error while loading shared libraries: libfuse.so.2: + cannot open shared object file: No such file or directory + +check /etc/ld.so.conf for a line containing '/usr/local/lib'. If it's +missing, add it, and run ldconfig afterwards. + +Why doesn't mounting as user work if installing FUSE from a package? +-------------------------------------------------------------------- + +Distributions often package 'fusermount' without the suid bit, or only +executable to the 'fuse' group. + +This results in the following message, when trying to mount a +filesystem as an unprivileged user: + + fusermount: mount failed: Operation not permitted + +The simplest solution is to change the mode of 'fusermount': + + chmod 4755 /usr/bin/fusermount + +Note, you may have to do this after each upgrade. + +Other problems +~~~~~~~~~~~~~~ + Why are some bytes zeroed when reading a file? ---------------------------------------------- @@ -118,6 +262,39 @@ option, or by setting the direct_io field of fuse_file_info at open) the read can return a smaller value than requested. In this case the end of file can be signalled by returning zero. +Why does cp return operation not permitted when copying a file with no +---------------------------------------------------------------------- +write permissions for the owner? +-------------------------------- + +"cp" calls open(2) with read-only permissions and O_CREAT, the purpose +being to atomically obtain a read/write file handle and make the file +read-only. Unfortunately, this does not work very well in fuse, since +you first get a mknod, and then an open call. At the time of open, you +can't distinguish easily wether this is the first open issued by cp, +or another process trying to write a read-only file. + +Defining the 'create' method solves this problem, however this +requires a Linux kernel version of at least 2.6.15 and libfuse version +2.5 or greater. + +There can be other workarounds, however the easy one is to use the +"default_permissions" mount option, and to avoid checking permissions +on open. If you store files on a filesystem, this can get tricky +because you will have to change the file mode to allow writing. Using +the stateful API (i.e. returning an handle on open) will simplify +things. In this case, and using "-o default_permissions", when +implementing the open call you have to: + +1. check if the open is in write mode (i.e. mode has O_RDWR or O_WRONLY) + +2. in that case (in mutual exclusion with other open, getattr + etc. calls on the same file) change the mode from "M" to "M OR + 0o200" + +3. open the file, change back the mode even in case of errors, and + return the obtained handle + Why doesn't find work on my filesystem? --------------------------------------- -- cgit v1.2.3