blob: 7d8a7462bd9636ecedea781eebb5073dc80f6fa8 [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 Szeredi8cffdb92001-11-09 14:49:18 +00005programs to export a virtual filesystem to the linux kernel. FUSE
6also 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
20Installation
21============
22
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000023./configure
24make
25make install
Miklos Szeredi539488e2005-02-02 10:17:38 +000026modprobe fuse
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000027
Miklos Szeredib92d9782005-02-07 16:10:49 +000028You may also need to add '/usr/local/lib' to '/etc/ld.so.conf' and/or
29run ldconfig.
30
31For more details see the file 'INSTALL'
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000032
33How To Use
34==========
35
36FUSE is made up of three main parts:
37
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000038 - A kernel filesystem module
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000039
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000040 - A userspace library
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000041
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000042 - A mount/unmount program
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000043
44
45Here's how to create your very own virtual filesystem in five easy
Miklos Szerediddc862a2002-01-09 13:46:10 +000046steps (after installing FUSE):
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000047
48 1) Edit the file example/fusexmp.c to do whatever you want...
49
50 2) Build the fusexmp program
51
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000052 3) run 'example/fusexmp /mnt/fuse -d'
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000053
Miklos Szeredi94ed76a2004-07-26 19:38:45 +000054 4) ls -al /mnt/fuse
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000055
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000056 5) Be glad
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000057
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000058If it doesn't work out, please ask! Also see the file 'include/fuse.h' for
59detailed documentation of the library interface.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000060
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000061Security
62========
63
64If you run 'make install', the fusermount program is installed
65set-user-id to root. This is done to allow normal users to mount
Miklos Szeredie5183742005-02-02 11:14:04 +000066their own filesystem implementations.
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000067
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000068There must however be some limitations, in order to prevent Bad User from
69doing nasty things. Currently those limitations are:
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000070
71 - The user can only mount on a mountpoint, for which it has write
72 permission
73
74 - The mountpoint is not a sticky directory which isn't owned by the
75 user (like /tmp usually is)
76
Miklos Szeredi0a7077f2001-11-11 18:20:17 +000077 - No other user (including root) can access the contents of the mounted
Miklos Szeredi8cffdb92001-11-09 14:49:18 +000078 filesystem.
Miklos Szeredi539488e2005-02-02 10:17:38 +000079
80Configuration
81=============
82
83Some options regarding mount policy can be set in the file
84'/etc/fuse.conf'
85
86Currently these options are:
87
88mount_max = NNN
89
90 Set the maximum number of FUSE mounts allowed to non-root users.
91 The default is 1000.
92
93user_allow_other
94
95 Allow non-root users to specify the 'allow_other' or 'allow_root'
96 mount options.
97
98
99Mount options
100=============
101
102These are FUSE specific mount options that can be specified for all
103filesystems:
104
105default_permissions
106
107 By default FUSE doesn't check file access permissions, the
108 filesystem is free to implement it's access policy or leave it to
109 the underlying file access mechanism (e.g. in case of network
110 filesystems). This option enables permission checking, restricting
111 access based on file mode. This is option is usually useful
112 together with the 'allow_other' mount option.
113
114allow_other
115
116 This option overrides the security measure restricting file access
117 to the user mounting the filesystem. This option is by default only
118 allowed to root, but this restriction can be removed with a
119 configuration option described in the previous section.
120
121allow_root
122
123 This option is similar to 'allow_other' but file access is limited
124 to the user mounting the filesystem and root.
125
126kernel_cache
127
128 This option disables flushing the cache of the file contents on
129 every open(). This should only be enabled on filesystems, where the
130 file data is never changed externally (not through the mounted FUSE
131 filesystem). Thus it is not suitable for network filesystems and
132 other "intermediate" filesystems.
133
134 NOTE: if this option is not specified (and neither 'direct_io') data
135 is still cached after the open(), so a read() system call will not
136 always initiate a read operation.
137
138large_read
139
140 Issue large read requests. This can improve performance for some
141 filesystems, but can also degrade performance. This option is only
142 useful on 2.4.X kernels, as on 2.6 kernels requests size is
143 automatically determined for optimum performance.
144
145direct_io
146
147 This option disables the use of page cache (file content cache) in
148 the kernel for this filesystem. This has several affects:
149
150 - Each read() or write() system call will initiate one or more
151 read or write operations, data will not be cached in the
152 kernel.
153
154 - The return value of the read() and write() system calls will
155 correspond to the return values of the read and write
156 operations. This is useful for example if the file size is not
157 known in advance (before reading it).
158
159max_read=N
160
161 With this option the maximum size of read operations can be set.
162 The default is infinite. Note that the size of read requests is
163 limited anyway to 32 pages (which is 128kbyte on i386).
164
165hard_remove
166
167 The default behavior is that if an open file is deleted, the file is
168 renamed to a hidden file (.fuse_hiddenXXX), and only removed when
169 the file is finally released. This relieves the filesystem
170 implementation of having to deal with this problem. This option
171 disables the hiding behavior, and files are removed immediately in
172 an unlink operation (or in a rename operation which overwrites an
173 existing file).
174
Miklos Szeredia4f72cf2005-06-07 05:12:45 +0000175 It is recommended that you not use the hard_remove option. When
176 hard_remove is set, the following libc functions fail on unlinked
177 files (returning errno of ENOENT):
178 - read()
179 - write()
180 - fsync()
181 - close()
182 - f*xattr()
183 - ftruncate()
184 - fstat()
185 - fchmod()
186 - fchown()
187
Miklos Szeredi539488e2005-02-02 10:17:38 +0000188debug
189
190 Turns on debug information printing by the library.
191
192fsname=NAME
193
194 Sets the filesystem name. The default is the program name.
Miklos Szeredie5183742005-02-02 11:14:04 +0000195
Miklos Szeredi340d21f2005-07-06 10:07:52 +0000196use_ino
197
198 Honor the 'st_ino' field in getattr() and fill_dir(). This value is
199 used to fill in the 'st_ino' field in the stat()/lstat()/fstat()
200 functions and the 'd_ino' field in the readdir() function. The
201 filesystem does not have to guarantee uniqueness, however some
202 applications rely on this value being unique for the whole
203 filesystem.
204
205readdir_ino
206
207 If 'use_ino' option is not given, still try to fill in the 'd_ino'
208 field in readdir(). If the name was previously looked up, and is
209 still in the cache, the inode number found there will be used.
210 Otherwise it will be set to '-1'. If 'use_ino' option is given,
211 this option is ignored.
212
Miklos Szeredi437d8112005-07-06 09:14:20 +0000213nonempty
214
215 Allows mounts over a non-empty file or directory. By default these
216 mounts are rejected (from version 2.3.1) to prevent accidental
217 covering up of data, which could for example prevent automatic
218 backup.
Miklos Szeredie331c4b2005-07-06 13:34:02 +0000219
220umask=M
221
222 Override the permission bits in 'st_mode' set by the filesystem.
223 The resulting permission bits are the ones missing from the given
224 umask value. The value is given in octal representation.
225
226uid=N
227
228 Override the 'st_uid' field set by the filesystem.
229
230gid=N
231
232 Override the 'st_gid' field set by the filesystem.