Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 1 | General Information |
| 2 | =================== |
| 3 | |
Miklos Szeredi | 539488e | 2005-02-02 10:17:38 +0000 | [diff] [blame^] | 4 | FUSE (Filesystem in Userspace) is a simple interface for userspace |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 5 | programs to export a virtual filesystem to the linux kernel. FUSE |
| 6 | also aims to provide a secure method for non privileged users to |
| 7 | create and mount their own filesystem implementations. |
| 8 | |
| 9 | You can download the source code releases from |
| 10 | |
Miklos Szeredi | a2c5e56 | 2004-10-19 22:01:21 +0000 | [diff] [blame] | 11 | http://sourceforge.net/projects/fuse |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 12 | |
| 13 | or alternatively you can use CVS to get the very latest development |
Miklos Szeredi | 0a7077f | 2001-11-11 18:20:17 +0000 | [diff] [blame] | 14 | version by setting the cvsroot to |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 15 | |
Miklos Szeredi | a2c5e56 | 2004-10-19 22:01:21 +0000 | [diff] [blame] | 16 | :pserver:anonymous@cvs.sourceforge.net:/cvsroot/fuse |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 17 | |
Miklos Szeredi | 0a7077f | 2001-11-11 18:20:17 +0000 | [diff] [blame] | 18 | and checking out the 'fuse' module. |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 19 | |
| 20 | Installation |
| 21 | ============ |
| 22 | |
Miklos Szeredi | 94ed76a | 2004-07-26 19:38:45 +0000 | [diff] [blame] | 23 | ./configure |
| 24 | make |
| 25 | make install |
Miklos Szeredi | 539488e | 2005-02-02 10:17:38 +0000 | [diff] [blame^] | 26 | modprobe fuse |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 27 | |
Miklos Szeredi | 94ed76a | 2004-07-26 19:38:45 +0000 | [diff] [blame] | 28 | Also see the file 'INSTALL' |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 29 | |
| 30 | How To Use |
| 31 | ========== |
| 32 | |
| 33 | FUSE is made up of three main parts: |
| 34 | |
Miklos Szeredi | 94ed76a | 2004-07-26 19:38:45 +0000 | [diff] [blame] | 35 | - A kernel filesystem module |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 36 | |
Miklos Szeredi | 94ed76a | 2004-07-26 19:38:45 +0000 | [diff] [blame] | 37 | - A userspace library |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 38 | |
Miklos Szeredi | 94ed76a | 2004-07-26 19:38:45 +0000 | [diff] [blame] | 39 | - A mount/unmount program |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 40 | |
| 41 | |
| 42 | Here's how to create your very own virtual filesystem in five easy |
Miklos Szeredi | ddc862a | 2002-01-09 13:46:10 +0000 | [diff] [blame] | 43 | steps (after installing FUSE): |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 44 | |
| 45 | 1) Edit the file example/fusexmp.c to do whatever you want... |
| 46 | |
| 47 | 2) Build the fusexmp program |
| 48 | |
Miklos Szeredi | 94ed76a | 2004-07-26 19:38:45 +0000 | [diff] [blame] | 49 | 3) run 'example/fusexmp /mnt/fuse -d' |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 50 | |
Miklos Szeredi | 94ed76a | 2004-07-26 19:38:45 +0000 | [diff] [blame] | 51 | 4) ls -al /mnt/fuse |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 52 | |
Miklos Szeredi | 0a7077f | 2001-11-11 18:20:17 +0000 | [diff] [blame] | 53 | 5) Be glad |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 54 | |
Miklos Szeredi | 0a7077f | 2001-11-11 18:20:17 +0000 | [diff] [blame] | 55 | If it doesn't work out, please ask! Also see the file 'include/fuse.h' for |
| 56 | detailed documentation of the library interface. |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 57 | |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 58 | Security |
| 59 | ======== |
| 60 | |
| 61 | If you run 'make install', the fusermount program is installed |
| 62 | set-user-id to root. This is done to allow normal users to mount |
| 63 | their own filesystem implementations. |
| 64 | |
Miklos Szeredi | 0a7077f | 2001-11-11 18:20:17 +0000 | [diff] [blame] | 65 | There must however be some limitations, in order to prevent Bad User from |
| 66 | doing nasty things. Currently those limitations are: |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 67 | |
| 68 | - The user can only mount on a mountpoint, for which it has write |
| 69 | permission |
| 70 | |
| 71 | - The mountpoint is not a sticky directory which isn't owned by the |
| 72 | user (like /tmp usually is) |
| 73 | |
Miklos Szeredi | 0a7077f | 2001-11-11 18:20:17 +0000 | [diff] [blame] | 74 | - No other user (including root) can access the contents of the mounted |
Miklos Szeredi | 8cffdb9 | 2001-11-09 14:49:18 +0000 | [diff] [blame] | 75 | filesystem. |
Miklos Szeredi | 539488e | 2005-02-02 10:17:38 +0000 | [diff] [blame^] | 76 | |
| 77 | Configuration |
| 78 | ============= |
| 79 | |
| 80 | Some options regarding mount policy can be set in the file |
| 81 | '/etc/fuse.conf' |
| 82 | |
| 83 | Currently these options are: |
| 84 | |
| 85 | mount_max = NNN |
| 86 | |
| 87 | Set the maximum number of FUSE mounts allowed to non-root users. |
| 88 | The default is 1000. |
| 89 | |
| 90 | user_allow_other |
| 91 | |
| 92 | Allow non-root users to specify the 'allow_other' or 'allow_root' |
| 93 | mount options. |
| 94 | |
| 95 | |
| 96 | Mount options |
| 97 | ============= |
| 98 | |
| 99 | These are FUSE specific mount options that can be specified for all |
| 100 | filesystems: |
| 101 | |
| 102 | default_permissions |
| 103 | |
| 104 | By default FUSE doesn't check file access permissions, the |
| 105 | filesystem is free to implement it's access policy or leave it to |
| 106 | the underlying file access mechanism (e.g. in case of network |
| 107 | filesystems). This option enables permission checking, restricting |
| 108 | access based on file mode. This is option is usually useful |
| 109 | together with the 'allow_other' mount option. |
| 110 | |
| 111 | allow_other |
| 112 | |
| 113 | This option overrides the security measure restricting file access |
| 114 | to the user mounting the filesystem. This option is by default only |
| 115 | allowed to root, but this restriction can be removed with a |
| 116 | configuration option described in the previous section. |
| 117 | |
| 118 | allow_root |
| 119 | |
| 120 | This option is similar to 'allow_other' but file access is limited |
| 121 | to the user mounting the filesystem and root. |
| 122 | |
| 123 | kernel_cache |
| 124 | |
| 125 | This option disables flushing the cache of the file contents on |
| 126 | every open(). This should only be enabled on filesystems, where the |
| 127 | file data is never changed externally (not through the mounted FUSE |
| 128 | filesystem). Thus it is not suitable for network filesystems and |
| 129 | other "intermediate" filesystems. |
| 130 | |
| 131 | NOTE: if this option is not specified (and neither 'direct_io') data |
| 132 | is still cached after the open(), so a read() system call will not |
| 133 | always initiate a read operation. |
| 134 | |
| 135 | large_read |
| 136 | |
| 137 | Issue large read requests. This can improve performance for some |
| 138 | filesystems, but can also degrade performance. This option is only |
| 139 | useful on 2.4.X kernels, as on 2.6 kernels requests size is |
| 140 | automatically determined for optimum performance. |
| 141 | |
| 142 | direct_io |
| 143 | |
| 144 | This option disables the use of page cache (file content cache) in |
| 145 | the kernel for this filesystem. This has several affects: |
| 146 | |
| 147 | - Each read() or write() system call will initiate one or more |
| 148 | read or write operations, data will not be cached in the |
| 149 | kernel. |
| 150 | |
| 151 | - The return value of the read() and write() system calls will |
| 152 | correspond to the return values of the read and write |
| 153 | operations. This is useful for example if the file size is not |
| 154 | known in advance (before reading it). |
| 155 | |
| 156 | max_read=N |
| 157 | |
| 158 | With this option the maximum size of read operations can be set. |
| 159 | The default is infinite. Note that the size of read requests is |
| 160 | limited anyway to 32 pages (which is 128kbyte on i386). |
| 161 | |
| 162 | hard_remove |
| 163 | |
| 164 | The default behavior is that if an open file is deleted, the file is |
| 165 | renamed to a hidden file (.fuse_hiddenXXX), and only removed when |
| 166 | the file is finally released. This relieves the filesystem |
| 167 | implementation of having to deal with this problem. This option |
| 168 | disables the hiding behavior, and files are removed immediately in |
| 169 | an unlink operation (or in a rename operation which overwrites an |
| 170 | existing file). |
| 171 | |
| 172 | debug |
| 173 | |
| 174 | Turns on debug information printing by the library. |
| 175 | |
| 176 | fsname=NAME |
| 177 | |
| 178 | Sets the filesystem name. The default is the program name. |
| 179 | |