Debian Root on ZFS or just Home on ZFS

Helmut Neukirchen, 8. May 2024

As the Debian installer does not support to install on ZFS (due to potential legal incompatibilities between their licenses), this needs to be done manually (and as usual due to non-free firmware, Wifi is not supported out of the box by Debian, so you need to have an Ethernet cable connection):

I found a good Howto to have Debian Root on ZFS:

There are minor things to be noted:

  1. ashift=12 Some suggest that for SSDs a higher value might be better, e.g., 13. Still need to monitor wearout as ZFS has been reported to kill your SSD after a year.
  2. autotrim=on It is often said that rather a Cron jobs should do this, e.g., weekly.

Note that the above Howto contains also Rescuing using a live CD that might be helpful for rescuing.

I found two further howtos, that are somewhat different, due things in a slightly different order, but are more detailed and explicitly mention implicit steps:

I followed mainly the first howto with some inspiration from the two others. E.g. I created a standard swap partition. TODO: Enable swap and hibernate.

ZFS enables to do snapshots before and after system updates
(TODO: can this be added to any apt upgrade, incl. unattended upgrades?)

Note: After having selected KDE in tasksel, the system did not get KDE started: the textual boot was stuck at the latest task before KDE would be started (some cups stuff): I did then a apt install firmware-amd-graphics and after a reboot, it worked -- not sure whether a reboot alone would have already solved the problem or not.

For my T14, I also installed the WiFi drivers.

Home on ZFS

Somehow, the above installation was very unstable on my laptop (left mouse button not working after suspend, web browser often silently terminating), so I then used the normal Debian installer and just later moved /home to ZFS. Another argument in favour of not having root on ZFS is that in case of problems, having root on ZFS might be problem as ZFS is not natively supported by Debian (but in the above links, there is also a rescue approach mentioned). As an alternative, it has been suggested if snapshots for the root filesystem are a must, rather use BTRFS for that.

https://wiki.debian.org/ZFS for how to add ZFS.

https://theorangeone.net/posts/zfs-on-home/

https://www.shernet.com/linux/zfs-home-directory/

https://askubuntu.com/questions/1081238/migrating-home-to-zfs