Make Ubuntu Boot Again!

When I restored my full-disk encrypted system with TimeShift lately it didn't boot after the restoration process. Precisely it could not find my encrypted logical volume that contains the Ubuntu 18.04. And so I received just the

WARNING: Failed to connect to lvmetad.

You'll find a similar report and important hints to solution here.

I actually struggled some time because of this:

When running cryptsetup luksOpen, you must use the same name as the one that is in /etc/crypttab on the root parition (sda3_crypt in this example).

And because of the fact that I had to change my harddrive before restoration since I suspected it of being damaged. Since that was the actual problem with the booting process. The machine simply could not find the devices by the old UUIDs.

After some annoying failures I finally found out how to fix my restored system.

  • Boot into a LiveUSB system
  • Open a Terminal
  • Chroot into the encrypted system:
sudo -i
cryptsetup luksOpen /dev/sda3 sdc3_crypt
vgchange -ay
mount /dev/mapper/ubuntu--vg-root /mnt
mount /dev/sda2 /mnt/boot
mount /dev/sda1 /mnt/boot/efi
mount -o rbind /dev /mnt/dev
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
chroot /mnt /bin/bash
  • Now I could edit /etc/fstab AND /etc/crypttab and change the UUIDs to right ones which I checked by lsblk -f.

(I failed some times because I didn't open the volume as sdc3_crypt but like in the instruction as sda3_crypt. So that in the next step the update of the initramfs couldn't find it. Check the correct label in the /etc/crypttab.)

  • After checking that everything I needed was there by:

apt install lvm2 cryptsetup

  • I could fix my problem by:

update-initramfs -c -k all

Now I could reboot into my restored system.

Resume From Swap doesn't work

If you receive a message after apt upgrade that the UUID of your /dev/mapper/ubuntu--vg-swap doesn't link to any device this might be the reason why suspend doesn't work properly. It means that the UUID which is defined in etc/initramfs-tools/conf.d/resume isn't correct. Get the correct UUID by

sudo blkid

copy the UUID of the /dev/mapper/ubuntu--vg-swap and paste it into etc/initramfs-tools/conf.d/resume instead of the old one.

sudo update-initramfs -u -k all

again after that and the error message won't appear again. I didn't start my machine yet but I'm hopefull it will work :P