Linux / Hybrid MBR Setup Broke Boot Camp

So I’m in desperate need of guru advice. There used to be two operating systems on my 2017 iMac 5K: macOS Big Sur and Windows 10. After I installed Linux Mint, Windows 10 wouldn’t boot anymore. The Windows shortcut I was presented with upon pressing and holding the Alt key would get me GRUB, which would only boot Linux as it couldn’t find the Windows bootloader anymore. I mounted the EFI partition in macOS, and it turned out the bootloader was indeed gone, so I deleted the Windows partition using Boot Camp Assistant, and GRUB disappeared. The machine only booted macOS now. 


Then I re-partitioned the disk in Boot Camp Assistant, and began installing Windows 10 from scratch. However, upon rebooting, the computer booted back into… Linux and not into the Windows instal shell. Selecting Windows from the boot menu would still get me GRUB, and removing the Ubuntu folder from the EFI resulted in the Windows shortcut booting straight to macOS.


I think my issue may be related to this one here: https://discussions.apple.com/thread/6511286 , yet I can't quite make heads or tails of it. Could anyone please explain what I should do in order to have all three systems up and running on the same drive? Here's the diskutil read-out:


/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI ⁨EFI⁩                     314.6 MB   disk0s1
   2:                 Apple_APFS ⁨Container disk2⁩         142.0 GB   disk0s2
   3:       Microsoft Basic Data ⁨OSXRESERVED⁩             10.0 GB    disk0s3
   4:       Microsoft Basic Data ⁨BOOTCAMP⁩                65.1 GB    disk0s4
   5:           Linux Filesystem ⁨⁩                        33.6 GB    disk0s5

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +142.0 GB   disk2
                                 Physical Store disk0s2
   1:                APFS Volume ⁨Macintosh HD⁩            15.3 GB    disk2s1
   2:              APFS Snapshot ⁨com.apple.os.update-...⁩ 15.3 GB    disk2s1s1
   3:                APFS Volume ⁨Preboot⁩                 313.6 MB   disk2s2
   4:                APFS Volume ⁨Recovery⁩                625.7 MB   disk2s3
   5:                APFS Volume ⁨VM⁩                      1.1 MB     disk2s4
   6:                APFS Volume ⁨Macintosh HD - Data⁩     111.1 GB   disk2s5


Many thanks in advance,

Alex

Posted on Dec 21, 2021 10:27 AM

Reply
12 replies

Dec 28, 2021 6:33 PM in response to Alex Morello

I was typing a detailed reply, but lost it and could not recover it.


Long story short, don't triple boot your computer. People always regret doing it as they inevitably run out of storage space on one or more partitions. Whenever users try to "fix" these issues, they end up breaking one or more operating systems and losing access to their data (sometimes just temporarily). Plus dual/triple booting is always a pain when switching between operating systems. It is much more convenient to use and access an alternate OS from a VM which is less risky to a Mac. Unless you need the extra memory/performance of installing an OS to bare metal a VM is always the better and safer choice (even for Windows).


Linux bootloaders are really simple as they are stored on the hidden EFI/ESP partition usually in a folder with the distribution's name, but sometimes it is necessary to use a generic "boot" folder instead because Apple's firmware is sometimes unable to detect a Linux bootloader otherwise. Once you have modified the partitions, you broke the Windows bootloader since the Windows bootloader has no way of knowing where the Windows' system files have been moved. You may as well remove the "microsoft" or "windows" folders from the EFI/ESP partition and attempt to restore the partitions to the main macOS Container again (you should first try doing this using BootCamp Assistant, but if that fails you can try Disk Utility although from what I've read on these forums that will likely fail). So in the end you will most likely find it easiest and fastest to just erase the entire physical drive and start all over again -- which is why I initially said dual/triple booting should be avoided whenever possible unless using the OS in a VM is not an option for some reason). Even if someone like @LonerT is here to assist you, the process will take lots of time with no guarantee of success.


Perhaps it is possible to use the Windows installer to help fix the Window's boot issues, but even on a standard PC this can be extremely difficult. I highly recommend you make sure to have a good backup before you do anything else since it can be very easy to lose data from each OS when you attempt to fix partition issues and boot issues. If you want to fix your current setup without starting over, then you may have to learn on your own how to do it by reading lots of forum posts since @LonerT is one of the few contributors on these forums who really understands the lower level details of macOS partitions/Containers/volumes and Windows BootCamp.


Good luck.


Dec 21, 2021 11:09 AM in response to Alex Morello

By the way, here's what gpt -r show yields for disk0:


     start      size  index  contents

         0         1         PMBR

         1         1         Pri GPT header

         2         4         Pri GPT table

         6     76800      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B

     76806  34667968      2  GPT part - 7C3457EF-0000-11AA-AA11-00306543ECAC

  34744774        58         

  34744832   2441216      3  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

  37186048       256         

  37186304  15900928      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

  53087232   8192000      5  GPT part - 0FC63DAF-8483-4772-8E79-3D69D8477DE4

  61279232       107         

  61279339         4         Sec GPT table

  61279343         1         Sec GPT header


and here's the sudo gdisk /dev/disk0 read-out (from macOS Terminal). It's funny how gdisk reported there only was an APM under Linux:


GPT fdisk (gdisk) version 1.0.8



Warning: Devices opened with shared lock will not have their

partition table automatically reloaded!

Partition table scan:

  MBR: protective

  BSD: not present

  APM: not present

  GPT: present



Found valid GPT with protective MBR; using GPT.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Linux / Hybrid MBR Setup Broke Boot Camp

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.