~ubuntu-branches/ubuntu/vivid/aufs/vivid

« back to all changes in this revision

Viewing changes to README

  • Committer: Bazaar Package Importer
  • Author(s): Julian Andres Klode
  • Date: 2007-12-15 23:32:51 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071215233251-2vgs2lmg8mai5d9e
Tags: 0+20071211-1ubuntu1
* Merge from debian unstable (LP: #175705), remaining changes:
  - Fix for Ubuntu Kernels (updated)
* patches/01_vserver.dpatch: Removed
* patches/06_ubuntu.dpatch: Added (update of ubuntu patch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Aufs -- Another Unionfs
3
3
Junjiro Okajima
4
4
 
5
 
# $Id: README,v 1.49 2007/05/27 23:07:37 sfjro Exp $
 
5
# $Id: README,v 1.67 2007/12/10 01:20:14 sfjro Exp $
6
6
 
7
7
 
8
8
0. Introduction
13
13
Unionfs while keeping the basic features.
14
14
Unionfs is being developed by Professor Erez Zadok at Stony Brook
15
15
University and his team.
16
 
If you don't know Unionfs, I recommend you to try and know it before
17
 
using aufs. Some terminology in aufs follows Unionfs's.
 
16
If you don't know Unionfs, I recommend you becoming familiar with it
 
17
before using aufs. Some terminology in aufs follows Unionfs's.
18
18
 
19
19
Bug reports (including my broken English), suggestions, comments
20
20
and donations are always welcome. Your bug report may help other users,
21
 
including future users. Especially the bug which doesn't follow unix/linux
22
 
filesystem's semantics is important.
 
21
including future users. Especially the bug report which doesn't follow
 
22
unix/linux filesystem's semantics is important.
23
23
 
24
24
 
25
25
1. Features
33
33
- dynamic branch manipulation, add, del.
34
34
- etc... see Unionfs in detail.
35
35
 
36
 
Also there are many enhancements in aufs, such like,,,
 
36
Also there are many enhancements in aufs, such as:
37
37
- safer and faster
38
38
- keep inode number by external inode number table
39
39
- keep the timestamps of file/dir in internal copyup operation
52
52
- selectable permission flags for ro branch, whether whiteout can
53
53
  exist or not
54
54
- export via NFS.
55
 
- <sysfs>/fs/aufs.
 
55
- support <sysfs>/fs/aufs.
 
56
- support multiple writable branches, some policies to select one
 
57
  among multiple writable branches.
 
58
- a new semantics for link(2) and rename(2) to support multiple
 
59
  writable branches.
 
60
- a delegation of the internal branch access to support task I/O
 
61
  accounting, which also supports Linux Security Modules (LSM) mainly
 
62
  for Suse AppArmor.
 
63
- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs.
56
64
- and more... see aufs manual in detail
57
65
 
58
 
Aufs is in still development stage, especially,,,
 
66
Aufs is in still development stage, especially:
59
67
- pseudo hardlink (hardlink over branches)
60
68
- allow a direct access manually to a file on branch, e.g. bypassing aufs.
61
69
  including NFS or remote filesystem branch.
62
 
 
63
 
(current work)
64
70
- refine xino and revalidate
65
71
- pseudo-link in NFS-exporting
66
 
- lockdep
67
 
- a delegation of the internal branch access to support task I/O
68
 
  accounting, which also supports Linux Security Modules (LSM) mainly
69
 
  for Suse AppArmor.
70
 
- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs.
 
72
 
 
73
(current work)
 
74
- reorder the branch index without del/re-add.
 
75
- permanent xino files
 
76
 
 
77
(next work)
 
78
- an option for refreshing the opened files after add/del branches
 
79
- 'move' policy for copy-up between two writable branches, after
 
80
  checking free space.
 
81
- ioctl to manipulate file between branches.
 
82
- and documentation
71
83
 
72
84
(just an idea)
73
 
- sample for kvm, xen, vmware and openvz? If a directory can be
74
 
  sharable between several Guest-OSes, to share readonly aufs branches
75
 
  will be an advantage.
76
85
- remount option copy/move between two branches. (unnecessary?)
77
86
- O_DIRECT (unnecessary?)
78
87
- light version, without branch manipulation. (unnecessary?)
79
88
- SMP, because I don't have such machine. But several users reported
80
89
  aufs is working fine on SMP machines.
81
 
- 64bit environment, because I don't have such machine.
82
90
- copyup in userspace
 
91
- inotify in userspace
83
92
- xattr, acl
84
 
- disk quota (unnecessary?)
85
 
- and documentation
86
93
 
87
94
 
88
95
2. Download
96
103
        (CVS password is empty)
97
104
        $ cvs -z3 -d:pserver:anonymous@aufs.cvs.sourceforge.net:/cvsroot/aufs co aufs
98
105
 
99
 
In order to update files after the first checkout.
 
106
In order to update files after the first checkout,
100
107
        $ cd aufs.wcvs/aufs
101
108
        $ cvs update
102
109
 
104
111
        $ cd aufs.wcvs/aufs
105
112
        $ cvs diff -D20061212 -D20061219
106
113
 
 
114
Usually I am updating CVS tree on every Monday.
107
115
I always try putting the stable version in CVS, so you can try CVS
108
116
instead of SourceForge File Release. And every changes are summarized
109
 
and reported to aufs-users at lists.sourceforge.net ML. It is recommended to
110
 
join this ML.
 
117
and reported to aufs-users at lists.sourceforge.net ML. I'd like to
 
118
recommend you to join this ML.
111
119
 
112
120
 
113
121
3. Configuration and Compilation
114
122
----------------------------------------
115
 
Aufs is being developed and tested on linux-2.6.16 and later
116
 
(But I am planning to shift to the 'linux-2.6.18 and later').
 
123
Aufs is being developed and tested on linux-2.6.16 and later.
117
124
You need the correct environment to build a kernel module. Generally
118
125
it is an environment which your kernel was built.
119
126
If you are unsure that you got the correct environment, then I
120
127
recommend you to built your kernel by yourself. If it succeeds, you've
121
128
got the correct environment.
122
129
 
123
 
Currently aufs configuration is written in ./Kconfig.in. You can build the
124
 
real ./fs/aufs/Kconfig file by 'make.' And follow the instructions which will
125
 
be produced. The built ./fs/aufs/Kconfig depends upon the kernel version.
 
130
Currently aufs configuration is written in ./Kconfig.in. You can
 
131
generate the real ./fs/aufs/Kconfig file by make(1). And follow the
 
132
instructions which will be produced. The built ./fs/aufs/Kconfig
 
133
depends upon the kernel version.
 
134
Before you build ./fs/aufs/Kconfig, you need to configure your kernel,
 
135
since this build refers to linux/include/version.h.
126
136
        $ make -f local.mk kconfig
 
137
 
127
138
The local.mk searches your kernel build path by
128
139
        KDIR = /lib/modules/$(shell uname -r)/build
129
140
If you are cross-compiling the aufs module, try
130
141
        $ make KDIR=/your/kernel/build/path -f local.mk kconfig
131
 
If you compile aufs statically, the built Kconfig will help you.
 
142
If you link aufs statically, the generated Kconfig will help you.
132
143
 
133
144
Also you can use ./local.mk to compile aufs as a module by simply,
134
145
        $ make -f local.mk
140
151
configuration for your aufs module.
141
152
If you don't want to change the ./local.mk, then create a new file
142
153
./priv_def.mk and write the definitions your aufs configuration. The
143
 
./local.mk includes ./priv_def.mk it it exists.
 
154
./local.mk includes ./priv_def.mk if it exists.
 
155
When you configure aufs by modifying ./local.mk (or ./priv_dev.mk),
 
156
leave it blank/unset when you disable an aufs configuration, instead
 
157
of setting 'n.'
 
158
 
 
159
There is a contributed Makefile for aufs users. You might want to try
 
160
it. Check
 
161
http://sourceforge.net/mailarchive/forum.php?thread_name=9c4865a10707241831r189f9646n5f2c4a9c303797d1%40mail.gmail.com&forum_name=aufs-users
 
162
and see the attachment.
144
163
 
145
164
Currently, CONFIG_DEBUG_PROVE_LOCKING (in linux kernel) is not
146
 
supported since MAX_LOCKDEP_SUBCLASSES is too low for a stackable
 
165
supported since MAX_LOCKDEP_SUBCLASSES is too small for a stackable
147
166
filesystem. I am trying reducing the depth of lock subclasses.
 
167
Until then, you need to increase the value of MAX_LOCKDEP_SUBCLASSES
 
168
macro in include/linux/lockdep.h, for example, 16UL, when you enable
 
169
CONFIG_DEBUG_PROVE_LOCKING.
148
170
 
149
171
When you test the performance, it is recommended to disable
150
172
CONFIG_AUFS_DEBUG. It is enabled by default for the feature test.
151
173
 
 
174
Since aufs supports several versions of linux kernel, it uses the
 
175
condition like this,
 
176
        #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
 
177
On the other hand, some distributions modify their kernel by their own
 
178
patches. For example, just a piece of code is brought from v2.6.18 and
 
179
merged into a distribution kernel which calls itself as v2.6.17.
 
180
Finally, the conditions in aufs will not work correctly.
 
181
You may or may not find them when you compile aufs.
 
182
You need to modify aufs source code for 'custom-version' kernel
 
183
(cf. patch/ubuntu-edgy.patch).
 
184
 
 
185
 
 
186
o Patches
 
187
There are several patches for linux kernel, in order to use aufs.
 
188
All of them are not necessary essentially, but in some cases you need
 
189
them. It is up to your environment and aufs usage.
 
190
All these patches are just for exporting a kernel internal function to
 
191
modules. If the function was already declared as extern and you link
 
192
aufs statically to your kernel, then you don't need such patch. If the
 
193
function was not extern and you want the feature, you need to apply
 
194
the patch.
 
195
When you apply a patch, you need to enable the corresponding aufs
 
196
configuration.
 
197
All these patches are under CVS_TREE/aufs/patch.
 
198
 
 
199
- sec_perm-2.6.24.patch
 
200
  For linux-2.6.24 and later.
 
201
  When you compile aufs as a module and enable CONFIG_SECURITY, this
 
202
  patch is required.
 
203
- splice-2.6.23.patch
 
204
  For linux-2.6.23 and later.
 
205
  When you use splice(2) or loopback-mount an fs-image file in aufs,
 
206
  this patch is required. Aufs doesn't support splice(2) in
 
207
  linux-2.6.22 and earlier.
 
208
- sysfs_get_dentry.patch
 
209
  For linux-2.6.23 and later.
 
210
  If you want to see the file size under /sys/fs/aufs, apply this
 
211
  patch. I am afraid most people never care the size of such file.
 
212
  The size shows the size of a memory allocated in kernel space.
 
213
  If you write something to the file under /sys/fs/aufs, the file size
 
214
  will be zero and the memory will be freed.
 
215
- put_filp.patch
 
216
  For linux-2.6.19 and later.
 
217
  When you compile aufs as a module and use NFS as an aufs branch
 
218
  filesystem, this patch is required.
 
219
- lhash.patch
 
220
  For linux-2.6.19 and later till linux-2.6.21.
 
221
  When you use NFS as an aufs branch filesystem, this patch is
 
222
  required.
 
223
- lhash-2.6.22.patch
 
224
  Same above, but this patch is for linux-2.6.22 only.
 
225
- deny_write_access.patch
 
226
  For linux-2.6.17 and later.
 
227
  When you compile aufs as a module, applied this patch and enabled a
 
228
  configuration, a minor security enhancement will be available at
 
229
  execve(2).
 
230
  You can omit this if you don't care the writing to a running
 
231
  executable on a lower branch filesystem which was invoked through
 
232
  aufs.
 
233
- ksize.patch
 
234
  For linux-2.6.22 and earlier.
 
235
  When you compile aufs as a module and applied this patch, an
 
236
  optimization inside aufs will be available at adding or deleting a
 
237
  branch filesystem. You can omit this if you don't care the aufs
 
238
  performance.
 
239
 
 
240
Additionally, there are patches for aufs which will be necessary when
 
241
you use non-standard kernel modules or patches. Some of them have been
 
242
tested by several people, but not all.
 
243
See also the comments in the patches.
 
244
- ubuntu-2.6.22-14.46.patch
 
245
  For Ubuntu kernel
 
246
  (http://archive.ubuntu.com/ubuntu/pool/main/l/linux-source-2.6.22/
 
247
  linux-source-2.6.22_2.6.22-14.46_all.deb) which is modifed a lot by
 
248
  ubuntu people.
 
249
- ubuntu-edgy.patch
 
250
  For Ubuntu Edgy kernel which calls itself as 2.6.17, while its
 
251
  umount_begin() interface has arguments of 2.6.18.
 
252
- rt-compat.patch
 
253
  For realtime patch (http://people.redhat.com/mingo/realtime-preempt).
 
254
- vserver.patch
 
255
  For linux-vserver module (http://linux-vserver.org).
 
256
- openvz_028stab039.1.patch
 
257
  For openvz module (http://openvz.org).
 
258
 
152
259
 
153
260
4. Usage
154
261
----------------------------------------
155
262
After 'make',
156
263
        $ man -l ./aufs.5
157
264
        # install -m 500 -p mount.aufs umount.aufs auplink aulchown /sbin (recommended)
 
265
        # echo FLUSH=ALL > /etc/default/auplink (recommended)
158
266
        # insmod ./aufs.ko
159
267
        $ mkdir /tmp/rw /tmp/aufs
160
268
        # mount -t aufs -o dirs=/tmp/rw:${HOME}=ro none /tmp/aufs
161
269
 
 
270
If you are familiar with Unionfs Version 1.x series and want to use
 
271
unionctl(8), you can try the sample unionctl script under sample/
 
272
directory too.
 
273
 
162
274
Here is another example.
163
275
 
164
276
        # mount -t aufs -o br:/tmp/rw:${HOME}=ro none /tmp/aufs
167
279
        # mount -o remount,append:${HOME}=ro /tmp/aufs
168
280
 
169
281
If you disable CONFIG_AUFS_COMPAT in your configuration, you can remove the
170
 
default branch permission '=ro.'
 
282
default branch permission '=ro' since '=rw' is set to the first branch
 
283
only by default.
171
284
 
172
285
        # mount -t aufs -o br:/tmp/rw:${HOME} none /tmp/aufs
173
286
 
174
287
Then, you can see whole tree of your home dir through /tmp/aufs. If
175
288
you modify a file under /tmp/aufs, the one on your home directory is
176
 
not affected, but the same named file will be newly created under
 
289
not affected, instead the same named file will be newly created under
177
290
/tmp/rw. And all of your modification to the file will be applied to
178
291
the one under /tmp/rw. This is called Copy on Write (COW) method.
179
292
Aufs mount options are described in the generated ./aufs.5.
186
299
5. Contact
187
300
----------------------------------------
188
301
When you have any problems or strange behaviour in aufs, please let me
189
 
know with,,,
 
302
know with:
190
303
- /proc/mounts (instead of the output of mount(8))
191
304
- /sys/fs/aufs/* (if you have them)
192
305
- linux kernel version
 
306
  if your kernel is not plain, for example modified by distributor,
 
307
  the url where i can download its source is necessary too.
193
308
- aufs version which was printed at loading the module or booting the
194
309
  system
195
310
- configuration (define/undefine CONFIG_AUFS_xxx, or plain local.mk is
196
311
  used or not)
197
 
- phenomenon
 
312
- behaviour which you think to be incorrect
198
313
- actual operation, reproducible one is better
199
314
- mailto: aufs-users at lists.sourceforge.net
200
315
 
202
317
Feature Requests) on SourceForge. Please join and write to aufs-users ML.
203
318
 
204
319
 
205
 
6.
 
320
6. Acknowledgements
 
321
----------------------------------------
 
322
Thanks to everyone who have tried and are using aufs, especially who
 
323
have reported a bug or any feedback.
 
324
 
 
325
Tomas Matejicek(slax.org) made a donation (2007/7).
 
326
Dai Itasaka made a donation (2007/8).
 
327
Tomas Matejicek(slax.org) made a donation (2007/10).
 
328
 
 
329
Thank you very much.
 
330
Donations are always, including future donations, very important and
 
331
helpful for me to keep on developing aufs.
 
332
 
 
333
 
 
334
7.
206
335
----------------------------------------
207
336
If you are an experienced user, no explanation is needed. Aufs is
208
337
just a linux filesystem module. take a glance at ./local.mk,