Follow-up with logs from the affected machine, which narrow down how
this happened on 26.04.

System: Lenovo IdeaPad Pro 5 14AHP9, Ubuntu 24.04 -> 26.04.1 LTS via 
do-release-upgrade
(ubuntu-release-upgrader-core 1:26.04.25), systemd 255.4-1ubuntu8.17 -> 
259.5-0ubuntu3.4.
/etc/crypttab has one non-root LUKS2 volume for /home:
  home_crypt UUID=... none luks,discard
cryptsetup-bin was installed, but not the cryptsetup package.

1. The normal upgrade path picks the package up correctly. From
/var/log/dist-upgrade/main.log:

  new important dependency: systemd-cryptsetup:amd64
  Installing systemd-cryptsetup:amd64 as Recommends of systemd:amd64
  MarkInstall systemd-cryptsetup:amd64 < none -> 259.5-0ubuntu3.4 @un uN > FU=0

2. The upgrade was interrupted. installArchives() failed in a later dpkg batch: 
the xkb-data 2.46-2
   preinst could not switch /usr/share/X11/xkb to a symlink because of a 
locally added, unowned
   file in that directory. At that point systemd 259 had already been unpacked 
and configured
   (apt-term.log: "Unpacking systemd (259.5-0ubuntu3.4) over 
(255.4-1ubuntu8.17)",
   "Setting up systemd (259.5-0ubuntu3.4)"), but systemd-cryptsetup had not 
been installed yet.

3. The usual recovery does not install it afterwards:
     dpkg --configure -a
     apt-get -f install
     apt-get full-upgrade
   systemd is already at 259 at that point, so its newly added Recommends are 
never re-evaluated.
   APT::Install-Recommends is "1"; there is no pinning on systemd.

4. Result: the system boots without systemd-cryptsetup-generator. /etc/crypttab 
is silently
   ignored, home_crypt is never unlocked, and /home is missing. There is no 
prompt or error
   pointing at crypttab.

5. Fix: apt install systemd-cryptsetup. After that the generator creates
   systemd-cryptsetup@home_crypt.service again, and the next boot unlocked and 
mounted /home normally.

So this is not a regression of the 24.10 fix in the normal path. It is a gap in 
the
interrupted-upgrade path, which leaves a booting system with encrypted volumes 
silently unmounted.

Suggestions:
- Install systemd-cryptsetup in the same dpkg batch as systemd during release 
upgrades.
- Have systemd's postinst, or the release upgrader's post-upgrade checks, warn 
when /etc/crypttab
  has active entries but systemd-cryptsetup is not installed.
- Have the upgrader's failure/recovery path re-apply Recommends introduced by 
packages that were
  already upgraded before the failure.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2084251

Title:
  LUKS not detected or prompted for on boot

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/2084251/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to