Enhancing our ZFS support on Ubuntu 19.10 - an introduction

This is not particularly related to ZFS, but yeah, I used to work on OneConf (which had quite some users at the time). However, the tool was retired when the backend (linked to the online Software Center) was removed. I don’t know of any other tools than low level backups which can handle this.

It took a long time and multiple tried to upgrade from 19.10->20.04 and broke in so many ways that I skipped the “boot on zfs” part to simplify the problem. I’ve finally succeeded with the 20.04 upgrade. So I’m back to the “update approach” to convert ext4 boot to zfs + zsys boot. My hope is the create a separate zfs disk with the zsys layout and a minimal 20.04 system on it and boot that using a live disk. Then copy the old ext4 root partition into the new / (rpool). Is there a list of files I shouldn’t overwrite on the new /? Is there a utility to do what I envision? Please advise. Ty.

I use boot on zfs, both the old way and I use the Ubuntu install. Unto now I use the Ubuntu install on:

  • HP Elitebook 8540p with an 1st gen i5 and a 250GB HDD (7200 rpm)
  • Ryzen 3 2200G with a 512GB nvme-SSD

I never have any problem with “boot on zfs”, however I directly purge zsys after the installation! Sorry Didier. Because I detected a number of issues with zsys, like independent administration of snapshots by zsys and zfs, so you ended up with two adminstrations that could easily deviate. I ended up with far too many snapshots and so much that it cluttered up the boot partition and the system stopped working. The system got slow! Basically zsys created more problems than it solved.
I only rely on the official zfs snapshots and you could create them once a month or week. You could invent your own naming convention, I use yymmdd and the Linux release number. That scripts is

sudo zfs snapshot -r bpool/BOOT@$1
sudo zfs snapshot -r rpool/ROOT@$1
sudo zfs snapshot -r rpool/USERDATA@$1
zfs list -t snapshot | grep bpool
zfs list -t snapshot | grep rpool

-r means recursive, so including all lower level datasets.

I have the same scripts for rollback and destroy and in general I keep only a few system snapshots. Rolling back and rerunning the latest updates does not take a lot of time. You could snapshot your user dataset more frequently, but coupling that to the system updates (zsys), instead of your user activity seems useless. I did rollback the distro upgrade from 20.04 to 19.10 in this way, after I detected, that Virtualbox did not work with Linux 5.4 at that time.

I’m lazy so I have a second small and minimal ext4 installation on my system as last resort, so I can rollback to one of the system snapshots, if it is not possible for some strange reason by booting from the main system or from the previous version of Linux. Of course you could use any old USB disk, Flash drive or the live-CD for that purpose.

My other HP Elitebook 8460p still runs and has been upgraded from my old initial install on Ubuntu 19.04. There I copied the ext4 install to 1 datapool with 1 dataset and did the GRUB update to get the system booting from ZFS, see https://blog.heckel.xyz/2016/12/31/move-existing-linux-install-zfs-root/
It is not officially recommended, but it is very simple and easy to script and I used it with 19.04. Afterwards I upgraded to 19.10 and later to 20.04. The advantage is that you can define the partitions according to your own choice, so on my 1 TB SSHD I have:

  • ext 4 system partition as last resort
  • swap partition
  • “zfs on boot” root partition and datapool also used for my virtual machines (VM).
  • zfs partition and datapool for my data and archives.

I use 2 zfs partitions/datapools to get the fastest part of my 1 TB SSHd reserved for the main/host system and the VMs. I still run it on my 2nd gen i5 laptop.
I don’t expect, that these type of installations will work with zsys, you will have to use the standard ZFS snapshots.
Probably I will have another serious look at zsys in 2021.

https://github.com/ubuntu/zsys/issues/105

I think it’s on his todo list unless i misunderstood the github post?

Yes, it seems to be on the to do list, but I don’t trust zsys yet, it has and had too many issues. As long as they do not rely for 100% on the snapshots as maintained by ZFS itself, I will avoid zsys.

Besides like I said, as user I do not have enough control about the automatically generated snapshots. If you generate them automatically, I need a function to destroy them automatically and maintain e.g. one snapshot of the previous days/the previous weeks and the previous months. Or maybe I want only one snapshot per older Linux sub-sub version, so one for 5.8.0-8, one for 5.8.0-10 etc.

If I reorganized the tags of my music during a day, I want to be able to snapshot, that “Home” change by a manual zfs command and it should be protected against a rollback during booting. Zsys should not undo a day of hard work by rolling back my music folder. Currently I keep all my data in a separate datasets on the SSD boot device like: ‘rpool\VBOX’ or on a separate datapool on my HDDs, like ‘dpool’.
I don’t need another set of commands, that duplicate existing ZFS functionality. Besides it complicates future maintenance, when the OpenZFS snapshot commands get extended or changed.

I only found out about ZFS a few weeks ago so i’m completely out of my depth on the subject but i would like to be able to disable auto-snapshots without removing Zsys , take a manual snapshot of the entire drive and add it to the grub menu so friends an family can easily put the computer back to the way it was when they have finished using it.

You can disable user data autosnapshot via:

$ systemctl mask --user zsys-user-savestate.timer

and disable system + user snapshots on apt installation via:

$ sudo rm /etc/apt/apt.conf.d/90_zsys_system_autosnapshot
1 Like

@didrocks

Thanks for that. :+1: