5

Ubuntu is not booting but printing weird things, either

  • /run/lvm/lvmetad.socket: connect failed: No such file or directory
  • or /sbin/cryptsetup not found

then falls back to busybox after a few minutes (sometimes..).

The error appeared after moving onto a new hard disk where I had to delete an encrypted partition. After chrooting into the root partition and running udpate-initramfs -u the error mentioned in this Ask Ubuntu question popped up:

cryptsetup: WARNING: could not determine root device from /etc/fstab

I followed the setup proposed in this article: Full disk encryption with Ubuntu. Now I have a / btrfs volume inside LUKS with an unencrypted /boot partition. All this running on EFI with secure boot disabled.

Zanna
  • 72,312
matt3o
  • 971

2 Answers2

12

Had a very similar issue after an update of Ubuntu 20.04 on a Dell XPS13 (2020). Searched for hours, the solution was actually easy.

reboot and go to BIOS using "fn and F2"
BIOS > System Configuration > Sata Operation > switch to "AHCI" from "RAID On"

For some reason, this BIOS setting was switched.

KoenBal
  • 344
  • 3
  • 3
5

All the default hacks and fixes are putting you on a good track, however none of them was complete. This was the solution in my case:

  1. Make sure the /etc/crypttab file is set up correctly. All entries have to refer to existing partitions. There should be at least one entry named "root", this is the root / entry. This was crucial for me - and nobody mentioned it so far!
  2. This entry should be referred to in the /etc/fstab with /dev/mapper/root. Check that the UUIDs are correctly set up
  3. Now run update-initramfs -u which udpates only your most recent kernel. If a cryptsetup warning pops up, you failed on the previous steps. Review all files and try figure out the problem
  4. Run update-grub to fix any remaining grub issues
  5. Now check the /boot/grub/grub.cfg. Go search for the first menuentry which is the one that will be booted. The search part should contain the UUID of the boot partition (unencrypted!). The linux part should have something saying that root=/dev/mapper/root or pointing to the UUID of the unencrypted volume (in my setup the btrfs volume)
  6. Try to boot. If the lvm errors still pop up, silence them as mentioned in this answer

One last advice: Care for any little warning popping up. Usually they are meaningless, in this case they are very important.

Good luck!

matt3o
  • 971