2

I had a complete failure during Ubuntu LTS do-release-upgrade and the kernel would panic on boot, even in rescue mode. So I loaded a LiveUSB, mounted my encrypted partition, chrooted to it and repaired/finished the installation. Or so I thought.

It's going farther now (no panic) but it fails to find the right encrypted partition: it's looking for kubuntu-vg while the name of the real one (on /dev/sda5) should be mapper/kubuntu--vg-root then it drops me to a busybox shell.

What should I do to change the name of the LUKS partition ? Is it a grub of initramfs setting ?

Edit: From the initramfs shell:

cryptsetup luksOpen /dev/sda5 kubuntu-vg
lvm pvscan
[Ctrl-D]

It then boots normally. But then how do I fix the system, things seem normal but the boot fails again even after update-grub:

$ blkid
/dev/sda5: UUID="99db...9f" TYPE="crypto_LUKS" PARTUUID="00...05"
...
$ cat /etc/crypttab
sda5_crypt UUID=99db...9f none luks
$ cat /etc/fstab
/dev/mapper/kubuntu--vg-root / ext4 errors=remount-ro 0 1
...
$ sudo update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-5.15.0-47-generic
cryptsetup: WARNING: target 'kubuntu-vg' not found in /etc/crypttab

What am I missing ?

Edit 2: If I edit the fstab:

$ cat /etc/fstab
#/dev/mapper/kubuntu--vg-root / ext4 errors=remount-ro 0 1
/dev/mapper/sda5_crypt / ext4 errors=remount-ro 0 1

$ sudo update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-5.15.0-47-generic
cryptsetup: WARNING: target 'kubuntu-vg' not found in /etc/crypttab
W: Couldn't identify type of root file system for fsck hook

So it's worse than just leaving kubuntu--vg-root

4
  • shouldn't it be /dev/mapper/sda5_crypt in fstab?
    – Cagri
    Sep 2, 2022 at 22:59
  • Even if that is so, isn't the fstab used only AFTER unencrypting the disk ? Or is the fstab used in the build of the initramfs/grub ?
    – dargaud
    Sep 3, 2022 at 7:26
  • Updated post to reflect last try.
    – dargaud
    Sep 3, 2022 at 7:54
  • /dev/mapper/sda5_crypt is the "unencrypted disk", which you can mount like any other device, nice to see it worked
    – Cagri
    Sep 3, 2022 at 10:39

1 Answer 1

2

I took the hint from the update-initramfs message and changed /etc/crypttab:

#sda5_crypt UUID=99dbb00a-51e5-4081-aa45-bb9999d9bf9f none luks
kubuntu-vg UUID=99dbb00a-51e5-4081-aa45-bb9999d9bf9f none luks

$ sudo update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-5.15.0-47-generic
...
done

Next reboot worked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .