I am playing a bit with ZFS on NethServer and ask myself if it is possible to mount /var/lib/nethserver on a ZFS?
What I tried so far is:
##### HowTo install ZFS under NS7 #####
### Step 1: Add ZFS Repository ###
# Check CentOS version:
cat /etc/redhat-release
# Add the repo:
wget https://download.zfsonlinux.org/epel/zfs-release.el7_7.noarch.rpm --no-check-certificate
# Install zfs
yum install zfs-release.el7_7.noarch.rpm -y
### Step 2: DKMS vs kABI ###
# Disable DKMS and enable kABI (enabled=0, enabled=1):
nano /etc/yum.repos.d/zfs.repo
[zfs]
name=ZFS on Linux for EL7 - dkms
baseurl=https://download.zfsonlinux.org/epel/7.4/$basearch/
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
[zfs-kmod]
name=ZFS on Linux for EL7 - kmod
baseurl=https://download.zfsonlinux.org/epel/7.4/kmod/$basearch/
enabled=1
metadata_expire=7d
gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-zfsonlinux
### Step 3: Installing ZFS ###
# install ZFS
yum install zfs -y
# Load zfs module on boot (comment out zfs):
nano /usr/lib/modules-load.d/zfs.conf
# reboot
reboot
### Step 4: Check ZFS Kernel Module ###
# Check if the ZFS kernel module is loaded automatically after reboot:
lsmod | grep zfs
### Step 5: Creating ZFS Pool ###
# To create a mirror pool of just two additional disks:
zpool create zdata mirror /dev/sdb /dev/sdc
# Copy data from /var/lib/nethserver/ to /zdata/:
rsync -avr /var/lib/nethserver/ /zdata/
# Set mountpoint legacy:
zfs set mountpoint=legacy zdata
# Add mountpoint to fstab:
nano /etc/fstab
zdata /var/lib/nethserver zfs defaults 1 2
# Test mounting
mount -a
If I reboot the server I get an error:
After Control-D the server is booting…
What do you think, does ZFS make sense…?