Create storage pool & dataset

# Use gdisk to make partitions
gdisk /dev/nvme0n1
 
# Create pool
zpool create local-ssd /dev/nvme0n1p3
 
# Set atime & compress to local-ssd pool
zfs set atime=off local-ssd
zfs set compress=lz4 local-ssd
 
# Create dataset
zfs create -o compression=lz4 rpool/local-hdd
zfs set mountpoint=/data/local-hdd rpool/local-hdd
 
# Add log & cache devices
zpool add -f <poolname> log /dev/nvme0n1p1 cache /dev/nvme0n1p2
 
# Remove log or cache devices
zpool remove rpool nvme0n1p1

Zpool iostat

zpool iostat -v 2

ZFS storage

vim /etc/modprobe.d/zfs.conf
 
# 1GB == 1073741824 Bytes
# Set Max ARC size => 16GB == 17179869184 Bytes
options zfs zfs_arc_max=17179869184
 
# Set Min ARC size => 8GB == 8589934592 Bytes
options zfs zfs_arc_min=8589934592
 
# update an existing initramfs for Linux kernel
update-initramfs -u
reboot
 
# check arcstat
arcstat

ZFS export & import

zpool export local-hdd

zpool import -d /dev/disk/by-id local-hdd