1 of 10

Linux Clusters Institute:�ZFS Hands On Exercise

J.D. Maloney | Lead HPC Storage Engineer

Storage Enabling Technologies Group (SET)

National Center for Supercomputing Applications (NCSA)

malone12@illinois.edu

Mississippi State, August 21st – 25th 2023

2 of 10

Goal of Hands on Exercises

  • Walk through ZFS install
  • Build vdev_id.conf file
  • Create a zpool
  • Experiment with compression
  • Set up snapshots/restore from them

2

Aug 21st - 25th 2023

3 of 10

ZFS Install

  • Grab the zfs repo & install gpg key

3

Aug 21st - 25th 2023

  • Install the repo
  • Install zfs and kernel-devel
  • Check to make sure all is happy
  • Load the kernel module & Enable module on boot

[root@head ~]# zpool status

no pools available

[root@head ~]# /sbin/modprobe zfs

[root@head ~]# systemctl enable zfs-import-cache zfs-import-scan zfs-mount zfs-share zfs-sed zfs.target

[root@head ~]# yum install zfs kernel-devel

[root@head ~]# rpm -ivh zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm

[root@head ~]# wget https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm

4 of 10

Creating vdev_id.conf file

  • Find devices

4

Aug 21st - 25th 2023

[root@head ~]# fdisk -l | grep "/dev/sd"

  • Find the letters for the 4 5GB volumes in the output of the above

5 of 10

Creating vdev_id.conf file

  • Find devices

5

Aug 21st - 25th 2023

  • Create vdev_id.conf File

6 of 10

Creating zpools

  • Create different kinds of zpools, some examples below

6

Aug 21st - 25th 2023

  • Use the zpool destroy command between zpools

[root@head ~]# zpool create lci mirror slot_0 slot_1 mirror slot_2 slot_3 –f

[root@head ~]# zpool create lci raidz2 slot_0 slot_1 slot_2 slot_3 -f

[root@head ~]# zpool create lci draid2:2d:0s:4c slot_0 slot_1 slot_2 slot_3 -f

[root@head ~]# zpool destroy lci

7 of 10

ZFS Compression

7

Aug 21st - 25th 2023

  • Create a zpool (doesn’t matter geometry)
  • Turn on lz4 compression
  • Rsync over the data again
  • Check the used space with lz4 compression
  • Delete data and try with other algorithms

8 of 10

ZFS Snapshots

8

Aug 21st - 25th 2023

  • On an empty zpool take a snapshot
  • Rsync in some data from sample dataset
  • Take another snapshot of the zpool
  • Delete a subset of data that you copied over
  • Verify it’s gone
  • Rollback to the snapshot you took
  • Verify data is back

9 of 10

ZFS Scrubs

9

Aug 21st - 25th 2023

  • Have a zpool with data on it
  • Run scrub on pool
  • Verify it is running

10 of 10

Wrap Up

10

Aug 21st - 25th 2023

  • Further Exploration
    • Quotas
    • ZFS Send/Receive
  • When done playing with ZFS
    • Destroy any zpools you created
    • Leave ZFS installed, we’ll come back to it later