##### March 8, 2021
ubuntu linux lvm cryptsetup initrd

One of my colleagues asked for help the other day with an Ubuntu system that would not boot after an upgrade. It was failing with the error: Volume group "ubuntu-vg" not found. My first thought was that a hard drive had failed but, booting from a rescue CD, I could see the expected disks. This system was set up with an encrypted partition and LVM, and I found this article very helpful in resolving the problem.

From the rescue CD I was able to mount the root and boot file systems:

cryptsetup open /dev/nvme0n1p3 nvme0n1p3_crypt
vgchange -a y
mount /dev/mapper/ubuntu—vg-root /mnt
mount /dev/nvme0n1p2 /mnt/boot


This was encouraging: the data on disk appeared to be intact. Maybe something had gone wrong creating the initial RAM disk when the kernel was upgraded - I had seen that before when the boot partition ran out of space during an upgrade (there was plenty of space in the boot partition on this system, but a corrupt initrd was still a possibility).

Mounting /dev, /proc and /sys inside the root filesystem, we can chroot into the installed system and re-install the latest kernel:

mount -t proc /proc /mnt/proc
mount -t sys /sys /mnt/sys
mount —bind /dev /mnt/dev
chroot /mnt
apt-get update