Ubuntu – How to change default boot partition

arch linuxbootdual-bootgrubUbuntu

I installed Antergos on my laptop, then installed Ubuntu after that. Ubuntu detected that I had another Linux installed, so it added Antergos to its grub menu. Every time I boot up, grub is loaded from the Ubuntu partition. How can I make the other grub file the default one?

My partitions are:

  • Antergos boot partition (want to load grub.cfg from here) – /dev/sda1
  • Antergos root partition – /dev/sda2
  • Ubuntu partition (grub loads from here) – /dev/sda6

Best Answer

In legacy bios systems, the bios looks up the Master Boot Record (MBR) of the disk it is set to boot. This is the first 512 bytes of the disk and contains the first stage of the bootloader process, this will be grub in your case. The sole job of this stage is to locate and load the second stage normally on the drive that contains /boot. The MBR has these paths hardcoded into it and in order to change them you must reinstall the MBR from the system (or chroot of the system) you want it to point to using grub-install. If you can boot the system then this is trivial, but if you cannot then you must use a livecd and chroot into your system; see the instructions here on how to do that.

However, in your case the antergos grub config will not have the ubuntu distro in it so you will lose the ability to boot that until you add it. You can also configure the ubuntu grub config to boot antergos by default if this is your intended goal. Either approach is acceptable and depends on what you want to achieve.

Related Question