Installing ZFS FileSystem and Basic Administration on RHEL/CentOS 7
This article will give you the knowledge of ZFS and it’s basic administration on RHEL/CentOS 7. ZFS means Zettabyte File System and also known as Z File System. This is very important when you’re looking for you own trust Storage Redundancy, you can choose ZFS FileSystem. If you don’t have time to read this complete article, you have directly go down and found the Youtube video that will help you the same.
This is a Free and Opensource logical volume manager built by Sun Microsystems for use in their Storage Redundancy in Solaris operating system. Here you will find some of its most appealing features include below.
What is ZFS.?
ZFS is a combination of Volume Manager and Filesystem, which got a lot of useful features. ZFS name originally stood for “Zettabyte File System”
Features of ZFS :
1) Integrated volume manager. No need to have additional volume manager
2) Support Different types of compressions
3) Support Snapshots and Snapshot can be exported to different systems easily
4) Support different level of RAID.
5) File system (FSCK) can be done online on ZFS (ZFS term Scrub).
6) Supports hot spare devices
7) ZFS supports different filesystem compressions.
8) ZPOOL capacity of 256 ZB, have better space management. ZFS file systems have access to the common free space of the entire pool.
9) Lightweight filesystem creation
Main terminologies of ZFS:
POOL/ZPOOL: ZPOOL is a basic building block of ZFS.A zpool is made of one or more disks/devs.
1) Every pool has a unique name and unique UID.
2) ZPOOL can be imported/exported from/to servers.If ZPOOL is on shared luns, can export/import pool to different servers.
3) If pool is exported, its unique identifier is pool UID
4) The pool can be imported in read-only mode.
5) Can implement “raid0” “raid1”, “raid6 or raidz2 ” , “raid7 or raidz3” , “raid10 or raid1+0”
6) FSCK/Scrubbing happened on ZPOOL level.
VDEV: VDEV is the term for Virtual Device, ZFS supports Disks/Files as VDEVs.
Log Devices: ZFS Log Devices, also known as ZFS Intent Log (ZIL) are useful for increasing the performance of ZFS filesystem. Log devices are usually SSD or high-performance devices.
Cache Device: Adding a cache vdev to a pool will add the storage of the cache to the L2ARC.
Dataset /ZFS Filesystem: Dataset can be referred to ZFS file system, volume, snapshot or clone.
Installation of ZFS on RHEL/CentOS 7:
1) Update your system
# yum update
2) Reboot the system
# init 6
3) Cleanup the OLD/Inactive Kernel packages
# package-cleanup –oldkernels –count=1
4) Install EPEL Release and Development Kernal
# yum install kernel-devel epel-release -y
5) Configure ZFS repo and Install ZFS
# yum install http://download.zfsonlinux.org/epel/zfs-release.el7.noarch.rpm -y
# yum install zfs -y
6) Setup the the ZFS services
# systemctl preset zfs-import-cache zfs-import-scan zfs-mount zfs-share zfs-zed zfs.target
# systemctl enable zfs-import-scan.service
# systemctl enable zfs-import-cache.service
7) Reboot the system
# init 6
Basic ZFS Commands
Create a simple/raid0 ZPOOL.
# zpool create <poolname> <disk1> <disk2>
Create a mirror ZPOOL.
# zpool create mirror <poolname> mirror <disk1> <disk2>
Create a raidz ZPOOL.
# zpool create <POOLNAME> raidz <disk1> <disk2> <disk3>
Checking ZPOOL status
# zpool status
# zpool status <poolname>
Checking ZPOOL properties/attributes
# zpool get all <poolname>
# zpool get <property_name> <poolname>
Export/Import a Pool
# zpool export <poolname>
# zpool import <poolname> or <pool-uid>
Creating a ZFS Dataset/Filesystem
# zfs create <poolname/dataset>
Set Quota on ZFS filesystem
# zfs set quota=<SIZE> <poolname/dataset>
# zfs set mountpoint=<mountpoint> <poolname/dataset>
To Share a ZFS on NFS
# zfs set sharenfs=on <poolname/dataset>
Enabling Compression on ZFS Filesystem
# zfs set compression=gzip <poolname/dataset>
Taking Snapshot of ZFS Filesystem
# zfs snapshot <poolname/dataset>@<snap_name>
# zfs list -t snapshot
Destroying a ZFS
# zfs destroy <poolname/dataset>@<snap_name>
# zfs destroy <poolname/dataset>
Export/Import a ZPOOL
# zpool export <poolname>
# zpool import <poolname>
Removing a ZPOOL
# zpool destroy <poolname>
Watch this video for More Details :