0

I have an Ubuntu 20.04 machine whose main internal drive has 3 partitions:

  • /dev/nvme0n1p1, EFI system partition, fat32, 512 Mb
  • /dev/nvme0n1p2, unlocked ext4 partition, 732 Mb
  • /dev/nvme0n1p3, encrypted LVM partition, 475 Gb

It used to work perfectly, but for a few days I can't enter into Ubuntu. I don't know what happened. Now the PC boots into GNU GRUB version 2.04 (why?), then I have to click for a normal boot and it shows this error message:

Volume group "vgubuntu" not found
Cannot process volume group vgubuntu
Please unlock disk nvme0n1p3_crypt: _

Then I can enter the right password, but the boot always fails a few seconds later. Everything is blocked after a lot of error messages.

I have tried to adapt those instructions and a few others (notably this) to my case. Here is what I did:

  • Booted into Ubuntu (“Try Ubuntu”) using an external drive.
  • Launched the Terminal app and entered this:

sudo -i

cryptsetup open /dev/nvme0n1p3 nvme0n1p3_crypt (and password accepted)

vgchange -a y
mount /dev/mapper/vgubuntu-root /mnt
mount /dev/nvme0n1p2 /mnt/boot
mount /dev/nvme0n1p1 /mnt/boot/efi
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount --bind /dev /mnt/dev
mount --bind /run /mnt/run
chroot /mnt
update-initramfs -c -k all

The generated message is update-initramfs: Generating /boot/initrd.img-5.15.0-46-generic.

  • Then I type exit and sudo reboot now. But rebooting into the main internal drive shows the same initial error message.

Unfortunately I am not a Ubuntu professional, but I really need to repair that internal drive. Any help will be greatly appreciated.

(Also, is there some repair utility/application that can be downloaded and used from the “Try Ubuntu” external drive ? I would happily try those help apps.)

JYF
  • 41
  • When in chroot, did you also reinstall grub? Example: https://ubuntuforums.org/showthread.php?t=2349833&page=8&p=13602088#post13602088 – oldfred Sep 08 '22 at 14:45
  • @oldfred I've just reinstalled grub following the instructions on that page (thank you), but the boot is still not working (volume group vgubuntu not found...). — Also, the vgs command (in chroot) gives this: vgubuntu 1 2 0 wz--n- <475,71g 0 I suppose vgubuntu exists but is not recognized by grub? – JYF Sep 08 '22 at 16:09
  • @oldfred Tested also the vgdisplay command (in chroot) and vgubuntu seems to be stated as present, once again. Here is what vgdisplay returns: VG Name vgubuntu […] Format lvm2 […] VG Access read/write […] VG Status resizable […] VG Size <475,71 GiB, etc. – JYF Sep 08 '22 at 16:13
  • I am familiar with grub & UEFI boot, but do not know LVM,other than having seen other posts on similar issues. One user with LVM (but not encryption) says if you cannot fix it in an hour, just reinstall & restore from backup. That should only take an hour, if backup is good. I do not believe it is related to efi partition as in title. You may want a new question with LVM/encryption in title, so those that know LVM may respond. – oldfred Sep 08 '22 at 16:31
  • @oldfred I'm not a Ubuntu specialist, and in my case I find very strange that the 3 partitions (incl. encrypted) seem to be in good state, and all data preserved. I suspect that the boot problem (Volume group "vgubuntu" not found) is minor, can be easily corrected (how?), but I might be wrong. – JYF Sep 08 '22 at 16:37
  • If the reinstall of grub works, your ESP should refer to grub in /boot and grub in /boot partition should ask to decrypt LVM & load encrypted partition. Perhaps grub not decrypting install as part of boot. Do not know details, but would expect reinstall of grub with encrypted / would set correct parameters in grub. But those that know LVM/encrypted may know details. – oldfred Sep 08 '22 at 18:44
  • can you also post /etc/fstab? maybe try updating grub, and/or changing /dev/mapper/... in /etc/fstab to /dev/mapper/nvme0n1p3_crypt. and how does boot fail? do you have any error messages? maybe you can check out /var/log/syslog for more hints – Cagri Sep 09 '22 at 02:19
  • @Cagri Here is /etc/fstab: `#             /dev/mapper/vgubuntu-root /               ext4    errors=remount-ro 0       1

    /boot was on /dev/nvme0n1p2 during installation

    UUID=b3a398dd-1251-4df1-a7cd-4aa1accadbed /boot           ext4    defaults        0       2

    /boot/efi was on /dev/nvme0n1p1 during installation

    UUID=C123-ECCF  /boot/efi       vfat    umask=0077      0       1 /dev/mapper/vgubuntu-swap_1 none            swap    sw              0       0` (Sorry, I don't know how to insert line breaks here.)

    – JYF Sep 09 '22 at 07:36
  • @Cagri Just changed /etc/fstab as you suggested (/dev/mapper/nvme0n1p3_crypt), but there is no difference in boot. Also, /var/log/syslog is an empty file. – JYF Sep 09 '22 at 07:58
  • I have just post a new question suggesting a totally different method to solve the problem. – JYF Sep 09 '22 at 08:53

0 Answers0