ZFS on Hetzner Rescue

February 11, 2026

TLDR

pushd "$(mktemp -d)" || exit
wget "$(curl -Ls https://api.github.com/repos/openzfs/zfs/releases/latest | grep "browser_download_url.*tar.gz" | grep -E "tar.gz\"$" | cut -d '"' -f 4)"
apt update && apt install libssl-dev uuid-dev zlib1g-dev libblkid-dev -y && tar xfv zfs*.tar.gz && rm *.tar.gz && cd zfs* && ./configure && make -j "$(nproc)" && make install && ldconfig && modprobe zfs && popd || echo -e "\e[31m\e[1mInstall failed, please fix manually!\e[0m"
zpool status

Boot into Rescue

Once you're in rescue you need to activate ZFS which is not installed by default. If you try to run any of the zfs-based tools, you'll activate Hetzner's script which will try to install ZFS.

root@rescue ~ # cat $(which zpool)

The key part is the final few lines which we can run manually. As of Feb 11, 2023, however, this script doesn't work so we'll need to patch it.

First step, let's copy the script:

cp /root/.oldroot/nfs/tools/install_openzfs.sh ~/install_openzfs2.sh

Then we'll download and apply the patch:

wget https://gist.githubusercontent.com/west17m/1f459a722026751ccdbf744df093dbec/raw/3ba9b2034d970289623720135d331527b977a605/install_openzfs.sh.20230211.patch
patch install_openzfs2.sh install_openzfs.sh.20230211.patch

Run the last few lines. Always be careful piping to bash:

tail -n 2 install_openzfs2.sh | bash

Setting up a New System

Once ZFS is loaded, you can import your pools and access your data for recovery or maintenance.