參考資料 :
安裝說明
CentOS 6.x
yum localinstall --nogpgcheck http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum localinstall --nogpgcheck http://archive.zfsonlinux.org/epel/zfs-release.el6.noarch.rpm yum install kernel-devel zfs
CentOS 7.x
yum localinstall --nogpgcheck https://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm yum localinstall --nogpgcheck http://archive.zfsonlinux.org/epel/zfs-release.el7.noarch.rpm yum install kernel-devel zfs
開啟運行服務
安裝完成後,已經自動註冊服務,因此下次開機會自動啟動。不過剛安裝完還沒啟動,請下指令啟動服務/etc/init.d/zfs start
建立Pool
利用zpool指令建立第一個pool( 參考 http://illumos.org/man/1m/zpool )zpool create <名稱> <device>
zpool create datapool /dev/sdb1查看看是否有成功建立
zpool list
NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT
datapool 39.8G 172K 39.7G 0% 1.00x ONLINE -
建立一個具有壓縮功能的分區
zfs create -o compression=lz4 datapool/data1
列出分區
zfs list
NAME USED AVAIL REFER MOUNTPOINT
datapool 148K 39.1G 32.5K /datapool
datapool/data1 30K 39.1G 30K /datapool/data1
補充說明
如果您遇到開機的時候無法automount,也就是啟動 /etc/init.d/zfs 時出現 /dev/zfs permission denied的錯誤,請先參考以下文件
http://zfsonlinux.org/faq.html#HowDoIAutomaticallyMountZFSFilesystemsDuringStartup
該文件主要是說zfs套件還沒支援 SELinux policy,因此建議將SELinux policy改為permissive 或 disabled
$ cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
沒有留言:
張貼留言