From 4ee03cefd49a4c128bf7790951f4dc151d0326b3 Mon Sep 17 00:00:00 2001 From: Akshay Mankar Date: Sun, 15 Oct 2023 16:35:52 +0200 Subject: [PATCH] hetzner-dedicated/zfs: Install right version of zfs --- .../hetzner-dedicated/zfs-uefi-nvme-nixos.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/hosters/hetzner-dedicated/zfs-uefi-nvme-nixos.sh b/hosters/hetzner-dedicated/zfs-uefi-nvme-nixos.sh index 3a76b95..62fd353 100644 --- a/hosters/hetzner-dedicated/zfs-uefi-nvme-nixos.sh +++ b/hosters/hetzner-dedicated/zfs-uefi-nvme-nixos.sh @@ -29,10 +29,26 @@ export LC_ALL=C apt update -apt install -y dpkg-dev linux-headers-$(uname -r) linux-image-amd64 sudo parted zfsutils-linux libssl-dev uuid-dev zlib1g-dev libblkid-dev +apt install -y dpkg-dev linux-headers-$(uname -r) linux-image-amd64 sudo parted libssl-dev uuid-dev zlib1g-dev libblkid-dev set -euox pipefail +rm -f /usr/local/sbin/zfs +rm -f /usr/local/sbin/zpool + +cd "$(mktemp -d)" +# Don't download latest, ZFS 2.2 creates zpool which cannot be loaded by zfs +# 2.1.x +# +# wget "$(curl -Ls https://api.github.com/repos/openzfs/zfs/releases/107594126 | grep -E "browser_download_url.*\.tar.gz\"$"| cut -d '"' -f 4)" +wget https://github.com/openzfs/zfs/releases/download/zfs-2.1.13/zfs-2.1.13.tar.gz +tar xfv zfs*.tar.gz && rm zfs*.tar.gz +cd zfs* +./configure && make -j "$(nproc)" +make install +ldconfig +modprobe zfs + # Inspect existing disks # Should give you something like # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT