让Linux内核支持AUFS文件系统

让Linux内核支持AUFS文件系统

1. Linux 4.x patch with AUFS

参考:

Docker安装: Get Docker Engine - Community for Ubuntu (https://docs.docker.com/install/linux/docker-ce/ubuntu/)
AUFS官网: http://aufs.sourceforge.net/ ★★★
AUFS官网: https://github.com/sfjro/aufs4-standalone
AUFS补丁: Linux Kernel AUFS Patch (https://0066.in/archives/709?utm_source=tuicool&utm_medium=referral)
AUFS补丁: Ubuntu 14.04 with 4.0.4 kernel and latest AUFS from source (https://zackreed.me/ubuntu-14-04-with-4-0-4-kernel-and-latest-aufs-from-source/)

  • 检查内核是否支持AUFS

    $ grep aufs /proc/filesystems
    nodev   aufs
    
  • 检查Docker使用的FS驱动

    $ docker info
    Storage Driver: aufs
    Root Dir: /var/lib/docker/aufs
    Backing Filesystem: extfs
    Dirs: 0
    Dirperm1 Supported: true
    
    Storage Driver: overlay2
      Backing Filesystem: extfs
      Supports d_type: true
      Native Overlay Diff: true
    
  • patch

    git clone https://github.com/sfjro/aufs4-standalone.git aufs4-standalone.git
    cd aufs4-standalone.git/
    git checkout origin/aufs4.0
    
    ## 标题: Linux Kernel AUFS Patch (https://0066.in/archives/709?utm_source=tuicool&utm_medium=referral)
    ## 作者:阿博 2016年11月26日
    ## 以Linux Kernel目前最新stable的4.8.10为例。下载并解压内核源码
    wget -c https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.8.10.tar.xz
    xz   -d linux-4.8.10.tar.xz && tar xf linux-4.8.10.tar
    ##  下载补丁以及打补丁,需要注意的是第4行需指定对应的内核版本,现在是4.8.10所以对应是aufs4.8,如果是4.7.5那么对应就是aufs4.7,以此类推,本篇所提到的补丁仅适用内核在4.x以上版本,3.x的不适用。
    cd  linux-4.8.10
    git clone git://github.com/sfjro/aufs4-standalone.git
    cd  aufs4-standalone.git/
    git checkout origin/aufs4.8
    cd  ../ ## 回到linux-4.8.10目录
    cp  -R  aufs4-standalone.git/{
          
          Documentation,fs} ./
    cp      aufs4-standalone.git/include/uapi/linux/aufs_type.h include/uapi/linux/
    patch -p1 < aufs4-standalone.git/aufs4-kbuild.patch
    patch -p1 < aufs4-standalone.git/aufs4-base.patch
    patch -p1 < aufs4-standalone.git/aufs4-mmap.patch
    patch -p1 < aufs4-standalone.git/aufs4-standalone.patch
    ## 接下去就是常规的编译内核了,在内核配置界面中找到Filesystems,然后Miscellaneous filesystems,开启对应的aufs选项即可。
    




2. Linux 3.x patch with AUFS

参考:
AUFS官网: https://github.com/sfjro/aufs3-linux
AUFS补丁: https://metztli.blog/index.php/debian-patching-linux-kernel-to

  • download
    git clone git://git.code.sf.net/p/aufs/aufs3-standalone aufs3-standalone.git
    // 或
    git clone https://github.com/sfjro/aufs3-linux.git aufs3-linux.git
    
  • patch
    cd linux 3.18.135
    gzip -cd ../patch-3.x.gz | patch -p1   //Replace "x" for all versions bigger than the version "X" of your current source tree
    //or
    bzip2 -dc ../patch-3.x.bz2 | patch -p1
    // Alternatively
    linux/scripts/patch-kernel linux  
    

猜你喜欢

转载自blog.csdn.net/hylaking/article/details/100776632