0

[Before the problem]

Recently, I've installed Kubuntu 20.04 on my work computer with a dual boot with windows. The computer has an SSD, and a HDD. The SSD contains a EFI partition at the beginning, then the windows system partition, then my linux root partition. The HDD contain a windows "data" partition, and my linux /home.

The installation was complex, as the computer boots with UEFI. Whatever I tried, I couldn't access the grub menu; but I found out that when I activated UEFI, I booted on windows; and when I deactivated UEFI and activated legacy mode for the boot, I booted on linux (but without any passage to the grub menu).

[The problem]

This morning, without any changes done to Kubuntu or the boot the previous day, I booted on a dark screen without any mouse pointer. Distressed, I tried to use boot-repair with my live Kubuntu USB key. It didn't work, and it's even worst : now, when booting with UEFI, I land on a grub console ("Minimal BASH-like line editing is supported..."); and booting on legacy, I end up on a boot error (file /boot/grub/i386-pc/normal.mod not found).

Using boot-repair in every possible way didn't work; neither reinstalling the kernel, or playing with any of the advanced options in boot-repair. Nothing changes.

I was able to use the instruction in the top post of the following link to get past the grub console; but I then land on a Busy Box console where I can't get anywhere.

Now, I'm at the end of my wits, and I would really appreciate any advice to improve the situation, and at least access either windows or Kubuntu.

  • 1
    As you found trying to mix UEFI Windows with BIOS Ubuntu is difficult. Both should be in UEFI boot mode. When Ubuntu live installer is booted in UEFI mode, you should be able to use Boot-Repair and in advanced mode choose a total re-install of grub. That should then install the UEFI version of grub and Ubuntu will boot in UEFI mode from UEFI boot menu. Windows should also boot from UEFI boot menu. If Windows fast start up is off then grub should also boot Windows, but Windows update may turn fast start up back on. If not post link to summary report from Boot-Repair. – oldfred Jul 6 at 21:40
  • I just tried it; now, Boot-repair wouldn't even complete. It tells me "linux-generic purge cancelled" and "grub-efi-amd64-signed purge cancelled", pushing me to contact boot.repair@gmail.com. The pastbin of the boot info is here : paste.ubuntu.com/p/YZn3kcPgPJ – Klemet Jul 6 at 22:14
  • Was network working?Better to use wired connection or did Wifi work before? It often cancels updates if you cannot download the newer versions as then you would not be able to do anything. What brand/model system? – oldfred Jul 6 at 22:27
  • Network is working, as I have to install Boot-repair everytime I start the live session (it's a Kubuntu installation USB). I use Wifi. It's a Lenovo ThinkCentre, and it's a tower (not a laptop). It's pretty strange as Boot-repair was not showing this error for a long time, and worked fine (even if it didn't fix my issue). – Klemet Jul 6 at 22:32
  • Script did not show /boot/grub/grub.cfg, do you have that file? If Boot-Repair does not work does a full chroot? askubuntu.com/questions/53578/… Have you updated UEFI from Lenovo? – oldfred Jul 7 at 3:28
0

I finally managed to fix it. It was a long ride.

I think (while I'm not sure) that it was due to several issues :

  • Grub that installed both as UEFI and Legacy boot
  • Corrupted Grub that would not entirely uninstall, and would generate bad configuration files at each update
  • Corrupted EFI partition resulting from attemps to fix it
  • Corrupted kernel headers in my /boot folder

Here is what I did to fix everything :

Before everything : Make sure that the computer boots in UEFI mode (bios settings) !

  1. Got into a live Kubuntu Session with a Live Kubuntu Install USB Key
  2. Deleted the existing EFI partition via Gparted on the Live Kubuntu Install USB
  3. Created a windows recovery drive on a Windows 10 install I had on another computer
  4. Restarded the computer and booted on the recovery drive and got into the command prompt
  5. Followed the instructions on this link to create a new EFI partition, and to restore it thanks to the windows files on C: . Access to windows was restored after that.
  6. Came back into the live Kubuntu session
  7. Used the following commands in a console of the live environment to mount and access the partition where my Kubuntu install was
sudo mount /dev/nvme0n1p4 /mnt # nvme0n1p4 is the partition with my linux install
sudo mount /dev/nvme0n1p5 /mnt/boot/efi # nvme0n1p5 is the newly created EFI partition
sudo mount --bind /dev /mnt/dev
sudo mount --bind /sys /mnt/sys
sudo mount --bind /proc /mnt/proc
sudo mount --bind /run /mnt/run
sudo chroot /mnt
  1. Renaming a script that prevented a good purge of grub with
sudo mv /etc/kernel/postrm.d/zz-update-grub /etc/kernel/postrm.d/zz-update-grub.bad
  1. Purging and reinstalling grub once and for all with
sudo apt-get purge grub grub-pc grub-common grub-efi
sudo mv /boot/grub /boot/grub_backup
sudo mkdir /boot/grub
sudo apt-get install grub grub-pc grub-common grub-efi
sudo grub-install /dev/nvme0n1p5 #nvme0n1p5 is the newly created EFI
sudo update-grub 
  1. Determine the packages that have files installed in the /boot folder with the command
dpkg -S /boot
  1. Reinstall all of the packages with
sudo apt-get install --reinstall <packages names separated with spaces>
  1. run update-grub

  2. Done ! Everything should work. If not, purge and reinstall grub one last time with boot-repair.

Thanks to @oldfred for their patience and wise advice !

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.