0. Introduction Aufs was entirely re-designed and re-implemented Unionfs. After many original ideas, approaches, improvements and implementations, it becomes totally different from Unionfs while keeping the basic features. Unionfs is being developed by Professor Erez Zadok at Stony Brook University and his team. If you don't know Unionfs, I recommend you to try and know it before using aufs. Some terminology in aufs follows Unionfs's. Bug reports (including my broken English), suggestions, comments and donations are always welcome. Your bug report may help other users, including future users. 1. Features - unite several directories into a single virtual filesystem. The member directory is called as a branch. - you can specify the permission flags to the branch, which are 'readonly', 'readwrite' and 'whiteout-able.' - by upper writable branch, internal copyup and whiteout, files/dirs on readonly branch are modifiable logically. - dynamic branch manipulation, add, del. - etc... see Unionfs in detail. Also there are many enhancements in aufs, such like,,, - simplified, safer and faster - keep inode number by external inode number table - keep the timestamps of file/dir in internal copyup operation - seekable directory, support NFS readdir. - support mmap(2) including /proc/PID/exe symlink, without page-copy - whiteout is hardlinked in order to reduce the consumption of inodes on branch - do not copyup, nor create a whiteout when it is unnecessary - revert a single systemcall when an error occurs in aufs - remount interface instead of ioctl - maintain /etc/mtab by an external shell script, /sbin/mount.aufs. - loopback mounted filesystem as a branch - kernel thread for removing the dir who has a plenty of whiteouts - support copyup sparse file (a file which has a 'hole' in it) - default permission flags for branches - selectable permission flags for ro branch, whether whiteout can exist or not - and more... see aufs manual in detail Aufs is in still development stage, especially,,, - pseudo hardlink (hardlink over branches) - NFS or remote filesystem branch - allow a direct access manually to a file on branch, eg. bypassing aufs. including NFS or remote filesystem branch. - remount option copy/move between two branches, selecting writable branch policy. - O_DIRECT (unnecessary?) - export via NFS (unnecessary?) - light version, without branch manipulation. - SMP, because I don't have such machine. - xattr, acl - and documentation
Created attachment 109488 [details] Ebuild for aufs ~x86 I've tried to create an ebuild for aufs from the cvs Version 20070205. It worked for me. Please send me feedback so I can improve it. Cheers, Torsten ;o)
Is it a problem of the ebuild or of upstream that it is x86-only? On amd64, I get error messages when compiling super.o (x86 compiles fine with the same kernel version): make[1]: Entering directory `/usr/src/linux-2.6.19-hardened-r5' CC [M] \ /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/super.o CC [M] \ /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/sbinfo.o In file included from include/linux/timex.h:188, from include/linux/sched.h:51, from include/linux/radix-tree.h:23, from include/linux/fs.h:277, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/debug.h:25, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/aufs.h:51, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/sbinfo.c:22: include/asm/timex.h: In function 'get_cycles': include/asm/timex.h:25: warning: left shift count >= width of type include/asm/timex.h: In function 'get_cycles_sync': include/asm/timex.h:38: warning: left shift count >= width of type In file included from include/linux/hrtimer.h:20, from include/linux/sched.h:85, from include/linux/radix-tree.h:23, from include/linux/fs.h:277, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/debug.h:25, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/aufs.h:51, from /var/tmp/portage/sys-fs/aufs-20070205/work/aufs-20070205/fs/aufs/sbinfo.c:22: include/linux/ktime.h: In function 'ktime_set': include/linux/ktime.h:78: warning: comparison is always false due to limited range of data type {standard input}: Assembler messages: {standard input}:38: Error: suffix or operands invalid for `push' {standard input}:64: Error: suffix or operands invalid for `push' ... [further errors, all of type "suffix or operands invalid for `push'"]. If it is useful, I can provide more information...
Hi, unfortunately I wasn't able to test the ebuild with amd64. The problem is most probably this line: emake \ ARCH=i386 \ KDIR=${ROOT}/lib/modules/${KV_FULL}/build \ -f local.mk The ARCH Variable has always been set to x68 so aufs tried to compile with the Makefile in /usr/src/linux/arch/x86... (that doesn't exist). I had to set it to i386 as quick and dirty solution, because I didn't know an elegant (ebuild like) way of handling this problem. I try to fix that :-). Thanks for the feedback. Greetz, Torsten ;-)
Created attachment 109937 [details] Ebuild aufs - Version 20070212 Created a new ebuild for aufs version 20070212. I could only test it for ~x86, thats the reason I only added the ~x86 Keword. Maybe someone else can test it on other ARCHs ;)
It compiled fine on amd64, although with several worryingly warnings of type "warning: format '%d' expects type 'int', but argument 6 has type 'ssize_t" (ssize_t is in contrast to int of course 64bit on amd64). After emerge a manual "modules-update" was necessary before "modprobe aufs" could find the module. There seems to be a bug in the mount.aufs script # mkdir /root/{1,2,3} # mount -v -t aufs br:/root/1:/root/3 /root/2 sed: -e expression #1, char 16: unknown option to `s' mount: wrong fs type, bad option, bad superblock on br:/root/1:/root/3, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so failure bad /proc/mounts 1 sed: -e expression #1, char 15: unknown option to `s'
Oh, it seems this was only a typo in the examples section of the manpage: With "-o" added (and of course "none" inserted in front of the last argument) everything works. So I guess ~amd64 is OK... (although the frightening %d warnings remain of course, and modules-update is missing somewhere in the ebuild).
Okay, thanks for testing it on ~amd64 because I tested the ebuild with the useflags "ksize" and "nfs" I always recompiled the kernel and rebooted the system after the emerge. Because at boot time a modules-update is done automatically I never realized that it was missing in the ebuild. So I will fix that tomorrow ;)
Since I had just compiled a new kernel: aufs does not occur in "module-rebuild list". I guess it should be entered somewhere into a database.
I commited a new version of the ebuild to the gentoo-sunrise project
I'm happy this ebuild exists. I needed it for the new version of the linux-live scripts. The 2/12 ebuild builds fine for me (kernel 2.6.18).
I tried to use the aufs ebuild from sunrise overlay (20070402) but the compilation randomly failed. Then I used the same ebuild with the 20070409 aufs from cvs and the kernel 2.6.20-gentoo-r2, but it didn't help (well it stopped giving me some warnings). So I found out that this behaviour was due to my MAKEOPTS="-j3" in make.conf, with -j1 it always succeeds. I'm using AMD64 and the nfs flag. One possible fix would be adding to the ebuild: src_compile() { ARCH=$(tc-arch-kernel) emake -j1 ${BUILD_PARAMS} ${BUILD_TARGETS} || die "emake failed" ARCH=$(tc-arch) } but of course fixing the aufs makefile (if the problem is there, it usually is) would be better. I'm not sure if tc-arch after emake is needed. set_arch_to_kernel() and set_arch_to_portage() can also be used but the eclass says they are legacy wrappers. Thanks for making this ebuild, it's been very useful.
Created attachment 116920 [details] aufs-20070409.ebuild Patches were not working with 20070402 version from sunrise overlay due to a change in local.mk format from 20070212. Remember that the ebuild I uploaded is for version 20070409, so you will need to edit the SRC_URI, perhaps using you own webserver to host the file
Incompatible with kernel 2.6.22, please update. /var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c: In function 'sysaufs_fin': /var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c:472: error: 'struct kset' has no member named 'kset' /var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c: In function 'sysaufs_init': /var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c:487: error: 'struct kset' has no member named 'kset' /var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.c:499: error: 'struct kset' has no member named 'kset' make[2]: *** [/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs/sysaufs.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [_module_/var/tmp/portage/sys-fs/aufs-20070402/work/aufs-20070402/fs/aufs] Error 2 make[1]: Leaving directory `/usr/src/linux-2.6.22-gentoo-r2' make: *** [fs/aufs/aufs.ko] Error 2 !!! ERROR: sys-fs/aufs-20070402 failed. Call stack: ebuild.sh, line 1632: Called dyn_compile ebuild.sh, line 983: Called qa_call 'src_compile' ebuild.sh, line 44: Called src_compile ebuild.sh, line 1322: Called linux-mod_src_compile linux-mod.eclass, line 516: Called die
Created attachment 128385 [details] CVS ebuild for aufs Checks out the newest version from CVS
*** This bug has been marked as a duplicate of bug 189573 ***
This is not a duplicate, the other bug is for the userspace utilities only.
Sorry. Reopening...
Created attachment 160657 [details] Updated CVS ebuild for aufs An update of the CVS ebuild, to work with 2.6.24+ kernels
With kernel 2.6.27 ebuild it give me sandbox violations. (it tries to write tmp files in /usr/src/linux): --------------------------- ACCESS VIOLATION SUMMARY --------------------------- LOG FILE = "/var/log/sandbox/sandbox-17731.log" open_wr: /usr/src/linux-2.6.27-gentoo/.17817.tmp open_wr: /usr/src/linux-2.6.27-gentoo/.17823.tmp open_wr: /usr/src/linux-2.6.27-gentoo/.17854.tmp ..... with FEATURES="-sandbox" emerge -av aufs it compiles, but I can't modprobe it because of an unknown symbol.
(In reply to comment #19) > it compiles, but I can't modprobe it because of an unknown symbol. > resolved with: cd /usr/src/linux patch -p1 < /usr/portage/distfiles/cvs-src/aufs/patch/sec_perm-2.6.24.patch and rebuild of kernel, reboot and reemerging aufs.
Created attachment 174878 [details] CVS ebuild based on aufs-20080422 This ebuild is based on the most recent version of aufs available in the sunrise overlay. It has more USE variables and a few more checks for kernel versions. It doesn't have the ksize USE variable, though as far as I know, it is not really needed anymore.
(In reply to comment #21) > Created an attachment (id=174878) [edit] > CVS ebuild based on aufs-20080422 > > This ebuild is based on the most recent version of aufs available in the > sunrise overlay. It has more USE variables and a few more checks for kernel > versions. It doesn't have the ksize USE variable, though as far as I know, it > is not really needed anymore. > I had to mask this package, because the mount script fails on my system, maybe it misses some dependencies :S First it said that the file /etc/default/aufs was missing, then I touched it. Second it said that the command SetDir doesn't exist. Third I masked the package. I've attached the emerge info.
Created attachment 174988 [details] Emerge info
Created attachment 175011 [details] Fixed /etc/default/aufs problem
Created attachment 175928 [details] based off sys-fs/aufs-20081208-r1 Updated the CVS ebuild to reflect the changes in the 20081208 ebuild
Yesterday I bumped the version of sys-fs/aufs on sunrise to the last in the aufs1 series (20090126), and I also re-added the use flag and adjusted kernel patches (tested with up to 2.6.28) for NFS branch support.
The latest sunrise ebuild doesn't compile on 2.6.29
Created attachment 188010 [details] updated with patch for 2.6.29
Created attachment 188011 [details, diff] 2.6.29 patch
(In reply to comment #28) > Created an attachment (id=188010) [edit] > updated with patch for 2.6.29 > Correctly compiled on ~amd64 Thanks
sys-fs/aufs is already in the main tree for a pretty long time, so closing this bug as fixed
just as a side note for those searching for it: you want to look for sys-fs/aufs2 or sys-fs/aufs3