blob: a37044ac6fc978b9b4e681e668cb11e4a1eaed27 [file] [log] [blame]
Miklos Szeredi8cffdb92001-11-09 14:49:18 +00001General Information
2===================
3
Miklos Szeredi539488e2005-02-02 10:17:38 +00004FUSE (Filesystem in Userspace) is a simple interface for userspace
Miklos Szeredie38dc3a2005-10-11 14:23:19 +00005programs to export a virtual filesystem to the Linux kernel. FUSE
Miklos Szeredi8cffdb92001-11-09 14:49:18 +00006also aims to provide a secure method for non privileged users to
7create and mount their own filesystem implementations.
8
9You can download the source code releases from
10
Miklos Szeredia2c5e562004-10-19 22:01:21 +000011 http://sourceforge.net/projects/fuse
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000012
13or alternatively you can use CVS to get the very latest development
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000014version by setting the cvsroot to
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000015
Miklos Szeredia2c5e562004-10-19 22:01:21 +000016 :pserver:anonymous@cvs.sourceforge.net:/cvsroot/fuse
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000017
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000018and checking out the 'fuse' module.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000019
Miklos Szeredie38dc3a2005-10-11 14:23:19 +000020Dependencies
21============
22
23Linux kernel version 2.4.X where X >= 21 (some vendor kernels earlier
24than this are also known to work).
25
26Linux kernel version 2.6.X where X >= 0.
27
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000028Installation
29============
30
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000031./configure
32make
33make install
Miklos Szeredi539488e2005-02-02 10:17:38 +000034modprobe fuse
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000035
Miklos Szeredib92d9782005-02-07 16:10:49 +000036You may also need to add '/usr/local/lib' to '/etc/ld.so.conf' and/or
37run ldconfig.
38
Miklos Szeredie38dc3a2005-10-11 14:23:19 +000039Linux kernels 2.6.14 or later contain FUSE support out of the box. If
40FUSE support is detected, the kernel module in this package will not
41be compiled. It is possible to override this with the
42'--enable-kernel-module' configure option.
43
Miklos Szeredib92d9782005-02-07 16:10:49 +000044For more details see the file 'INSTALL'
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000045
46How To Use
47==========
48
49FUSE is made up of three main parts:
50
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000051 - A kernel filesystem module
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000052
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000053 - A userspace library
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000054
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000055 - A mount/unmount program
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000056
57
58Here's how to create your very own virtual filesystem in five easy
Miklos Szerediddc862a2002-01-09 13:46:10 +000059steps (after installing FUSE):
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000060
61 1) Edit the file example/fusexmp.c to do whatever you want...
62
63 2) Build the fusexmp program
64
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000065 3) run 'example/fusexmp /mnt/fuse -d'
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000066
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000067 4) ls -al /mnt/fuse
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000068
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000069 5) Be glad
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000070
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000071If it doesn't work out, please ask! Also see the file 'include/fuse.h' for
72detailed documentation of the library interface.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000073
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000074Security
75========
76
77If you run 'make install', the fusermount program is installed
78set-user-id to root. This is done to allow normal users to mount
Miklos Szeredie5183742005-02-02 11:14:04 +000079their own filesystem implementations.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000080
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000081There must however be some limitations, in order to prevent Bad User from
82doing nasty things. Currently those limitations are:
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000083
84 - The user can only mount on a mountpoint, for which it has write
85 permission
86
87 - The mountpoint is not a sticky directory which isn't owned by the
88 user (like /tmp usually is)
89
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000090 - No other user (including root) can access the contents of the mounted
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000091 filesystem.
Miklos Szeredi539488e2005-02-02 10:17:38 +000092
93Configuration
94=============
95
96Some options regarding mount policy can be set in the file
97'/etc/fuse.conf'
98
99Currently these options are:
100
101mount_max = NNN
102
103 Set the maximum number of FUSE mounts allowed to non-root users.
104 The default is 1000.
105
106user_allow_other
107
108 Allow non-root users to specify the 'allow_other' or 'allow_root'
109 mount options.
110
111
112Mount options
113=============
114
115These are FUSE specific mount options that can be specified for all
116filesystems:
117
118default_permissions
119
120 By default FUSE doesn't check file access permissions, the
121 filesystem is free to implement it's access policy or leave it to
122 the underlying file access mechanism (e.g. in case of network
123 filesystems). This option enables permission checking, restricting
124 access based on file mode. This is option is usually useful
125 together with the 'allow_other' mount option.
126
127allow_other
128
129 This option overrides the security measure restricting file access
Miklos Szeredic902a852005-07-07 12:35:37 +0000130 to the user mounting the filesystem. So all users (including root)
131 can access the files. This option is by default only allowed to
132 root, but this restriction can be removed with a configuration
133 option described in the previous section.
Miklos Szeredi539488e2005-02-02 10:17:38 +0000134
135allow_root
136
137 This option is similar to 'allow_other' but file access is limited
Miklos Szeredic902a852005-07-07 12:35:37 +0000138 to the user mounting the filesystem and root. This option and
139 'allow_other' are mutually exclusive.
Miklos Szeredi539488e2005-02-02 10:17:38 +0000140
141kernel_cache
142
143 This option disables flushing the cache of the file contents on
144 every open(). This should only be enabled on filesystems, where the
145 file data is never changed externally (not through the mounted FUSE
146 filesystem). Thus it is not suitable for network filesystems and
147 other "intermediate" filesystems.
148
149 NOTE: if this option is not specified (and neither 'direct_io') data
150 is still cached after the open(), so a read() system call will not
151 always initiate a read operation.
152
153large_read
154
155 Issue large read requests. This can improve performance for some
156 filesystems, but can also degrade performance. This option is only
157 useful on 2.4.X kernels, as on 2.6 kernels requests size is
158 automatically determined for optimum performance.
159
160direct_io
161
162 This option disables the use of page cache (file content cache) in
163 the kernel for this filesystem. This has several affects:
164
165 - Each read() or write() system call will initiate one or more
166 read or write operations, data will not be cached in the
167 kernel.
168
169 - The return value of the read() and write() system calls will
170 correspond to the return values of the read and write
171 operations. This is useful for example if the file size is not
172 known in advance (before reading it).
173
174max_read=N
175
176 With this option the maximum size of read operations can be set.
177 The default is infinite. Note that the size of read requests is
178 limited anyway to 32 pages (which is 128kbyte on i386).
179
180hard_remove
181
182 The default behavior is that if an open file is deleted, the file is
183 renamed to a hidden file (.fuse_hiddenXXX), and only removed when
184 the file is finally released. This relieves the filesystem
185 implementation of having to deal with this problem. This option
186 disables the hiding behavior, and files are removed immediately in
187 an unlink operation (or in a rename operation which overwrites an
188 existing file).
189
Miklos Szeredia4f72cf2005-06-07 05:12:45 +0000190 It is recommended that you not use the hard_remove option. When
191 hard_remove is set, the following libc functions fail on unlinked
192 files (returning errno of ENOENT):
193 - read()
194 - write()
195 - fsync()
196 - close()
197 - f*xattr()
198 - ftruncate()
199 - fstat()
200 - fchmod()
201 - fchown()
202
Miklos Szeredi539488e2005-02-02 10:17:38 +0000203debug
204
205 Turns on debug information printing by the library.
206
207fsname=NAME
208
209 Sets the filesystem name. The default is the program name.
Miklos Szeredie5183742005-02-02 11:14:04 +0000210
Miklos Szeredi340d21f2005-07-06 10:07:52 +0000211use_ino
212
213 Honor the 'st_ino' field in getattr() and fill_dir(). This value is
214 used to fill in the 'st_ino' field in the stat()/lstat()/fstat()
215 functions and the 'd_ino' field in the readdir() function. The
216 filesystem does not have to guarantee uniqueness, however some
217 applications rely on this value being unique for the whole
218 filesystem.
219
220readdir_ino
221
222 If 'use_ino' option is not given, still try to fill in the 'd_ino'
223 field in readdir(). If the name was previously looked up, and is
224 still in the cache, the inode number found there will be used.
225 Otherwise it will be set to '-1'. If 'use_ino' option is given,
226 this option is ignored.
227
Miklos Szeredi437d8112005-07-06 09:14:20 +0000228nonempty
229
230 Allows mounts over a non-empty file or directory. By default these
231 mounts are rejected (from version 2.3.1) to prevent accidental
232 covering up of data, which could for example prevent automatic
233 backup.
Miklos Szeredie331c4b2005-07-06 13:34:02 +0000234
235umask=M
236
237 Override the permission bits in 'st_mode' set by the filesystem.
238 The resulting permission bits are the ones missing from the given
239 umask value. The value is given in octal representation.
240
241uid=N
242
243 Override the 'st_uid' field set by the filesystem.
244
245gid=N
246
247 Override the 'st_gid' field set by the filesystem.