Enlarge / This is a Fossa. It appears to be focusing. (Cryptoprocta ferox is a small, catlike carnivore native to Madagascar.)Mathias Appel

Last October, an experimental ZFS installer showed up in Eoan Ermine, the second interim Ubuntu release of 2019. Next month, Focal Fossa—Ubuntu's next LTS (Long Term Support) release—is due to drop, and it retains the ZFS installer while adding several new features to Ubuntu's system management with the fledgling zsys package.

Phoronix reported this weekend that zsys is taking snapshots prior to package-management operations now, so we decided to install the latest Ubuntu 20.04 daily build and see how the new feature works.

Taking Focal Fossa for a quick spin

  • When installing the daily beta of Focal Fossa, Advanced Features still offers ZFS installation—but still brands it "experimental." Jim Salter
  • The ZFS installer layout spans four partitions: one primary partition used for UEFI boot, and three logical partitions used for swap, boot pool, and root pool. Jim Salter
  • Now that we've picked the ZFS installer and stuck to our guns about it, we're off to the races. Jim Salter

Focal installs much as any other Ubuntu release has, but it retains 19.10's ZFS installer—which is still hidden behind "advanced features" and still labeled experimental. After selecting a ZFS install, you give your OK to the resulting partition layout—with one primary partition for UEFI boot and three logical partitions for swap, boot ZFS pool, and root ZFS pool. A few minutes later, you've got yourself an Ubuntu installation.

A quick look under the hood

  • A quick apt-policy check shows us that zsys 0.4.1 is installed, and there are no ZFS snapshots on our system yet. Jim Salter
  • After installing gimp, we can see that Focal has taken a snapshot of every dataset in the root pool. Jim Salter
  • We tried installing a second package immediately after Gimp and didn't see any new snapshots. A peek at /usr/zlib/zsys-system-autosnapshot shows us why. Jim Salter

After installing Fossa, the first thing we did was verify the installed version of zsys. The apt management snapshots were added very recently in 0.4.1, and we've learned not to take for granted what's installed on beta or pre-beta daily builds of Linux distributions. Zsys was, in fact, already installed by default and was at version 0.4.1.

There weren't any snapshots on the freshly installed system yet, so we did a quick apt install gimp. Afterward, we saw that zsys had taken a snapshot in every dataset present on rpool. Having a snapshot taken prior to installing new packages means that, if something should go haywire, we can easily revert the system to its state prior to the new package being installed. Carving the system up into so many different datasets means, in turn, that we can roll back only those parts of the system affected by the package manager—for example, we can roll back packages without affecting data in the user's home directory.

After installing gimp and seeing new snapshots available, we tried installing a second package. One apt install pv later, we again checked for snapshots. Although we still found the snapshots taken prior to installing gimp, there were no new snapshots to roll back our pv installation. After several more experimental installations and removals with no new snapshots, we started grep-ing our way through the /etc directory to find out why.

In apt.conf.d we find a config file named 90_zsys_system_autosnapshot that adds a pre-install hook to dpkg. This pre-install hook calls zsys-system-autosnapshot prior to making any changes to the package system. We weren't sure why we hadn't gotten any new snapshots, so we tried running zsys-system-autosnapshot directly—still no new snapshot.

When we then took a look at zsys-system-autosnapshot itself, the reason for no new snapshots being taken was obvious. A minimum interval is built into that script so that it exits without doing anything if it has been less than 20 minutes since the last time it took snapshots.

We're pretty dubious about this minimum-interval feature. On the one hand, once you accumulate a few thousand snapshots, you can begin seeing filesystem performance issues. On the other hand, we foresee a lot of problematic package installations not getting covered with snapshots this way.

Zsys is still early in development

  • Note the highlighted text. After the 20-minute minimum interval expires (or you remove or decrease the interval), a sharp eye can spot zsys-systemRead More – Source [contf] [contfnew]

    arstechnica

    [contfnewc] [contfnewc]