MacOS Bootcamp – Partitioning Error for Startup Disk

bootcampdisk-utilitymacospartitionwindows

I am running Mojave, trying to install the latest version of Windows 10.

I had this error, so followed the instructions here:

Bootcamp issue: The startup disk cannot be partitioned or restored to a single partition

Then started Bootcamp, and while Bootcamp was running, an update restarted my iMac, and now I am getting the same error, but there seems to be just 1 partition.

$ diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         121.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk2         121.0 GB   disk0s2

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk2         2.0 TB     disk1s2

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +2.1 TB     disk2
                                 Physical Stores disk0s2, disk1s2
   1:                APFS Volume Macintosh HD            1.1 TB     disk2s1
   2:                APFS Volume Preboot                 43.2 MB    disk2s2
   3:                APFS Volume Recovery                509.8 MB   disk2s3
   4:                APFS Volume VM                      2.1 GB     disk2s4

So now I am stuck and can't install Windows.

I would really appreciate some help, since I have already spent 20h with this Windows partition (tried updating the old one, it got corrupted, after hours of trying to fix it, tried re-installing it with Microsoft Tool, it failed, and now when trying to reinstall it with Bootcamp, somehow it failed again).

Thanks.

EDIT

Ran the command, here's the result:

The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Shrinking APFS Physical Store disk1s2 from 2,000,189,177,856 to 1,699,999,997,952 bytes
Shrinking APFS data structures
Shrinking partition
Modifying partition map
Volume name      : BOOTCAMP
Partition offset : 3320723456 sectors (1700210409472 bytes)
Volume size      : 586305536 sectors (300188434432 bytes)
Bytes per sector : 512
Bytes per cluster: 131072
FAT offset       : 2048 sectors (1048576 bytes)
# FAT sectors    : 18432
Number of FATs   : 1
Cluster offset   : 20480 sectors (10485760 bytes)
# Clusters       : 2290176
Volume Serial #  : 5d117270
Bitmap start     : 2
Bitmap file size : 286272
Upcase start     : 5
Upcase file size : 5836
Root start       : 6
Mounting disk
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk1s3
Finished APFS operation

Here's the output of diskutil list

diskutil list
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         121.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk2         121.0 GB   disk0s2

/dev/disk1 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                 Apple_APFS Container disk2         1.7 TB     disk1s2
   3:       Microsoft Basic Data BOOTCAMP                300.2 GB   disk1s3

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +1.8 TB     disk2
                                 Physical Stores disk0s2, disk1s2
   1:                APFS Volume Macintosh HD            765.0 GB   disk2s1
   2:                APFS Volume Preboot                 43.2 MB    disk2s2
   3:                APFS Volume Recovery                509.8 MB   disk2s3
   4:                APFS Volume VM                      2.1 GB     disk2s4

/dev/disk3 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                            CCCOMA_X64FRE_EN-US... +4.9 GB     disk3

/dev/disk4 (disk image):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        +2.1 TB     disk4
   1:                        EFI EFI                     209.7 MB   disk4s1
   2:                  Apple_HFS Time Machine Backups    2.1 TB     disk4s2

Best Answer

To use the Graphical User Interface (GUI) provided by Microsoft to install Windows 10 on disk1 of your Mac, you would have to remove the disk1s2 partition containing the APFS Container disk2. To keep this partition and also install Windows 10 to this drive, you will have to use the Windows 10 Command Line Interface (CLI). Basically, you will need to run the diskpart and dism commands in a Command Prompt window.

How to Create a Windows 10 USB Installer.

Creating the Windows 10 USB installer is fairly simple. The steps are given below.

  1. Use the Disk Utility application to erase the USB flash drive. Choose WINSTALL for the name, ExFAT for the format and Master Boot Record for the scheme.
  2. Use the Finder application to open (mount) the 64 bit Windows 10 ISO file. The latest release of Windows 10 can be downloaded from this Microsoft website.
  3. Copy the entire contents of mounted Windows 10 ISO volume to the flash drive.
  4. Use the Boot Camp Assistant application to download the Windows Support Software. Look for Download Windows Support Software under Action on the menu bar.
  5. Copy the entire contents of the downloaded Windows Support Software folder to the flash drive.

If you followed the above steps correctly, then you should at least find the $WinPEDriver$ and efi folders in the root folder of the flash drive.

How to Boot from a Windows 10 USB Installer and Open a Command Prompt Window.

  1. Restart the Mac and immediately hold down the option key until then Start Manager icons appear.
  2. Choose the external drive icon with the label EFI Boot.
  3. You should see a window similar to the image shown below. When this occurs, press the shift+F10 key combination. A Command Prompt window should appear.

How to Create the Partitions Needed for Windows 10.

The instructions given below were take directly from the Microsoft website: UEFI/GPT-based hard drive partitions. Since you already have a GPT partitioned drive, the appropriate changes were made to the procedure given in the linked website.

  1. Enter the command given below to start the disk partitioning application.

    diskpart
    
  2. The commands give below should assign the temporary drive letter S to the system partition created when you installed macOS.

    select disk 1
    select partition 1
    assign letter=s
    
  3. Enter the commands given below to select the BOOTCAMP partition. Use the output to confirm the label is BOOTCAMP. Proceed only if the label is BOOTCAMP.

    select partition 3
    detail partition
    
  4. Enter the command given below to delete the Boot Camp partition.

    delete partition
    
  5. The next command will create a Microsoft Reserved (MSR) partition.

    create partition msr size=16
    
  6. Enter the commands given below to recreate the Boot Camp partition, then shrink the partition to make space for the Recovery Tools partition. Next the partition is formatted. Finally, the temporary drive letter W is assigned to the partition.

    create partition primary
    shrink minimum=800
    format fs=ntfs label=BOOTCAMP quick
    assign letter=w
    
  7. Enter the commands given below to create the Recovery Tools partition.

    create partition primary id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
    format fs=ntfs label=Recovery quick
    gpt attributes=0X8000000000000001
    
  8. Enter the command below to get a list of volumes. Note which drive letter (Ltr) was assigned to volume with the label WINSTALL. Th rest of this answer assumes the drive letter is D. If you get a different drive letter, then make the appropriate substitutions.

    list volume
    
  9. Enter the commands given below to exit diskpart command. Proceed and install Windows 10.

    exit
    

Transfer the Windows 10 files to the Boot Camp Partition.

  1. First, enter the command given below to determine name of the file containing the Windows files. I will assume the displayed file name is install.wim.

    dir  /b  D:\Sources\install.*
    

    If you get the file install.esd, make the appropriate substitution when entering the commands given below.

  2. Next, enter the following command to determine the index of the Windows image you wish to install.

    dism  /Get-ImageInfo  /ImageFile:D:\sources\install.wim
    

    For my install.wim file, the index shown for the name Windows 10 Pro was 6. I will use this value in the commands shown below.

  3. This command will copy the Microsoft Windows 10 files to the "BOOTCAMP" volume.

    dism  /Apply-Image  /ImageFile:D:\sources\install.wim  /index:6 /ApplyDir:W:\  /CheckIntegrity
    

    Note: When entering the above command, the parameter /name:"Windows 10 Pro" could have been substituted for /index:6.

  4. Add the Apple supplied drivers to the drivers store. This can be accomplished by entering the command shown below.

    dism  /Image:W:\  /Add-Driver  /Driver:D:\$WinPEDriver$  /Recurse  /ForceUnsigned
    

    Note: If any drivers are ineligible, you may see error messages. This is normal, so such error messages can be ignored.

Write the Boot Files to the System Partition and Boot to Windows

  1. Write the boot files to the system partition. The command to use is given below.

    bcdboot  w:\windows  /s  s:
    
  2. Enter the command given below to close the Command Prompt Window.

    exit
    
  3. Click on the X in the red box on the upper right side of the window shown below. When prompted, click on the Yes button to restart the Mac. Immediately hold down the option key until then Start Manager icons appear.

  4. Hold down the control key while choosing the internal drive icon with the label Windows.

  5. Follow the directions and complete the installation of Windows 10.

  6. When Windows finishes installing, run the Window Support Software installer. Normally this installer starts automatically. If necessary, run the the setup application in the BootCamp folder on the flash drive with the volume label WINSTALL.

How to Select an Apple Keyboard

The following steps can be execute to select an Apple keyboard. The steps should only be executed after the Window Support Software installer has run.

  1. Click on the Window Start button, then select Settings.
  2. Select Time & Language.
  3. Select Language.
  4. Select Default app language; Default input language; Windows display language.
  5. Select Options.
  6. Select Add a keyboard.
  7. Select the appropriate Apple keyboard.
  8. Select the original keyboard, then select Remove.

References:

UEFI/GPT-based hard drive partitions
Capture and apply Windows, system, and recovery partitions
DISM Image Management Command-Line Options
Create a Windows 10 Bootable USB Flash Drive on a Mac
Resolving INACCESSIBLE_BOOT_DEVICE Error after restoring Winclone image
Is it possible to use Boot Camp with Windows 10 from an external HDD?