4

I use a macbook pro 2015 with macOS High Sierra. I installed windows 10 using bootcamp, which resized the macOS partition and created a 80GB windows partition. The machine boots into windows just fine.

Unfortunately I can't go back to macOS because the macOS partition is not selectable as a boot source in bootcamp and "boot into X" boots into windows again. When I start from recovery (ctrl+R) I can see both partitions in diskutil. I tried to repair the macOS partiton but it had no effect. How can i resurrect the macOS partion so I can choose which OS to start?

Update: I can start macOS by booting with option/alt pressed and chose the mac partition.

diskutil list output:

Capsicum:~$ diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *251.0 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                 Apple_APFS Container disk1         170.0 GB   disk0s2
   3:       Microsoft Basic Data BOOTCAMP                80.3 GB    disk0s3
   4:           Windows Recovery                         503.3 MB   disk0s4

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +170.0 GB   disk1
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            101.3 GB   disk1s1
   2:                APFS Volume Preboot                 20.2 MB    disk1s2
   3:                APFS Volume Recovery                506.6 MB   disk1s3
   4:                APFS Volume VM                      2.1 GB     disk1s4

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *2.0 TB     disk2
   1:                  Apple_HFS Passport                2.0 TB     disk2s1

thanks a lot for any clarification what is wrong!

bmike
  • 235,889
elsni
  • 141
  • If you hold down the option key when first turning on your Mac, you should get the Startup Manager. Does macOS appear? If so, can you boot to macOS? – David Anderson Dec 08 '17 at 13:41
  • @David: Yes!!! Thanks a lot, the drive appears and I can boot into MacOS. Great! Problem partly solved. Do you know how to make the partition visible in bootcamp software in windows? – elsni Dec 08 '17 at 13:53
  • If you have booted back to macOS, then open a Terminal application window and enter the command diskutil list. Post the output to your question. – David Anderson Dec 08 '17 at 15:31
  • When booted to Windows, have you run Apple Software Update utility to see if you have the latest Apple software running under Windows? – David Anderson Dec 10 '17 at 13:50
  • You state: "I can start macOS by booting with option/alt pressed and chose the mac partition." Did you know that if you hold down the control key when choosing the mac partition, then this will become the default boot partition? – David Anderson Dec 10 '17 at 14:10
  • Apple Update found two updates for input devices and WiFi, but still the mac partiton does not show up in windows bootcamp software. Setting it as default partition makes no difference, system boots into windows by default. At least i pressed the cmd button while selecting the mac partition in boot selection, how can I check if it actually made it the default boot partition? – elsni Dec 10 '17 at 15:15
  • NOT the cmd button! The control key. The straight arrow, displayed under the mac partition label, should change to a circular arrow. The other way to make macOS the default would be from System Preferences. (But, I assume you already knew that.) – David Anderson Dec 10 '17 at 16:20
  • Ok, with the control key I can make macOS default, so the machine reboots to macOS when I do a restart. However when I boot into windows the windows partiton becomes default again. Bootcamp software stills shows only the bootcamp partition and the mac starts windows after reboot. – elsni Dec 10 '17 at 21:42
  • The Boot Camp installer doesn't make mention of this at all, but Macs with SSDs that use APFS (which are effectively all modern Macs) can't restart into macOS from the system tray icon in Windows: https://support.apple.com/en-us/HT208123. I too thought I hosed my macOS install until I found that support article! – daGUY Nov 10 '18 at 21:14

2 Answers2

5

If you use APFS, then your macOS boot volume may not appear as a choice in the Windows Boot Camp Control Panel pane. The following procedure can be used to fix this problem.

Since the Windows Boot Camp software can detect bootable "Mac OS Extended (Journaled)" volumes, the follow instructions create such a volume. Instead of placing macOS in the volume, a third party boot manager, called rEFInd, will be substituted. This boot manager will then be configured to silently boot the macOS stored in the APFS container. Finally, macOS will be instructed to not automatically mount this new volume at startup.

Below are the steps. The commands need to be entered into a Terminal application window.

  1. Create the new volume. The diskutil command, shown below, shrinks the APFS container (170000M, i.e. 170 GB) by 300 MB (169700M) and creates the new 300 MB "Mac OS Extended (Journaled)" volume labeled "Macintosh HD via rEFInd".

    sudo diskutil ap resizeContainer disk1 169700M JHFS+ "Macintosh HD via rEFInd" 0
    

    After the command completes, restart the Mac.

    Note: If you get an error message which includes the phrase "perhaps caused by APFS Snapshot usage by Time Machine", then see the question: 200GB unused, but can't change APFS container size due to minimum requirement.

  2. Download the rEFInd Boot Manager software from this SourceForge web site. Enter the following commands to install the software to the "Macintosh HD via rEFInd" volume.

    cd ~/Downloads/refind-bin-0.11.2
    ./refind-install --ownhfs /dev/disk0s3
    

    Note: The error message Could not set boot device property: 0xe00002bc was expected and can be ignored.

  3. Configure the TextEdit application. Open TextEdit, then navigate to the "Preferences..." window. Uncheck all the "Options", as shown below. When finished, quit TextEdit.

    y1

  4. Use the command below to navigate to the folder containing the refind.conf file.

    cd "/Volumes/Macintosh HD via rEFInd/System/Library/CoreServices"
    

    Make a backup copy of this file.

    sudo cp refind.conf refind.conf.orignal
    

    Add write permissions to the CoreServices folder and the refind.conf file.

    sudo  chmod  a+w  .  refind.conf
    

    Open the file in the TextEdit application.

    open -e refind.conf
    
  5. Add the following lines to the end of the refind.conf file. You should be able to just cut and paste these lines. When finished, save the changes, then quit TextEdit.

    #
    # Added to make rEFInd silent. 
    #
    menuentry "Macintosh HD via rEFInd" {
        icon \System\Library\CoreServices\icons\os_mac.png
        volume "Macintosh HD"
        loader \System\Library\CoreServices\boot.efi
        ostype MacOS
        graphics on
    }
    timeout -1
    hideui all
    scanfor manual
    

    Note: If you are using encryption, then see the update to this step shown below.

  6. (Optional) Enter the following commands to modify the /etc/fstab file. This entry will instruct macOS not to mount the volume labeled "Macintosh HD via rEFInd" at startup.

    sudo bash 
    echo >>/etc/fstab
    echo "LABEL=Macintosh\040HD\040via\040rEFInd none hfs rw,noauto" >>/etc/fstab    
    exit
    

    Note: The character sequence \040 is just the octal representation of the space character.

    When finished, restart the Mac.

Now when choosing Boot Camp from the Control Panel, you should get something similar to what is shown below.

capture1

Update to Step 5 for an Encrypted macOS

Enter the command given below to get identifier of the booter disk.

diskutil info "Macintosh HD" | grep "Booter Disk:"

Your output should be similar to what is shown below.

   Booter Disk:              disk1s2

Use the identifier to get the boot disk volume name, as shown below.

diskutil info disk1s2 | grep "Volume Name:"

Your output should be similar to what is shown below.

   Volume Name:              Preboot

Use the macOS volume name to get the volume UUID, as shown below.

diskutil info "Macintosh HD" | grep "Volume UUID:"

Your output should be similar to what is shown below.

   Volume UUID:              2E0E6320-5D0A-4181-B465-ABFF2CBBFC27

Replace the volume with the boot disk volume name and add the volume UUID to the path of the loader, as shown below.

    #
    # Added to make rEFInd silent. 
    #
    menuentry "Macintosh HD via rEFInd" {
        icon \System\Library\CoreServices\icons\os_mac.png
        volume "Preboot"
        loader \2E0E6320-5D0A-4181-B465-ABFF2CBBFC27\System\Library\CoreServices\boot.efi
        ostype MacOS
        graphics on
    }
    timeout -1
    hideui all
    scanfor manual

Here the assumption has been made that there are no other APFS containers with a bootable macOS installed. If you do have another container, then by boot disk volume names may be the same. In this case, you will need to rename one of of the volumes. To change the volume name in this example from Preboot to Internal Preboot, enter the following commands.

First, enter the command shown below to mount the volume.

diskutil mount disk1s2

Your output should be similar to what is shown below.

Volume My Preboot on disk1s2 mounted

Second, enter the command shown below to rename the volume.

diskutil rename disk1s2 "Internal Preboot"

Your output should be similar to what is shown below.

Volume on disk1s2 renamed to Internal Preboot

Finally, enter the command shown below to unmount the volume.

diskutil unmount disk1s2

Your output should be similar to what is shown below.

Volume Internal Preboot on disk1s2 unmounted

The lines added to the end of the refind.conf file would then need to appear as shown below.

    #
    # Added to make rEFInd silent. 
    #
    menuentry "Macintosh HD via rEFInd" {
        icon \System\Library\CoreServices\icons\os_mac.png
        volume "Internal Preboot"
        loader \2E0E6320-5D0A-4181-B465-ABFF2CBBFC27\System\Library\CoreServices\boot.efi
        ostype MacOS
        graphics on
    }
    timeout -1
    hideui all
    scanfor manual
  • Any thoughts on this thread? https://apple.stackexchange.com/questions/348436/can-an-apfs-volume-be-moved – bmike Jan 13 '19 at 20:01
  • You are right - it is pretty bad. I'll try to clean it up. I thought I knew for sure the delete portion is good and I want to leave the "guidance part up" - Thanks for the reading and feedback – bmike Jan 13 '19 at 20:58
  • 2
    @bmike: First of all, I only posted the comment because the OP will probably not be reading these commands. I realize there is difficulty posting commands when you can not recreate the same state of the OP's drive. In your case, deleteContainer does not delete the container. Instead the container is converted to an empty initialized JHFS+ partition. You also have to use eraseVolume. For example, see here – David Anderson Jan 13 '19 at 21:11
  • I'm really grateful for the link - I've removed my details other than the resize. Thank you again for the expert help - I would hate to leave wrong information up or make their predicament worse (which having a JHFS+ in between containers would be) – bmike Jan 13 '19 at 21:19
  • Hi thanks for your detailed walkthrough. I've tried several times and, while I also see "Macintosh HD via rEFInd" folder appear as a startup disk in Windows' Boot Camp Control Panel, when I select/apply/restart, I enter the same screen as this other user, with the error 'Invalid loader file', and no way of entering Windows or OSX without restarting and holding down option key. Any advice on how to solve this? Thanks! – Joel Balmer Jan 15 '19 at 18:20
  • 1
    @JoelBalmer: I your macOS using encryption? – David Anderson Jan 15 '19 at 19:22
  • @DavidAnderson yes, currently turning it off as a test to see if it solves the issue (but it'll take >= 45 mins!) – Joel Balmer Jan 15 '19 at 21:24
  • 1
    @JoelBalmer: If you are using encryption, then what I posted would not work. I would have to update the answer. You need to boot to a different volume. – David Anderson Jan 15 '19 at 22:49
  • @DavidAnderson, just ran through the process again with another new drive and it worked - thanks so much for the help! – Joel Balmer Jan 16 '19 at 15:16
  • Out of curiosity, would it work if I now re-encrypted my drive? Or as you intimated in your answer, is it possible but the answer would need to be updated (to boot to a different volume)? Either way I'm happy, thanks again – Joel Balmer Jan 16 '19 at 15:19
  • 1
    @JoelBalmer: I updated my answer. While I did test my answer, I did not test using an encrypted macOS. Let me know if you are still having problems. – David Anderson Jan 16 '19 at 19:39
1

An alternative, although less elegant but also less difficult, workaround is the following:

-Format a usb flash drive in a format Windows can map (HFS+ Journaled worked fine for me);

-Install on it a working version of Macos X which can handle AFPS (10.13.6 worked fine for me);

-Once in Windows, choose the flash drive from the Bootcamp Control Panel and restart;

-Once logged in in the flash drive Macos x just go to startup disk and choose your hard disk to reboot into your APFS-based Macos.

I hope to have been clear.