Ubuntu 22.04 service fails to start after re-encrypting LUKS volume changed partition UUIDs
Environment
Physical server running Ubuntu 22.04 LTS, root on LUKS-encrypted /dev/sda2, re-encryption performed with cryptsetup-reencrypt, /etc/crypttab and /etc/fstab previously referenced by UUIDs, systemd used for boot target and service dependencies.
Symptoms
After completing LUKS re-encryption and rebooting, several systemd services (nginx, custom-app.service) fail to start during boot with 'dependency failed' errors and system enters multi-user.target with services inactive; services start manually after mounting the filesystem.
Observations
journalctl -b shows systemd-unit failures reporting mount point unavailable; fstab mount by UUID failed with 'no such device'; /dev/mapper/cryptroot is present after manual luksOpen but the UUIDs from lsblk -f differ from the entries in /etc/crypttab and /etc/fstab; initramfs still tries to mount old UUID at early boot.
Already attempted
Manually opened LUKS container with cryptsetup luksOpen and mounted root to /mnt; edited /etc/crypttab and /etc/fstab to match new UUIDs and regenerated initramfs with sudo update-initramfs -u; ran systemctl daemon-reload; rebooted once more — services still fail during cold boot but can be started after interactive rescue and mounting the filesystem.
Question
How do I ensure systemd services start automatically on boot after LUKS re-encryption changed UUIDs, and what reversible boot-time checks should I perform to avoid repeated manual intervention?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Linux23% match
Ubuntu drops to emergency mode after cloning LUKS-root to a new SSD — cryptsetup mapping not found
Open0 answers - Linux23% match
systemd service ExecStart script returns 'Permission denied' only when run as non-root user after unit file move
Open0 answers - Linux21% match
systemd socket-activated service times out after moving /var to separate partition
Open0 answers