Just to share, this is what I have done:
There is no need to perform grub-install
since all the files are already there. What needs to be done subsequently is to create a new boot option at the partition sda1 using the EFI boot manager and pointing to the shim.efi
bootloader:
# efibootmgr -c -L Fedora -l \\EFI\\fedora\\shim.efi
Then check its boot position (refer to PARTUUID using blkid
if not sure):
# efibootmgr -v
BootCurrent: 0004
Timeout: 1 seconds
BootOrder: 0004,0000,0002,0001
Boot0000* Fedora HD(1,800,64000,<PARTUUID>)File(\EFI\fedora\shim.efi) <= NEW
...
and make sure that it is the first boot loader in the sequence:
# efibootmgr -o 0000,0002,0001,0004
For grub, what needs to be done is to change all instances of /boot
location to point to the new partition:
# vi /boot/efi/EFI/fedora/grub.cfg
....
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt6
--hint-efi=hd0,gpt6 --hint-baremetal=ahci0,gpt6
....
Search and replace "gpt6" with "gpt2" (if /boot is moved from sda6 to sda2)
To prevent the OS from mounting the old /boot
and /boot/efi
partitions due to duplicate UUIDs, edit fstab:
# vi /etc/fstab
Replace the duplicate references of UUIDs with PARTUUID (if you are using GPT) or device node (e.g. /dev/sda1).
Reboot and you are done.
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.