BOoRFGOnZ 发表于 2006-12-17 17:21:33

Aufs下载方式及其简单实例

Aufs − another unionfs.
目前aufs只提供CVS方式下载(因为它的作者把稳定版都放入cvs中了)

cvs -d:pserver:[email protected]:/cvsroot/aufs login

cvs -z3 -d:pserver:[email protected]:/cvsroot/aufs co -P aufs

编译代码

Currently these configurations are written in ./local.mk, ./local.mk will work
for you in most cases.
        $ make -f local.mk
The local.mk searches your kernel source files by
        KDIR = /lib/modules/$(shell uname -r)/build
If you are cross-compiling the aufs module, try
        $ make KDIR=/your/kernel/source/path -f local.mk


应用实例
(after 'make')
        $ man -l ./aufs.5
        # install -m 500 -p mount.aufs /sbin (recommended)
        # insmod ./aufs.ko
        $ mkdir /tmp/rw /tmp/aufs
        # mount -t aufs -o dirs=/tmp/rw:${HOME}=ro none /tmp/aufs

Here is another example.

        # mount -t aufs -o br:/tmp/rw:${HOME}=ro none /tmp/aufs
        or
        # mount -t aufs -o br:/tmp/rw none /tmp/aufs
        # mount -o remount,append:${HOME}=ro /tmp/aufs

BOoRFGOnZ 发表于 2006-12-17 18:17:24

我已经成功把neoshine livecd 更换为aufs了 :-D   感觉还是蛮好用的 哈哈

BOoRFGOnZ 发表于 2006-12-18 13:02:15

我利用aufs 将neoshine livecd 升级到3。0

重写initrd中的linuxrc 如下
#!/bin/bash
#
#=========================================#
# NeoShine Live CD scripts               #
# Author:BOoRFGOnZ <[email protected]>#
#=========================================#
#

echo "Mounting proc filesystem"
mount -tproc /proc /proc
echo "Mounting sysfs filesystem"
mount -t sysfs sysfs /sys

echo "Mounting modules"
modprobe loop
modprobe squashfs
modprobe aufs

echo "Starting udev"
udevstart

echo "Mounting cdrom"
mount /dev/cdrom /cdrom

echo "Makeing kernel don't mount root fs"
echo 0x100 > /proc/sys/kernel/real-root-dev

echo "Creating aufs"
mkdir -p /memory
mount -t tmpfs tmpfs /memory
mkdir -p /memory/changes
mkdir -p /memory/images
mkdir -p /union
mount -t squashfs -o loop /cdrom/NeoShine.sqsh /memory/images
mount -t aufs -o dirs=/memory/changes=rw:/memory/images=ro none /union
mkdir -p /union/proc
mkdir -p /union/sys
mkdir -p /union/tmp
mkdir -p /union/dev
chmod 0777 /union/tmp
mkdir -p /union/initrd

echo "Doing the pivot_root"
cd /union
mknod /union/dev/console c 5 1
pivot_root /union /union/initrd
cd /

echo "Starting system"
exec /usr/sbin/chroot . sbin/init<dev/console >dev/console 2>&1

yorks 发表于 2009-2-25 16:59:01

大家好,我的aufs怎么用不了,麻烦各位给看看...

我的操作过程是:
# make -f local.mk
# install -m 500 -p mount.aufs umount.aufs auplink aulchown auchk /sbin
# install -m 644 -p etc_default_aufs /etc/default/aufs
# echo FLUSH=ALL > /etc/default/auplink
# insmod ./aufs.ko
insmod: error inserting './aufs.ko': -1 Unknown symbol in module
#mkdir /lib/modules/2.6.27.7-32/kernel/fs/aufs
# cp aufs.ko /lib/modules/2.6.27.7-32/kernel/fs/aufs/
#depmod -a
# mkdir /tmp/rw /tmp/aufs
# mount -t aufs -o dirs=/tmp/rw:${HOME}=ro none /tmp/aufs
# mount -t aufs -o dirs=/tmp/rw:${HOME}=ro none /tmp/aufs/
mount: unknown filesystem type 'aufs'
/sbin/mount.aufs: bad /proc/2636/mounts
??????????????????????????

[ 本帖最后由 yorks 于 2009-2-25 17:08 编辑 ]
页: [1]
查看完整版本: Aufs下载方式及其简单实例