Comment 18 for bug 1970066

Revision history for this message
Rufus Filigrane (ruffiller) wrote (last edit ):

I have a related error after a fresh install of xubuntu 22.04.1 with zfs + encryption:

After doing a first "apt update" followed by an "apt install" of a package, apt and the whole X session crash and apt is broken from then on.

Steps to reproduce:

1. Install (x)ubuntu 22.04.1 with zfs + encryption and boot installed system for the first time
2. apt update
3. apt install <some package>
→ apt and x session crash

It seems that the apt install triggers systemd to unmount every zfs mount because systemd mistakenly thinks the rpool key is not loaded. It fails unmounting /var/lib or / but succeeds with /var/lib/apt, /var/lib/dpkg. This causes apt to not work anymore.

I observed the following:

• Somehow after the first boot of the freshly installed system, the service unit /run/systemd/generator/zfs-load-key-rpool.service is not generated by zfs-mount-generator
• Because this unit must be available and active, this seems to cause systemd to think that the key for the rpool is not loaded → systemd starts unmounting all zfs mounts after some trigger

Workaround: Reboot immediately after the first boot → service unit gets generated and started correctly. This prevents any of the crashes I observed.