Skip to content

Instantly share code, notes, and snippets.

@ArnaudD
Created January 7, 2017 22:00
Show Gist options
  • Save ArnaudD/0f551ef17db1e51744010ee57df38a54 to your computer and use it in GitHub Desktop.
Save ArnaudD/0f551ef17db1e51744010ee57df38a54 to your computer and use it in GitHub Desktop.
Zfs config

Credit : https://blog.openmarmot.com/2016/05/18/zfs-on-ubuntu-16-04/

install

apt-get install zfsutils-linux

use fdisk to get the disk names

fdisk -l

create a RAIDZ2 pool RAIDZ2 is similar to RAID 6 '-f' overrides errors (like no partition table warnings)

zpool create -f testpool raidz2 /dev/vdb /dev/vdc /dev/vdd /dev/vde

check zpool status to see the results

zpool status

create a couple filesystems

zfs create testpool/fs1
zfs create testpool/fs2

check the current config

zfs list

NFS share

install

apt-get install nfs-kernel-server
systemctl start nfs-kernel-server
systemctl enable nfs-kernel-server

fake mount needed to get the NFS daemon to start with no mounts

echo '/mnt localhost(ro)' >> /etc/exports
zfs set sharenfs="rw=@10.8.2.0/24" testpool/fs1
zfs share testpool/fs1

change to : ZFS_SHARE='yes'

vi /etc/default/zfs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment