Score:0

Multi Boot Problems (Ubuntu + Kubuntu + Windows) with LVM and LUKS

cn flag

General problem

I have (seemingly) successfully set up my system with LVM on one hard drive containing Ubuntu and Kubuntu, all encrypted with LUKS (based on the guide from https://help.ubuntu.com/community/Full_Disk_Encryption_Howto_2019), and another hard drive containing a Windows 10 installation. But it doesn't work as it should.

System Overview:

- sda
  | - sda1 Windows Recovery
  | - sda2 EFI System
  | - sda3 Windows
- sdb
  |- sdb1 /boot (encrypted LUKS1)
  |- sdb2 BIOS
  |- sdb3 EFI-SP
  |- sdb5 LVM (encrypted LUKS2)
     |- vg_linux_ubuntu_root
     |- vg_linux_ubuntu_swap
     |- vg_linux_kubuntu_root
     |- vg_linux_kubuntu_swap
     |- vg_linux_linux_shared

PC-Specs: Intel i9-9900k, 64GB RAM, Nvidia GTX 1080Ti, Mainboard Asus Maximus Hero XI

Installation Background

  1. For a long time I had Windows 10 and Ubuntu running in parallel without any problem. After some upgrades of Ubuntu, some things got messed up and I also wanted to get rid of some stuff I did when I was new to Ubuntu. Furthermore, I wanted to encrypt my data.
  2. So I reinstalled Ubuntu based on this guide by Ubuntu to achieve full disk encryption. This worked fine.
  3. I noticed that I couldn't boot into Windows via grub, but decided to fix that later.
  4. So I installed Kubuntu alongside the Ubuntu installation including all the necessary steps so it runs on the encrypted LVM. This works as well. (Notice: Based on several forums and documentations, multiple distros can use the same /boot partition, so that is what I did (without formatting it first of course)).
  5. I now see Ubuntu, Kubuntu, and Windows in the grub menu. Booting into the newly installed Kubuntu works perfectly.

Problem 1 (P1_ubu)

Booting into Ubuntu doesn't work anymore. When selecting Ubuntu in the grub start menu, Kubuntu starts.

Steps I took:

  1. After checking out the configuration I noticed, that the boot root location was set to Kubuntu. I changed it to the Ubuntu volume. It now seems to select the right volume but has some other problems.
  2. Next I thought resetting grub might help. So I used the boot-repair-live tool to do that. There I decrypted the LVM and selected Ubuntu as my main system. Everything went through and the grub menu got recreated. Booting into Kubuntu still works, booting into Ubuntu results in landing in the emergency mode console. Via this, I end up in a root shell of my Ubuntu system, so it shouldn't be a problem regarding the encryption. Running depmod and fsck on the volumes didn't change anything. Exiting this shell results in a Failed to start default target: Transaction for graphical.target/start is destructive and gets stuck (as other threads suggested, running fsck on the volumes doesn't change anything). (One thing to notice is that when trying to boot into Ubuntu the Kubuntu splash screen shows up)
  3. Selecting an older kernel version to start ubuntu from. This then results in an initramfs terminal with no keyboard support (so I can't type in anything).

Edit (2021-09-15): I noticed that in the /boot folder under EFI only one folder is there. Namely ubuntu. It seems as, as Kubuntu is a version of Ubuntu, overwrote the files of the ubuntu install as internally they have the same name. Now the question is if I can somehow recreate those original files (I have no backup of those) and rename the ubuntu folder (used by Kubuntu) to kubuntu.

Edit (2021-09-17): I finally managed to get both distributions running side by side. It turned out that Kubunut already installed newer kernel versions than Ubuntu had. I was able to install the latest updates on Ubuntu which then solved the boot issue. As the last step, I just had to change the grub config in order to correctly boot Kubuntu and Ubuntu via the grub menu. I'm not sure if this breaks again when I update the kernel in one distribution, but I also don't really know if there is a viable other solution. I was looking into having one (encrypted) boot partition by Ubuntu and installing all other distributions with their own /boot folder directly inside the LVM volume. This way I'd expect the Ubuntu Grub to chainload all the other distros, but I'm not sure if this is going to work. Information regarding that use case is a bit scarce.

Problem 2 (P2_win) - Priority 2

I can boot into Windows when booting directly from the drive that contains Windows (via BIOS startup menu). But booting via grub results in an error message and a return to the grub boot menu.

Has anyone dealt with something similar before or has someone an idea how to fix that?

oldfred avatar
cn flag
You do not show sda's details, but is it UEFI/gpt or BIOS/MBR? With your processor it should be UEFI. Microsoft has required vendors to install in UEFI boot mode since 2012, BIOS mode was still available for old hardware. I do not know LVM nor encryption, but you cannot share a /boot partition with two installs. They will get out of sync and give errors you are getting. And UEFI will only have one entry for UEFI & then ubuntu. That default entry should offer to boot all other Ubuntu installs. Since I do not use LVM, I also do not use /boot partition for my installs.
Raphael Jenni avatar
cn flag
@oldfred I updated the system overview and added a new edit regarding my setup. Do you think chainloading would work if I use the Ubuntu grup/ boot partition to do so?
oldfred avatar
cn flag
Ubuntu's Ubiquity installer installs grub to first drive's ESP, probably your sda. If you disconnect sda, then it installs to sdb's ESP. Since two drive's you could have grub in both, one booting Ubuntu & other booting Kubuntu. You can edit fstab with ESP's UUID, edit grub with distributor and edit /EFI/ubuntu/grub.cfg with correct UUID/partition. https://askubuntu.com/questions/792413/how-to-set-grub-from-second-linux-distribution-as-default-in-uefi-boot I have not seen shared /boot works? But I have not used LVM nor /boot partition.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.