How to change default boot partition?

55,337

Solution 1

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.

Solution 2

Use grub-install to install grub to /dev/sda (pointing to the grub directory on /dev/sda1 as described by @SHW) and set the boot flag on /dev/sda1 using fdisk or parted.

You may need to remove the boot flag on /dev/sda6 (again using fdisk or parted).

Share:
55,337

Related videos on Youtube

Chris
Author by

Chris

Updated on September 18, 2022

Comments

  • Chris
    Chris almost 2 years

    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
    • SHW
      SHW almost 8 years
      You need to install grub on partition /dev/sda1. That could be done by executing command grub-install --root-directory /mnt/sda1 /dev/sda. Provided /dev/sda1 is mounted at /mnt/sda1
    • Sahil Chaudhary
      Sahil Chaudhary about 6 years
      There was an option in grub to chain boot another grub. You'd need to look it up in the Internet.
  • Chris
    Chris almost 8 years
    My goal is not only to boot Antergos by default, I also want to be able to edit my grub config without having to boot to Ubuntu just to do that. By the way running "sudo grub-mkconfig -o /boot/grub/grub.cfg" on Antergos detects Ubuntu.
  • Michael Daffin
    Michael Daffin almost 8 years
    Then you can boot antergos, configure and reinstall grub to the MBR and all should be how you want it.