1

Summary

I successfully created a triple-boot on my 2015 MBP with macOS (Big Sur), Ubuntu 22.0.1, and Windows 10. I can boot into any of the 3 successfully, however, the Startup Manager does not show all the boot options. I have to use the Grub menu to boot into Windows, which is not what I want. What must I do to update the Startup Manager so that it presents me with boot options for Windows, Ubuntu and macOS installations?

Installation History

The drive has two macOS installations on different partitions - Yosemite and Big Sur - which I can choose with the startup manager. This is a fairly common practice. I installed Windows 10 using Boot Camp from Big Sur, which seems to create a Windows bootloader partition at /dev/sda1. At this point, the startup manager (holding the option key at startup) correctly showed the macOS and Windows options.

I then created a separate partition at /dev/sda3 for Ubuntu's Grub bootloader in addition to a partition /dev/sda7 for Ubuntu's main file system, and I installed Ubuntu using these partitions. I specifically chose /dev/sda3 for the EFI bootloader so that it wouldn't overwrite the Windows bootloader in /dev/sda1. Everything installed fine, however, I lost the ability to boot directly into Windows from the startup manager.

After the Ubuntu installation was complete I was expecting the startup manager to show Windows and Ubuntu options in addition to macOS, but only the Windows and macOS icons appear. But when I select the Windows icon in the startup manager, it boots into Ubuntu's grub bootloader. The Grub menu has options for booting into Ubuntu or Windows (which the grub menu shows is /dev/sda1). So I can boot into Windows or Ubuntu successfully using the Grub menu.

However I want the startup manager to display separate icons for Windows and Ubuntu at startup and allow me to select them from there. I have tried a few things to fix this unsuccessfully and am a bit baffled how to accomplish this.

Some things I tried

There are 2 EFI partitions on the disk, one created by Boot Camp at /dev/sda1 for the Windows bootloader, and one I created at /dev/sda3 for Ubuntu's Grub bootloader. When I mounted the /dev/sda3 partition, I noticed the EFI directory was empty. Following instructions from some past posts here, I copied the contents of the EFI directory in /dev/sda1 partition to the EFI directory in the /dev/sda3 partition, which allowed me to "bless" the partition in macOS as a bootable volume in the startup manager. After this, the startup manager did show an additional icon at startup, but as expected both icons look identical (Windows icon) and selecting either of them puts me into Grub.

I was hoping to adjust the contents of the two EFI partitions so that they each point to the respective bootloader, one for Windows and one for Grub/Ubuntu. This is where I am having difficulty. I know the boot configuration for Windows is displayed along with others when I run "efibootmgr -v" in Linux, but I don't know how to apply this information to accomplish what I am asking.

Disk partitions and information

Result of fdisk -l /dev/sda:

$ sudo fdisk -l /dev/sda
Disk /dev/sda: 465.92 GiB, 500277790720 bytes, 977105060 sectors
Disk model: APPLE SSD SM0512
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: A79A70A1-D180-47E6-BBAC-80365256A8F0

Device         Start       End   Sectors   Size Type
/dev/sda1         40    409639    409600   200M EFI System
/dev/sda2     409640 616597135 616187496 293.8G Apple APFS
/dev/sda3  616597504 617129983    532480   260M EFI System
/dev/sda4  617129984 702054399  84924416  40.5G Microsoft basic data
/dev/sda5  702055552 780652767  78597216  37.5G Apple HFS/HFS+
/dev/sda6  780652768 781922303   1269536 619.9M Apple boot
/dev/sda7  781955072 977104895 195149824  93.1G Linux filesystem

Result of gdisk -l /dev/sda:

$ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 977105060 sectors, 465.9 GiB
Model: APPLE SSD SM0512
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): A79A70A1-D180-47E6-BBAC-80365256A8F0
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 977105026
Partitions will be aligned on 8-sector boundaries
Total free space is 34425 sectors (16.8 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640       616597135   293.8 GiB   AF0A  
   3       616597504       617129983   260.0 MiB   EF00  EFI for GRUB
   4       617129984       702054399   40.5 GiB    0700  Basic data partition
   5       702055552       780652767   37.5 GiB    AF00  Yosemite
   6       780652768       781922303   619.9 MiB   AB00  Recovery HD
   7       781955072       977104895   93.1 GiB    8300  

Result of efibootmgr -v:

$ sudo efibootmgr -v
BootCurrent: 0000
Timeout: 5 seconds
BootOrder: 0000,0002,0001,0080
Boot0000* ubuntu    HD(1,GPT,a61ea436-09b2-4355-a10e-e89f519653d6,0x28,0x64000)/File(\EFI\ubuntu\shimx64.efi)
Boot0001* Windows Boot Manager  HD(1,GPT,a61ea436-09b2-4355-a10e-e89f519653d6,0x28,0x64000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0002* ubuntu    HD(3,GPT,e2387071-5951-4a9f-8d7d-2b113d3ce3b7,0x24c08800,0x82000)/File(\EFI\ubuntu\shimx64.efi)
Boot0080* Mac OS X  PciRoot(0x0)/Pci(0x1c,0x5)/Pci(0x0,0x0)/Sata(0,0,0)/HD(2,GPT,11eb72ed-4a8f-4f7d-a8f7-4fca3438adf6,0x64028,0x24c1e788)/VenMedia(be74fcf7-0b7c-49f3-9147-01f4042e6842,cbcfd61e0b162b4aafa0d79e9050dcbb)/File(\A62C572A-E899-4CAC-A2C9-F54103EAD91E\System\Library\CoreServices\boot.efi)
Boot0081* Mac OS X  HD(1,MBR,0x901c8f2d,0x800,0xe51f800)
Boot0082*   PciRoot(0x0)/Pci(0x1c,0x5)/Pci(0x0,0x0)/Sata(0,0,0)/HD(2,GPT,11eb72ed-4a8f-4f7d-a8f7-4fca3438adf6,0x64028,0x29d24458)/VenMedia(be74fcf7-0b7c-49f3-9147-01f4042e6842,cbcfd61e0b162b4aafa0d79e9050dcbb)/File(\C04D8B5C-49A1-4AD5-9182-459286FF5241\System\Library\CoreServices\boot.efi)
2
  • You seem to have a lot of questions. Which is amazing considering your post does not contain even one question mark (?) character. I believe every question has been addressed before either here at Ask Different or over at Ask Ubuntu. What is the purpose of he 37.5G Apple HFS/HFS+ and 619.9M Apple boot partitions? Feb 6 at 12:10
  • The 37.5G partition is a second macOS installation, and the 619.9M Apple Boot partition is something that Boot Camp created, but I don't feel these are relevant to my issue. I only had one question and I thought it was clear, but I will edit my post to further clarify it.The question is, "What must I do to update the hardware Startup Manager so that it presents me with boot options for Windows, Ubuntu and macOS installations?" Feb 6 at 17:34

1 Answer 1

1

Well, after sifting through many posts on the subject and trying different things, I found an answer to my own question. Posting it here in case others are having the same issue. The two posts I found to be the most helpful are here and here.

The short answer is that after installing Windows, you have to back up the Windows bootloader before installing Ubuntu, because there is a bug in the Ubuntu installer that doesn't honor your EFI partition selection, and it overwrites the Windows bootloader. If you don't back up the Windows bootloader first, fixing it is difficult to impossible. If this happens and you try to re-install Windows, the presence or a second EFI bootloader partition causes Windows installation to fail, and leaves additional new problems with your partitions.

The easiest way to accomplish installing Ubuntu and preserving an existing dual-boot into Mac or Windows, is to add some steps after installing Windows and before installing Ubuntu, as follows.

Make sure you have a separate 100 to 200MB partition for the Ubuntu bootloader in addition to the partition for the filesystem.

Boot into the "Try Ubuntu First" option from the Ubuntu install disk before doing the install. Open a terminal with command-option-T, mount the Windows bootloader partition /dev/sda1, and rename the EFI directory to some other name like EFI.win.

Then install Ubuntu, specifying your new EFI partition (in my case /dev/sda3). What should happen is the EFI bootloader gets installed into the partition you select. But, due to a bug in the installer, what actually happens is that it formats the new EFI partition, but installs the bootloader into /dev/sda1. You end up with a correctly formatted but empty new EFI partition. The first EFI partition on the drive, /dev/sda1, contains directories EFI and EFI.win. This needs to be fixed.

After the Ubuntu install is complete, restart the computer with the option key down, and boot into "EFI" which is the new Ubuntu installation. Open a terminal. Mount the two bootloader partitions. Copy the EFI directory in the Windows bootloader partition (which is actually the Ubuntu bootloader) to the 2nd EFI partition. Then delete the EFI directory there and rename your backed-up Windows bootloader, by renaming EFI.win back to EFI.

Next, check the UUIDs of the two EFI partitions with the command 'blkid /dev/sda1 /dev/sda3'. (your partition numbers many be different, use the partition numbers on your drive.) Edit the /etc/fstab file. Locate the UUID in this file for the Windows bootloader partition, /dev/sda1, and replace it with the UUID of the correct Ubuntu EFI partition (UUID of /dev/sda3 in my case).

Lastly, the Ubuntu install leaves the disks's master boot record in a state that can't be read by the Windows bootloader. Rebuild the master boot record for the drive by using gdisk, as follows. Open a terminal and type 'sudo gdisk /dev/sda'. This puts you into an interactive shell for gdisk. Type the following keys in the following order, which will rebuild the master boot record correctly: x n w y. This fixes the master boot record and saves it to a format that Windows bootloader can use again.

At this point you can restart the computer, hold down the option key, and you should see separate icons labeled "EFI" (Ubuntu) and "Windows", along with all your bootable macOS and recovery partitions. There are ways to rename these labels or make other cosmetic changes, these are described in the included links.

I know this explanation is compressed and could have been written in a more expanded way. I wanted to at least capture the important points for experienced people. I hope this information is useful. If you need more detailed instructions, the linked pages provide expanded instructions.

You must log in to answer this question.

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