i'm not the first one with this kind of problem, but my specific nuance, i did not yet encounter: i have a 2014 macbook pro with os x plus a windows 10 bootcamp partition. now i wanted to have a look at ubuntu and managed to install that on an sd-card. all that worked, but the situation i have now is:

  • if i start without the sd-card inserted and option pressed, i can choose between os x and windows. loading os x works, loading windows does not and results in a grub prompt.
  • if i start with the ubuntu sd-card inserted and option pressed, i get all three options. again, os x works and windows fails, but this time with a grub error message. choosing ubuntu successfully starts grub and gives me the option of booting either ubuntu or windows: which both work.

from my understanding (which might be wrong), part of grub ended up on the windows (or efi??) partition, the rest with the actual configuration on the external ubuntu sd-card. is there any way to move this second part to the windows partition? so i can still start windows without this external sd card? in an ideal world, i would just get rid of grub and use the apple bootloader for all of this, but i assume this is not a possibility, is it?

  • You might want to investigate rEFInd, the boot manager. It's fairly hands-off & automatic once installed.
    – Scottmeup
    Dec 18 '20 at 2:43

You can setup a grubless boot of Ubuntu which can be executed by the Mac boot loader, however the Mac Startup Manager will not detect such an arrangement. You would have to use a different boot manager such as rEFInd.

Another solution would be to install grub entirely on the SD card, leaving the EFI partition on the internal drive use by Windows. Or, create a second EFI partition on the internal drive, so the grub and Windows boot files will not overlap.

Moving Grub Boot Files to the SD Card

When installing Ubuntu on the SD card, an EFI partition should be created on this card. The Grub boot files should be installed in the EFI partition. The However, the Ubuntu installation software will install the Grub boot files on internal drive EFI partition instead. Below are instructions for moving these files to the EFI partition on the SD card.

Note: The steps below assume the device name for the SD card is /dev/sdb. If your device name is different, then make the appropriate substitutions when entering the commands.

  1. Boot to Ubuntu.

  2. Turn off automatic updates. Open "Software & Updates" and set "Automatically check for Updates:" to Never. See the image below.

  3. Open a Terminal window.

  4. Verify the first partition on the SD Card is FAT formatted. Enter following command.

    sudo blkid /dev/sdb1

    If the TYPE is not equal to vfat, then the first partition on the SD card is not an EFI Partition. If TYPE is equal to vfat, then record the UUID value and proceed with these instructions.

  5. Move the Grub boot files to the SD Card. Enter the following commands.

    cd ~
    mkdir efi
    sudo mount -t vfat /dev/sdb1 efi
    sudo mv /boot/efi/EFI/Boot efi/EFI/boot
    sudo mv /boot/efi/EFI/ubuntu efi/EFI/ubuntu
    sudo umount /dev/sdb1
    rmdir efi
  6. Update the /etc/fstab file so Ubuntu will know the new location of the Grub boot files. Enter the following command.

    sudo nano /etc/fstab

    Find the line with the mount point /boot/efi. Replace the UUID value on this line with with the value recorded in step 4. Exit the editor and save the change.

  7. The installation of Ubuntu replaced the bootx64 file that was first created by the Boot Camp installation. The following commands rectify this replacement. (The bootx64.efi and bootmgfw.efi files used by Windows are the same.)

    sudo mkdir /boot/efi/EFI/Boot
    sudo cp /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/Boot/bootx64.efi
  8. Restart the Mac and boot back to Ubuntu.

  9. If necessary, restore automatic updates to the previous setting.

  • wow, so many options! actually moving grub entirely to the sd-card would be perfect. how would i do this? can i just 'move' grub? (otherwise: i would not mind much to reinstall ubuntu, but i'd rather keep my macos and win installs). Dec 10 '20 at 0:45
  • sorry, one more question: i tried moving grub by reinstalling grub onto the sd-card (askubuntu.com/a/364924/1094615), but that did not change anything. so i figured, i should probably remove grub from my internal efi partition, mounted efi and removed the EFI/ubuntu folder. from what i read, that should have removed grub. miraculously everything still works, but also if i select windows in the normal alt-menu, it just shows something grub-like and then restarts. once the sd card is in however, windows (and ubuntu) still boot fine when started from the grub on the sd-card. Dec 14 '20 at 16:56
  • to me it seems, there is still some grub-stuff on my internal efi partition which prevents windows from booting. the only thing i could imagine is three files in EFI/boot: bootx64.efi, fbx64.efi and mmx65.efi. could that be? and can i remove any of these or would that be a bad idea? (or am i looking in the wrong place?) Dec 14 '20 at 17:00
  • I finally got around to posting the procedure you requested. Sorry, it took so long. Dec 17 '20 at 23:56
  • this super awesome, thank you very much for this detailed answer! i'm currently away from my machine and will need some time before i can do this but i will!!! Dec 19 '20 at 13:03

You must log in to answer this question.

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