0

I have a dual boot system with 2 versions (derivatives) of Ubuntu installed (Linux Mint 17.3 KDE and Kubuntu 18.04).

In order to keep the LM install in control of the GRUB boot manager updates (because it is my primary OS), I installed Kubuntu telling it not to install the boot manager (using ubiquity -b, which I found in Rod Smith's answer to How to keep grub independent of all the OSes?)

This is working fine. I have to manually run update-grub from LM after installing a new kernel in Kubuntu in order for it to be on the boot menu.

I'm at the point where I need to switch control of the grub boot manager from the 1st OS (LM) to the 2nd (Kubuntu).

So what I'd like to do is install grub on the 2nd OS (Kubuntu 18.04) so that it updates the grub boot manager on the ESP (efi system partition) and then uninstall grub from the 1st OS so that it no longer updates the grub boot manager on the ESP.

I'd like not to have to wipe my 2nd OS partition and re-install it from scratch.

Mike Lippert
  • 1,385
  • 1
    Grub, as boot manager, whose job is boot the OS, if it relies on the existence of the OS, how can it work? So, grub is not related to any OS. Then what's the update-grub command grub-install used to install the grub? They're the grub package (or whatever your OS name it), providing the management tools for the OS to manage grub. – 炸鱼薯条德里克 Sep 28 '19 at 15:02
  • In addition to what @炸鱼薯条德里克 said: you can basically use the grub tools from any modern os to manage grub. So technically, you can update it from LM and Kubuntu (as long as you have to grub package installed). update-grub mostly compiles and stores a text file which tells grub where to look for the kernel (simplified explaination). – rudib Sep 28 '19 at 18:23
  • @rudib I know that's not quite the case, and not quite what I'm trying to learn. Because the grub version installed on my 2 OS's might be different, when I installed Kubuntu, I used the -b switch to tell it not to install grub, what I think this means is that the grub configuration used on boot is always the one created by running update-grub on LM the one created by running update-grub on Kubuntu is ignored. – Mike Lippert Sep 29 '19 at 11:27
  • I can't find any documentation on a -b switch for ubiquity (according to the ubuntu manpage). But if there is a -b switch, it might tell it not to run grub-install. grub-install is usually run by the setup tool, but you didn't need that as it was already installed and set up by LM. update-grub is just a stub for grub(2)-mkconfig. Those config files should be compatible and interchangeable. In addition to that, you could check /etc/grub.d on both OSs and match Kubuntu to LM. Then the output of grub-mkconfig % – rudib Sep 29 '19 at 11:56
  • should be identical. – rudib Sep 29 '19 at 11:56
  • https://unix.stackexchange.com/questions/465189/update-grub-vs-grub-install – rudib Sep 29 '19 at 11:59
  • Yeah, I couldn't find any doc for -b either other than that in Rod Smith's answer. I have also noticed a difference in the grub packages installed on the 2 OS's, so if I want/need to run grub-install from Kubuntu, I suspect I need to install missing grub packages, i just have to figure out which ones. – Mike Lippert Sep 29 '19 at 11:59
  • There may be a switch we don't know of, but it may be possible that you actually installed grub bootloader (grub-install) again during the Kubuntu install and didn't notice it. Do you have the grub package installed on Kubuntu? – rudib Sep 29 '19 at 12:02
  • That stackexchange link was super helpful in pointing me where to look next. I had just looked at /boot/efi/EFI/ubuntu/grub.cfg which I can see loads the grub config from my LM partition. – Mike Lippert Sep 29 '19 at 12:15
  • grub-common, grub2-common, grub-pc and grub-pc-bin are the only grub packages I see installed on Kubuntu. I wonder what running grub-install would do w/o the grub efi packages, but I'm not sure I want to experiment w/ something that might break my system. – Mike Lippert Sep 29 '19 at 12:19

1 Answers1

0

The Kubuntu install with ubuquity -b installed legacy grub packages:

  • grub-pc
  • grub-pc-bin
  • grub-gfxpayload-lists

Uninstall those packages then install the grub efi packages for your system, e.g. for my 64bit x86:

  • grub-efi-amd64
  • grub-efi-amd64-bin
  • grub-efi-amd64-signed

The installation of these packages runs grub-install and updates the files in /boot/efi/EFI/ubuntu namely the grub.cfg and grubx64.efi.

I suspect that uninstalling these grub efi packages on the Linux Mint boot would work so that it could still run update-grub when updating the kernel but no updates to grub that re-run grub-install would happen. However I have not tested this.

Mike Lippert
  • 1,385