macOS partition disappered after installing windows 10 using bootcamp
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!
Solution 1:
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.
-
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.
-
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. -
Configure the TextEdit application. Open TextEdit, then navigate to the "Preferences..." window. Uncheck all the "Options", as shown below. When finished, quit TextEdit.
-
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
-
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.
-
(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.
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
Solution 2:
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.