3

About a year ago, I installed Windows 10 via Boot Camp, which I now want to remove, but it doesn't seem to be done causing issues... When I go into the Boot Camp Assistant, I get this message: enter image description here

My Disk Utility looks like this: enter image description here

diskutil list gives me:

/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         1.0 TB     disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk1         912.4 GB   disk0s2
   3:       Microsoft Basic Data Windows                 78.8 GB    disk0s3
   4:           Windows Recovery                         480.2 MB   disk0s4

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

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *8.0 TB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:       Microsoft Basic Data Seagate 02              8.0 TB     disk2s2

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *8.0 TB     disk3
   1:                        EFI EFI                     209.7 MB   disk3s1
   2:       Microsoft Basic Data Seagate 01              8.0 TB     disk3s2

What's the safest way to completely remove the partition/Windows? I'm just scared of messing something up. Thanks in advance!

2

The proper commands, to remove Windows and add the free space back to macOS, are given below. The commands should work unless there is a problem with APFS.

sudo  diskutil  eraseVolume  free  none  disk0s4
sudo  diskutil  eraseVolume  free  none  disk0s3
sudo  diskutil  apfs  resizeContainer  disk0s2  0

The next sequence of commands removes any Windows boot code that may exist in the hidden EFI partition.

diskutil  mount  disk0s1
cd  /Volumes/EFI
rm  -fr  EFI/Windows
rm  -fr  EFI/Boot
cd  /
diskutil  unmount  disk0s1
  • Thank you! Can I run these booted in macOS or should I boot into recovery mode? – Mario Parra May 6 '18 at 19:34
  • Why do you cd back to / after? – BaconDuctTape May 6 '18 at 20:21
  • @Mario Parra: You run these commands while booted in macOS. I did test these commands on a non-boot drive. However, since you will be applying the commands to disk0, you may need to precede certain commands with sudo. I changed my answer to include sudo where I believe a sudo may be necessary. – David Anderson May 6 '18 at 22:11
  • 1
    @BaconDuctTape: If you skip cd /, then the next command may fail. In other words, you may not be able to unmount disk0s1 when the present working directory (pwd) is /Volumes/EFI. – David Anderson May 6 '18 at 22:33
  • Worked like a charm! The Windows partition is gone and macOS took over the space. No errors in Terminal. Thanks again – Mario Parra May 7 '18 at 3:07
1

Safe for me it to disconnect all external drives and boot to recovery disk.

Your windows partitions are all after the Mac Apple_APFS Container disk1 so if you were to go into Disk Utility from the recovery OS - you should be able to grow it to reclaim the small amount of "wasted" space you'll have left over after you delete the 80 GB reserved for windows.

If you're handy in the command line and have a backup of your Mac and can wipe and reinstall the OS easily, I bet we could come up with a more risky diskutil command to just grow the APFS container / deleting the rest of the items, but that's less easy and less safe. One space or syntax error or the wrong digit and your Mac could be deleted and you'd need your backup to recover.

You must log in to answer this question.

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