0

I have installed LUbuntu using LVM on a machine can only boot using EFI. It already had /dev/sda1 as EFI partition. LUbuntu installer used the rest HDD to create LVM Physical Volume with one single root Logical Volume and no other LVs and for some reasons did not install any bootmanger on EFI partition. Not sure what went wrong.

Thus I ended up with unbootable system.

To rectify the problem I booted the USB stick with LUbuntu Checked if it really boots in EFI mode:

$ ls -al /sys/firmware | grep efi
drwxr-xr-x  5 root root 0 mar 12 12:19 efi

as suggested in the answers here:

https://askubuntu.com/questions/1111045/how-to-check-if-ubuntu-has-booted-in-uefi-mode

and used this procedure:

https://linuxsuperuser.com/reinstall-grub2-efi-bootloader-ubuntu/

i.e. and run the following commands:

sudo mount /dev/sda2 /mnt
sudo mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sda
update-grub

The problem is that afterwards LUbuntu does not boot in UEFI mode. It can boot in BIOS mode and standard Grub menu appears, however other OS requires UEFI boot as well as certain customisation options do not work.

When I actually check /mnt/boot/efi nothing new there. No changes. Aparrently grub-install does not copy necessary files to EFI partition.

Where's the problem?

I understand the commands up until grub-install, however I am not familiar with grub2 enough to really understand what are the related config files and how exactly grub takes all the components to boot in EFI + LVM mode.

Could you please also let me know how I can add to grub menu another OS sitting idle on another primary partition.

It used to boot via EFI and its boot cfg still is saved on EFI partition.

1 Answer 1

0

Ok, I spent quite a time researching the topic and here it is what I learnt:

grub-install takes configuration file /etc/default/grub and scripts located in /etc/grub.d and assembles real grub2 configuration file located in /boot/grub/grub.cfg.

It also assembles loader binaries that get copied to /boot/efi/EFI/ubuntu.

The grub.cfg file stored there just points to the /boot/grub/grub.cfg created earlier.

In the end grub-install saves Grub2 bootsector in the specified location.

Not sure however what is stored in /boot/efi/grub.

Apparently LUbuntu / Ubuntu scripts do strange things with the configuration file as I many options did not work as described in Grub manual:

https://www.gnu.org/software/grub/manual/grub/grub.html

/boot/grub/grub.cfg contains a lot of conditional processing and some parameter values make other parameters not processed staying in grub2 defaults, which results in unexpected behaviour.

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.