默认情况下,CentOS7并没有含ZFS支持的文件和,需要进行更新和安装第三方库。
Step 1:安装第三方库和更新系统
[[email protected] ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
[[email protected] ~]# rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
[[email protected] ~]# rpm -Uvh https://forensics.cert.org/cert-forensics-tools-release-el7.rpm
[[email protected] ~]# rpm -Uvh http://download.zfsonlinux.org/epel/zfs-release.el7_6.noarch.rpm
[[email protected] ~]# yum update -y
[[email protected] ~]# yum groupinstall -y "Development Tools" "Development Libraries" "Additional Development"
[[email protected] ~]# yum install -y kernel-devel kernel-headers
Step 2:重启系统
Step 3:安装zfs,并且载入模块到内核
[[email protected] ~]# yum install -y zfs
[[email protected] ~]# /sbin/modprobe zfs
Step 4:建立池,本例采用镜像的方式
[[email protected] ~]# zpool create zfs mirror /dev/sdb /dev/sdc
[[email protected] ~]# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
zfs 119G 272K 119G - 0% 0% 1.00x ONLINE -
[[email protected] ~]#
Step 5:建立ZFS分区
[[email protected] ~]# zfs create -o quota=80G zfs/data
[[email protected] ~]# zfs list
NAME USED AVAIL REFER MOUNTPOINT
zfs 114K 115G 24K /zfs
zfs/data 24K 80.0G 24K /zfs/data
[[email protected] ~]#
Step 6:查看挂载
[[email protected] ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 50G 3.7G 47G 8% /
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 2.0G 12M 2.0G 1% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/sda1 1014M 163M 852M 17% /boot
/dev/mapper/centos-home 66G 33M 66G 1% /home
tmpfs 394M 0 394M 0% /run/user/0
zfs 116G 0 116G 0% /zfs
zfs/data 80G 128K 80G 1% /zfs/data
[[email protected] ~]#
原文地址:https://www.cnblogs.com/networking/p/10340257.html