blob: 4c5517aa7827c72656da606bf23b73a9e9f690c4 [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 Szeredif7eec032005-10-28 13:09:50 +000044If './configure' cannot find the kernel source or it says the kernel
45source should be prepared, you may either try
46
47 ./configure--disable-kernel-module
48
49or if your kernel does not already contain FUSE support, do the
50following:
51
52 - Extract the kernel source to some directory
53
54 - Copy the running kernel's config (usually found in
55 /boot/config-X.Y.Z) to .config at the top of the source tree
56
57 - Run 'make prepare'
58
Miklos Szeredib92d9782005-02-07 16:10:49 +000059For more details see the file 'INSTALL'
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000060
61How To Use
62==========
63
64FUSE is made up of three main parts:
65
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000066 - A kernel filesystem module
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000067
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000068 - A userspace library
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000069
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000070 - A mount/unmount program
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000071
72
73Here's how to create your very own virtual filesystem in five easy
Miklos Szerediddc862a2002-01-09 13:46:10 +000074steps (after installing FUSE):
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000075
76 1) Edit the file example/fusexmp.c to do whatever you want...
77
78 2) Build the fusexmp program
79
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000080 3) run 'example/fusexmp /mnt/fuse -d'
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000081
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000082 4) ls -al /mnt/fuse
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000083
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000084 5) Be glad
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000085
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000086If it doesn't work out, please ask! Also see the file 'include/fuse.h' for
87detailed documentation of the library interface.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000088
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000089Security
90========
91
92If you run 'make install', the fusermount program is installed
93set-user-id to root. This is done to allow normal users to mount
Miklos Szeredie5183742005-02-02 11:14:04 +000094their own filesystem implementations.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000095
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000096There must however be some limitations, in order to prevent Bad User from
97doing nasty things. Currently those limitations are:
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000098
99 - The user can only mount on a mountpoint, for which it has write
100 permission
101
102 - The mountpoint is not a sticky directory which isn't owned by the
103 user (like /tmp usually is)
104
Miklos Szeredi0a7077f2001-11-11 18:20:17 +0000105 - No other user (including root) can access the contents of the mounted
Miklos Szeredi8cffdb92001-11-09 14:49:18 +0000106 filesystem.
Miklos Szeredi539488e2005-02-02 10:17:38 +0000107
108Configuration
109=============
110
111Some options regarding mount policy can be set in the file
112'/etc/fuse.conf'
113
114Currently these options are:
115
116mount_max = NNN
117
118 Set the maximum number of FUSE mounts allowed to non-root users.
119 The default is 1000.
120
121user_allow_other
122
123 Allow non-root users to specify the 'allow_other' or 'allow_root'
124 mount options.
125
126
127Mount options
128=============
129
130These are FUSE specific mount options that can be specified for all
131filesystems:
132
133default_permissions
134
135 By default FUSE doesn't check file access permissions, the
136 filesystem is free to implement it's access policy or leave it to
137 the underlying file access mechanism (e.g. in case of network
138 filesystems). This option enables permission checking, restricting
139 access based on file mode. This is option is usually useful
140 together with the 'allow_other' mount option.
141
142allow_other
143
144 This option overrides the security measure restricting file access
Miklos Szeredic902a852005-07-07 12:35:37 +0000145 to the user mounting the filesystem. So all users (including root)
146 can access the files. This option is by default only allowed to
147 root, but this restriction can be removed with a configuration
148 option described in the previous section.
Miklos Szeredi539488e2005-02-02 10:17:38 +0000149
150allow_root
151
152 This option is similar to 'allow_other' but file access is limited
Miklos Szeredic902a852005-07-07 12:35:37 +0000153 to the user mounting the filesystem and root. This option and
154 'allow_other' are mutually exclusive.
Miklos Szeredi539488e2005-02-02 10:17:38 +0000155
156kernel_cache
157
158 This option disables flushing the cache of the file contents on
159 every open(). This should only be enabled on filesystems, where the
160 file data is never changed externally (not through the mounted FUSE
161 filesystem). Thus it is not suitable for network filesystems and
162 other "intermediate" filesystems.
163
164 NOTE: if this option is not specified (and neither 'direct_io') data
165 is still cached after the open(), so a read() system call will not
166 always initiate a read operation.
167
168large_read
169
170 Issue large read requests. This can improve performance for some
171 filesystems, but can also degrade performance. This option is only
172 useful on 2.4.X kernels, as on 2.6 kernels requests size is
173 automatically determined for optimum performance.
174
175direct_io
176
177 This option disables the use of page cache (file content cache) in
178 the kernel for this filesystem. This has several affects:
179
180 - Each read() or write() system call will initiate one or more
181 read or write operations, data will not be cached in the
182 kernel.
183
184 - The return value of the read() and write() system calls will
185 correspond to the return values of the read and write
186 operations. This is useful for example if the file size is not
187 known in advance (before reading it).
188
189max_read=N
190
191 With this option the maximum size of read operations can be set.
192 The default is infinite. Note that the size of read requests is
193 limited anyway to 32 pages (which is 128kbyte on i386).
194
195hard_remove
196
197 The default behavior is that if an open file is deleted, the file is
198 renamed to a hidden file (.fuse_hiddenXXX), and only removed when
199 the file is finally released. This relieves the filesystem
200 implementation of having to deal with this problem. This option
201 disables the hiding behavior, and files are removed immediately in
202 an unlink operation (or in a rename operation which overwrites an
203 existing file).
204
Miklos Szeredia4f72cf2005-06-07 05:12:45 +0000205 It is recommended that you not use the hard_remove option. When
206 hard_remove is set, the following libc functions fail on unlinked
207 files (returning errno of ENOENT):
208 - read()
209 - write()
210 - fsync()
211 - close()
212 - f*xattr()
213 - ftruncate()
214 - fstat()
215 - fchmod()
216 - fchown()
217
Miklos Szeredi539488e2005-02-02 10:17:38 +0000218debug
219
220 Turns on debug information printing by the library.
221
222fsname=NAME
223
224 Sets the filesystem name. The default is the program name.
Miklos Szeredie5183742005-02-02 11:14:04 +0000225
Miklos Szeredi340d21f2005-07-06 10:07:52 +0000226use_ino
227
228 Honor the 'st_ino' field in getattr() and fill_dir(). This value is
229 used to fill in the 'st_ino' field in the stat()/lstat()/fstat()
230 functions and the 'd_ino' field in the readdir() function. The
231 filesystem does not have to guarantee uniqueness, however some
232 applications rely on this value being unique for the whole
233 filesystem.
234
235readdir_ino
236
237 If 'use_ino' option is not given, still try to fill in the 'd_ino'
238 field in readdir(). If the name was previously looked up, and is
239 still in the cache, the inode number found there will be used.
240 Otherwise it will be set to '-1'. If 'use_ino' option is given,
241 this option is ignored.
242
Miklos Szeredi437d8112005-07-06 09:14:20 +0000243nonempty
244
245 Allows mounts over a non-empty file or directory. By default these
246 mounts are rejected (from version 2.3.1) to prevent accidental
247 covering up of data, which could for example prevent automatic
248 backup.
Miklos Szeredie331c4b2005-07-06 13:34:02 +0000249
250umask=M
251
252 Override the permission bits in 'st_mode' set by the filesystem.
253 The resulting permission bits are the ones missing from the given
254 umask value. The value is given in octal representation.
255
256uid=N
257
258 Override the 'st_uid' field set by the filesystem.
259
260gid=N
261
262 Override the 'st_gid' field set by the filesystem.