Will installer mess with UEFI boot options, try to write MBR, or nuke existing grub menu?

Hi, I’ve got a question about the way the ubuntu budgie installer sets up grub. There used to be a --no-bootloader option on ubiquity, but that was years ago and the current installer doesn’t seem to be ubiquity. I tried searching for this but I only found unrelated grub discussions.

My laptop’s quite recent with uefi firmware, gpt nvme ssd, secure boot disabled, windows 10. Windows is my daily driver and I use either its boot manager or a custom uefi bootloader (refind, a grub alternative).

I basically don’t want the budgie installer to mess too much with my boot setup or ssd. I would expect it to add a grub .efi file and necessities to the ESP, probably add that grub to the uefi boot entries and set it to default (which I can change back to windows/refind via the firmware gui), that’s fine and I’d like that. I would also hope when ubuntu or other systems install or update, that they automatically update the grub config file in the ESP if necessary (new kernel paths and such – I remember years ago this always got broken with updates in other distros).

The thing that has me concerned right now is when installing “Something else…” and choosing a / partition, the only bootloader device option is strangely (given I’m not running in bios mode) the entire ssd nvme0n1 rather than the ESP itself at nvme0n1p1. I can’t select anything else. Flashbacks to the MBR days where grub would get written to the disk boot sector and break everything…

So my concrete questions are:

  • does “bootloader device: nvme0n1” in the installer actually mean the ESP on that ssd despite the lack of p1 in the name? Or does the installer mistakenly think I’m running bios mode and should this dropdown really be showing me the ESP itself instead?
  • does grub get installed entirely in the ESP (.efi file, config, efi fs drivers, etc) without critically relying on the ubuntu budgie partition (other than to point to it with a menu entry to boot this installation of course), i.e. would grub itself continue to work if I wiped the distro installation?
  • if there’s still any fragile config like kernel paths written to the ESP grub config these days, do those distros (ubuntu flavors) take care to keep those paths and other boot params up to date for themselves during system updates? Do ubuntu flavors add their own entries to an existing grub install so they can all coexist, or does installing another one reset the grub config?

Thanks for your input :slight_smile: I don’t really wanna rely just on internet articles because they can be completely outdated or simply not apply to this particular installer.

Hello, @Marnes
Don’t worry, you won’t break your dual-boot, especially as you should know how to fix it, since you’re using rEFInd (which I’ve never used).

To quickly answer your three questions and their sub-questions, I’d say broadly:

  • yes - no
  • no - yes
  • no - yes - yes - yes

However, to give a more detailed answer to your last two sub-questions, I’d say ‘yes’ because you’re only considering Ubuntu and its flavours: with other types of distribution, it’s more complicated, but they can be integrated into GRUB’s start menu.
Cohabitation with other OSes is always possible, but Ubuntu and derivative distributions such as Zorin have the annoying imperialist habit of imposing their GRUB menu and establishing themselves as the default OS, which means you may have to reorganise it as you wish, or restore its theme if you’ve customised it.

For peace of mind and to give you a visual idea, here is what the ‘/efi’ directory contains when GRUB is installed on nvme0n1, as indicated in the ‘Someting else’ option — this is precisely my configuration:

As for the contents of the file ‘’efi/EFI/ubuntu/grub.cfg’, here it is:

search.fs_uuid c8d21106-612c-4ef3-9ba4-0df2b7a6462e root 
set prefix=($root)'/boot/grub
configfile $prefix/grub.cfg

If necessary, you can then disable the ‘Ubuntu’ entry with ‘efibootmgr’:

efibootmgr

BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 0002,0001
Boot0001* Windows Boot Manager	HD(1,GPT,426f7e65-3e4a-41b0-be90-a7deb89f9a1e,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000034000100000010000000040000007fff0400
Boot0002* ubuntu	HD(1,GPT,426f7e65-3e4a-41b0-be90-a7deb89f9a1e,0x800,0x32000)/File(\EFI\ubuntu\shimx64.efi)

[...]

sudo efibootmgr -b 0002 -A

Software like EasyUEFI also does this very well on Windows.

1 Like

Thanks for your explanation. I’m a bit confused about some of your yes/no combinations but the rest of the info clears it up well enough. So what I gather is:

  • the installer UI is just a little misleading and it isn’t going to try shenanigans like writing an mbr on a gpt disk but will put grub in the esp
  • every distro will probably just steamroll over any existing grub config in the esp and overwrite it with their own
    • but it looks like the config is now split between an esp file that only has to look in the right filesystems for the distro-specific configs, where I guess all the fragile details like kernel paths are maintained without being vulnerable to such overwrites, so the esp file being overwritten is much less of a hassle to fix than it used to be

Hope I got it right, thanks for your effort to visualize :slightly_smiling_face:

Easyuefi is a good tool indeed and I used it years ago too, but since then it’s become a 30 day trial so it isn’t actually a long term solution anymore if you don’t want to spend money. It turned out that my laptop’s firmware doesn’t autodetect new .efi files and doesn’t have a menu to add boot entries manually either, so now that I’ve added grub to the list once I’ll have to keep using linux tools to update the menu in the future.

Hi @Marnes!

I have answered all of your questions in the way that seemed to me to be most rational and least time consuming :confused:

To answer your summary, yes, that’s what is happening, even if you are making things a bit more complicated: Ubuntu distributions (derived from Debian) put their kernels in the ‘/boot’ directory of their partition.
So, as I showed you, the ‘grub.cfg’ file in the ‘EFI’ directory points to the ‘grub.cfg’ file in the distribution’s ‘/boot’ directory, which contains the paths to the different versions of the kernel.

Anyway, if your question was whether you could install UB, no problem.
And since you’re using rEFInd, even less of a problem: you know how to fix all this, GRUB or not.

As for EasyUEFI, you don’t have to pay: a single trial is enough to unlock a dual-boot that still gives Windows priority when you have a Linux distribution installed.
In my experience, ‘efibootmgr’ is much less effective.