Basic ‘ZFS on Linux’ setup on CentOS 7

Here is a quick guide to getting a plain ZFS partition working on a Linux machine using the “ZFS on Linux” project.  I was playing around on a CentOS 7 virtual machine trying to set it up as a replication target for my home FreeNAS box as a backup.  If you are unfamiliar with ZFS, it is a filesystem for a storage environment, having features such as data integrity protection and snapshots; I came across it as it is used in FreeNAS.

Here is the procedure I used:

  • Install ZFS as per ZFS on Linux instructions.
  • Check ZFS by running zpool status.
    • If you encounter the following error when you run zpool status:
      [root@zenith ~]# zpool status
      Failed to load ZFS module stack.
      Load the module manually by running 'insmod /zfs.ko' as root.
    • Find the kernel version of your system using: uname -r
      Mine was 3.10.0-123.20.1.el7.x86_64, so replace that with yours below.
    • dkms install spl/0.6.3 -k 3.10.0-123.20.1.el7.x86_64
    • dkms install zfs/0.6.3 -k 3.10.0-123.20.1.el7.x86_64
  • Create a pool
    • zpool create <pool name> <devices to use>
    • e.g., zpool create tank /dev/xvda3
  • Create a data set
    • zfs create -o mountpoint=<where to auto mount the data set> <pool name>/<data set name>
    • e.g., zfs create -o mountpoint=/mnt/testdata tank/testdata
  • Or if you adding a disk that already has ZFS on it:
    • Run zpool import to see if any pools can be imported
    • Then run zpool import <pool name>



Leave a Reply

Your email address will not be published. Required fields are marked *

The reCAPTCHA verification period has expired. Please reload the page.