QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7162|回复: 3

Aufs下载方式及其简单实例

[复制链接]
发表于 2006-12-17 17:21:33 | 显示全部楼层 |阅读模式
Aufs − another unionfs.
目前aufs只提供CVS方式下载(因为它的作者把稳定版都放入cvs中了)

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

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

编译代码
[code:1]
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
[/code:1]

应用实例
[code:1](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
[/code:1]
 楼主| 发表于 2006-12-17 18:17:24 | 显示全部楼层
我已经成功把neoshine livecd 更换为aufs了    感觉还是蛮好用的 哈哈
回复

使用道具 举报

 楼主| 发表于 2006-12-18 13:02:15 | 显示全部楼层
我利用aufs 将neoshine livecd 升级到3。0

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

echo "Mounting proc filesystem"
mount -t  proc /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 [/code:1]
回复

使用道具 举报

发表于 2009-2-25 16:59:01 | 显示全部楼层
大家好,我的aufs怎么用不了,麻烦各位给看看...

我的操作过程是:
[root@localhost aufs]# make -f local.mk
[root@localhost aufs]# install -m 500 -p mount.aufs umount.aufs auplink aulchown auchk /sbin
[root@localhost aufs]# install -m 644 -p etc_default_aufs /etc/default/aufs
[root@localhost aufs]# echo FLUSH=ALL > /etc/default/auplink
[root@localhost aufs]# insmod ./aufs.ko
insmod: error inserting './aufs.ko': -1 Unknown symbol in module
[root@localhost aufs]#mkdir /lib/modules/2.6.27.7-32/kernel/fs/aufs
[root@localhost aufs]# cp aufs.ko /lib/modules/2.6.27.7-32/kernel/fs/aufs/
[root@localhost aufs]#depmod -a
[root@localhost aufs]# mkdir /tmp/rw /tmp/aufs
[root@localhost aufs]# mount -t aufs -o dirs=/tmp/rw:${HOME}=ro none /tmp/aufs
[root@localhost ~]# 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 编辑 ]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-18 22:31 , Processed in 0.073819 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表