Update-Grub Not Updating /boot/efi/EFI/ubuntu/grub.cfg – How to Fix

18.04bootgrub2uefi

(EDIT 3: User error. Copied over /boot/efi/EFI/ubuntu/grub.cfg while debugging a boot problem)

After installing recently released Ubuntu 18.04 Server in UEFI Secure Boot mode the installer has put grub.cfg in this location:

  • /boot/efi/EFI/ubuntu/grub.cfg

This matches the tables created when selecting Filesystem: manual partition, which mounts the boot partion at /boot/efi (/dev/sda1).

However, sudo update-grub and sudo update-grub2 does not overwrite the grub configuration, instead updating /boot/grub/grub.cfg, i.e. a file not on the boot partition.

Question 1: Has update-grub, update-grub2 etc been superseded by some new procedure?
Question 2: If not, is this a bug to be filed?

EDIT:
Confused++.

  • Computer 1, actual hardware, manual portioning in installation and minor updates, e.g. sudo apt install tboot, problem can be reproduced.

  • Computer 2, vmware image: vanilla install, problem cannot be reproduced.

Both computers are UEFI Secure Boot and have same/similar partioning. the different grub.cfg experience the same update behaviour, but on the vmware image, grub respects the file /boot/grub/grub.cfg, on hardware install grub respects the /boot/efi/EFI/ubuntu/grub.cfg.

EDIT 2:

  • Computer 1 has now been re-installed both with manual filesystem portioning and then again with the original partitioning (250GB disk, 120GB used, rest left free). Neither re-install could reproduce the original problem, so basically now the problem is gone. All three installations on the computer was from the same ISO / USB stick.

Best Answer

I ran into this as well. To update your EFI grub.cfg, you want to do:

grub-install --efi-directory=/boot/efi

If your EFI is mounted at /boot/efi.

Related Question