LinuxServicesDisksxfs
Posted 炼狱腾蛇
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LinuxServicesDisksxfs相关的知识,希望对你有一定的参考价值。
1. 简介:
据说zfs有去除重复数据的功能,无良人士继续要求吧samba共享盘使用的centos7上自带的xfs改成zfs,并且开启去重功能。samba配置见
http://www.cnblogs.com/demonzk/p/6518675.html
2. 环境:
OS:RHEL 7.3
kernel:
zfs:http://download.zfsonlinux.org/epel/zfs-release.el7_3.noarch.rpm
一些有用的文档:
官方网站:http://zfsonlinux.org/
RHEL & CentOS:https://github.com/zfsonlinux/zfs/wiki/RHEL-%26-CentOS
http://docs.huihoo.com/solaris/11.1/simplified-chinese/html/E36658/gayne.html#scrolltoc
3. 下载与安装:
由于zfs并不在安装盘或者epel中携带,需要去zfs的网站上下载yum源并且安装,并且配置好epel源。
yum源:yum localinstall --nogpgcheck http://download.zfsonlinux.org/epel/zfs-release.el7.noarch.rpm
yum安装:yum install -y zfs
Dependencies Resolved =============================================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================================== Installing: zfs x86_64 0.6.5.9-1.el7_3.centos zfs 336 k Installing for dependencies: cpp x86_64 4.8.5-11.el7 ftp 5.9 M dkms noarch 2.3-1.20161202gitde1dca9.el7 epel 78 k gcc x86_64 4.8.5-11.el7 ftp 16 M glibc-devel x86_64 2.17-157.el7 ftp 1.1 M glibc-headers x86_64 2.17-157.el7 ftp 668 k kernel-devel x86_64 3.10.0-514.el7 ftp 13 M kernel-headers x86_64 3.10.0-514.el7 ftp 4.8 M libmpc x86_64 1.0.1-3.el7 ftp 51 k libnvpair1 x86_64 0.6.5.9-1.el7_3.centos zfs 38 k libuutil1 x86_64 0.6.5.9-1.el7_3.centos zfs 43 k libzfs2 x86_64 0.6.5.9-1.el7_3.centos zfs 125 k libzpool2 x86_64 0.6.5.9-1.el7_3.centos zfs 425 k mpfr x86_64 3.1.1-4.el7 ftp 203 k perl x86_64 4:5.16.3-291.el7 ftp 8.0 M perl-Carp noarch 1.26-244.el7 ftp 19 k perl-Encode x86_64 2.51-7.el7 ftp 1.5 M perl-Exporter noarch 5.68-3.el7 ftp 28 k perl-File-Path noarch 2.09-2.el7 ftp 27 k perl-File-Temp noarch 0.23.01-3.el7 ftp 56 k perl-Filter x86_64 1.49-3.el7 ftp 76 k perl-Getopt-Long noarch 2.40-2.el7 ftp 56 k perl-HTTP-Tiny noarch 0.033-3.el7 ftp 38 k perl-PathTools x86_64 3.40-5.el7 ftp 83 k perl-Pod-Escapes noarch 1:1.04-291.el7 ftp 51 k perl-Pod-Perldoc noarch 3.20-4.el7 ftp 87 k perl-Pod-Simple noarch 1:3.28-4.el7 ftp 216 k perl-Pod-Usage noarch 1.63-3.el7 ftp 27 k perl-Scalar-List-Utils x86_64 1.27-248.el7 ftp 36 k perl-Socket x86_64 2.010-4.el7 ftp 49 k perl-Storable x86_64 2.45-3.el7 ftp 77 k perl-Text-ParseWords noarch 3.29-4.el7 ftp 14 k perl-Time-HiRes x86_64 4:1.9725-3.el7 ftp 45 k perl-Time-Local noarch 1.2300-2.el7 ftp 24 k perl-constant noarch 1.27-2.el7 ftp 19 k perl-libs x86_64 4:5.16.3-291.el7 ftp 688 k perl-macros x86_64 4:5.16.3-291.el7 ftp 43 k perl-parent noarch 1:0.225-244.el7 ftp 12 k perl-podlators noarch 2.5.1-3.el7 ftp 112 k perl-threads x86_64 1.87-4.el7 ftp 49 k perl-threads-shared x86_64 1.43-6.el7 ftp 39 k spl x86_64 0.6.5.9-1.el7_3.centos zfs 29 k spl-dkms noarch 0.6.5.9-1.el7_3.centos zfs 444 k zfs-dkms noarch 0.6.5.9-1.el7_3.centos zfs 1.9 M Transaction Summary =============================================================================================================================================================================================== Install 1 Package (+43 Dependent packages)
注意:一定要出现内核编译的提示才说明zfs的模块被正确编译进了内核,否则一定检查内核,我在第一次安装的时候由于是别人用过的机器,内核在装docker的时候被修改过,导致无法正确吧zfs编译进内核
Building for 3.10.0-514.el7.x86_64 Building initial module for 3.10.0-514.el7.x86_64 Done. spl: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/3.10.0-514.el7.x86_64/extra/ splat.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/3.10.0-514.el7.x86_64/extra/ Adding any weak-modules depmod... DKMS: install completed. Installing : spl-0.6.5.9-1.el7_3.centos.x86_64 42/44 Installing : zfs-dkms-0.6.5.9-1.el7_3.centos.noarch 43/44 Loading new zfs-0.6.5.9 DKMS files... Building for 3.10.0-514.el7.x86_64 Building initial module for 3.10.0-514.el7.x86_64 Done. zavl: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/3.10.0-514.el7.x86_64/extra/ znvpair.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/3.10.0-514.el7.x86_64/extra/ zunicode.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/3.10.0-514.el7.x86_64/extra/ zcommon.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/3.10.0-514.el7.x86_64/extra/ zfs.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/3.10.0-514.el7.x86_64/extra/ zpios.ko: Running module version sanity check. - Original module - No original module exists within this kernel - Installation - Installing to /lib/modules/3.10.0-514.el7.x86_64/extra/ Adding any weak-modules depmod...
4. 配置
#加载模块 modprobe zfs #创建资源池,资源池可以直接当做文件系统使用 zpool create -f zfspool sdb sdc #打开数据去除重复功能 zfs set dedup=on zfspool #打开压缩功能 zfs set compression=on zfspool #最后记得修改文件夹的权限 chown :fred /zfspool chmod g+w /zfspool
以上是关于LinuxServicesDisksxfs的主要内容,如果未能解决你的问题,请参考以下文章