2

I’ve got a question about the boot order. See I’m trying to set up a simple dualboot with ubuntu 16.04(server) on one ssd and 18.04(server) on the other.

In the grub the order is

16.04
16.04advanced mode
18.04
18.04advanced mode

When I log in to the 16.04 and edit grub,the GRUB_DEFAULT=0 means it will launch 16.04 on the next boot,but if I change it to GRUB_DEFAULT=2 it launches 18.04

Once in 18.04,if I change the line to GRUB_DEFAULT=0, it boots only 18.04(unless I manually pick 16.04),and no matter what order number I specify it still launches 18.04

Got any ideas what could help ?

5
  • 1
    Currently you use the boot-loader of your 16.04. Changes in /etc/default/grub in your 18.04 will have no effect on the boot-loader of 16.04, this boot-loader reads it's configuration from your 16.04.
    – mook765
    May 15, 2019 at 6:53
  • Where and how should I edit the 16.04 grub once I'm already logged in the 18.04 ? I'm trying to set it up so that I could change between the two through ssh
    – Brutus
    May 15, 2019 at 7:14
  • 1
    Are your OS's installed in legacy mode or in EFI mode?
    – mook765
    May 15, 2019 at 7:24
  • As far as I understand,UEFI
    – Brutus
    May 15, 2019 at 7:31
  • 1
    If it is UEFI boot, grub is in /EFI/ubuntu/grub.cfg with a 3 line configfile to load the full grub.cfg in your install. You can manually edit it to be your 18.04 install or do a full reinstall of grub from your 18.04 install which will also update that file and totally replace all other parts of grub. Save any configuration changes first if desired. Example grub.cfg in /EFI/ubuntu askubuntu.com/questions/957914/…
    – oldfred
    May 15, 2019 at 14:21

1 Answer 1

1

Set GRUB_DEFAULT=0 in both systems (don't forget sudo update-grub).

Then install additional instances of grub to your ESP, from 16.04 run

sudo grub-install --bootloader-id=Server16.04

and from 18.04 run

sudo grub-install --bootloader-id=Server18.04

Check your boot-menu-entries with efibootmgr -v. Example:

$ efibootmgr -v
BootCurrent: 0001
Timeout: 0 seconds
BootOrder: 0000,0001,0002,0005,0003
Boot0000* ubuntu    HD(1,GPT,249ac0f6-d3e4-4b91-91d5-6e8d63c093c3,0x800,0x9a000)/File(\EFI\ubuntu\grubx64.efi)
Boot0001* US1804    HD(1,GPT,249ac0f6-d3e4-4b91-91d5-6e8d63c093c3,0x800,0x9a000)/File(\EFI\US1804\grubx64.efi)
Boot0002* US1604    HD(1,GPT,249ac0f6-d3e4-4b91-91d5-6e8d63c093c3,0x800,0x9a000)/File(\EFI\US1604\grubx64.efi)
Boot0003* UEFI OS   HD(1,GPT,249ac0f6-d3e4-4b91-91d5-6e8d63c093c3,0x800,0x9a000)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0005* US1810    HD(1,GPT,249ac0f6-d3e4-4b91-91d5-6e8d63c093c3,0x800,0x9a000)/File(\EFI\US1810\shimx64.efi)

Now make use of EFI's next-boot feature with

efibootmgr -n XXXX

where XXXX is the hex-number of the desired boot entry. Example:

efibootmgr -n 5

will boot to 18.10 on next boot, so the only thing left is to reboot.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .