Unofficial zfs on root installation instructions

OK, so after modprobe zfs I generated missing /etc/hostid in the live environment by running

zgenhostid

(no output) and added zfshostid to the exec section of /etc/calamares/settings_online.conf file:

  - userpkglist
  - packages@online
  - zfshostid
  - luksbootkeyfile
  - dracutlukscfg

When I issued dracut-rebuild in the installed OS and rebooted, it booted normally :slight_smile:

1 Like

So two years later with 24.01, is there a complete step-by-step guide or YouTube tutorial on exactly how to set up a bootable ZFS system?

I am familiar with Linux, but not EOS/Arch. Would anyone happen to have a tweaked ISO installer with the above ZFS tweaks already added, perhaps?

I am really happy that I have a Plasma 6 desktop on ext4 on EOS. If I could just get it onto ZFS to match my Proxmox cluster then I’d be extra happy.

SOLVED: The solution for me was to install CachyOS. It’s Calamares ZFS option actually works.

I tried with a new computer the latest version of CachyOS (as of Tuesday) but wasn’t successful to install it.
There are no checkpoints after you start the installation, so you have to kill the gpg-agent at the right time. Not too soon (it is needed during install) otherwise it will be started again, not too late to miss the zpool export -a moment. Quite easy to miss.
Sometimes the same partitioning failed for no obvious reason. I had to reboot and run the whole installation process again.
At the end it failed complaining about some missing configuration file.

EndeavourOS requires some manual steps (see above), but at least it succeeds… :wink:

UPDATE: I don’t know whether something has changed since my previous install or I just forgot to mention it but recently I tried to install EndeavourOS from the GALILEO NEW live ISO using steps above but it failed. It turned out that a few new changes are required:

1.) ZFS module does not support kernel 6.8 being currently installed by the live ISO, so you have to remove it. In chrooted_cleaner_script.sh add one mode line:

    export ZPOOL_VDEV_NAME_PATH=1
    _check_install_mode
    _virtual_machines
    pacman -Rc --noconfirm --noprogressbar linux linux-headers        <-- this one
    _clean_up
    _run_hotfix_end
    _show_info_about_installed_system

During installation you then HAVE TO select LTS kernel software group to install.

2.) When all packages are installed and before the installator announces that the installation is done it tries to unmount the newly installed ZFS filesystem but fails due to the gpg-agent saboteur. So remove from exec section of settings_online.conf the last, umount, item and when the installation finishes, kill gpg-agent and unmount filesystems manually:

for volume in `mount | grep calamares | awk '{ print $3 }'`; do echo $volume ; umount -l $volume ; done

and then export the zpool.

1 Like

Thanks for sharing! I also recently followed my own procedure again and hit some snags. The main issue was not realizing ZFS won’t build for the current linux kernel and I needed to use LTS.

I think I just ended up removing linux linux-headers after chrooting into the installation.

Curious how you tracked down the issue preventing zfs to unmount cleanly. I just forced the shutdown.

I have tried with the latest EndeavourOS_Endeavour_neo-2024.09.22.iso (latest download from the main page as of writing this message) and I was unable to get it to boot.

One noticeable difference is that /etc/calamares/modules/services-systemd.conf does not have mandatory: true/false. It has action: "...". What should the value be?

I have used action: "enable" but not sure whether that is correct.

I have followed all suggested steps mentioned in this thread.

The installation was successful, but when trying to boot, the GRUB did not find the boot partition, even through it exists there as ext4. Neither it worked with systemd-boot. (I did not enable encryption). I can only select UEFI settings from the menu.

The problem with GRUB is that it does not add the pool name on the kernel cmdline (GRUB bug).

It just adds the dataset, i.e. for example root=/ROOT instead of root=rpool/ROOT. You have to add it there manually on the first boot and then add it to /etc/default/grub to the command line. You will end up having two root= options on the kernel command line with the latter having effect.