2

When I tried to bootcamp today and it failed midway through and wouldn't delete the partition. I've tried deleting the partition manually through disk utility both through the regular desktop and recovery mode. I was unable to delete this partition made by the bootcamp utility and trying to use bootcamp utility to delete yields no results.

This is why my disk utility looks like. Macintosh HD is my main partition that I wish to keep and Container disk1 is the partition that was originally made by bootcamp and that I tried to manually erase but it does not go away.enter image description here

Attempting to do diskutil list yields:

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         251.0 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                 Apple_APFS Container disk2         197.0 GB   disk0s2
   3:                 Apple_APFS Container disk1         53.6 GB    disk0s3
   4:                 Apple_Boot Boot OS X               134.2 MB   disk0s4

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +53.6 GB    disk1
                                 Physical Store disk0s3
   1:                APFS Volume Preboot                 45.1 MB    disk1s2
   2:                APFS Volume Recovery                20.5 KB    disk1s3

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +197.0 GB   disk2
                                 Physical Store disk0s2
   1:                APFS Volume Macintosh HD            165.7 GB   disk2s1
   2:                APFS Volume Preboot                 45.2 MB    disk2s2
   3:                APFS Volume Recovery                510.5 MB   disk2s3
   4:                APFS Volume VM                      2.1 GB     disk2s4

Doing diskutil cs list yields "No CoreStorage logical volume groups found"

Please help, I am lost and unsure what to do.

1 Answer 1

1

I suppose your System is High Sierra or Mojave. I'm amazed that Boot Camp Assistant created a container during its installation. Otherwise, to remove this container, the terminal command is:

diskutil ap deletecontainer disk1 

Then to free disk space :

diskutil erasevolume free space disk0s3

and finally add this space to your system container :

diskutil ap resizecontainer disk2 0b

After these operations, give the result of :

diskutil list

There is a partition that seems useless to me:

4: Apple_Boot Boot OS X 134.2 MB disk0s4

Before removing it, are you using Filevault (data encryption)?

Edit : Filevault don't need this partition type. I've try on a Virtual Machine.

You can delete this partition :

diskutil erasevolume free space disk0s4 

Then add this space to your system container :

diskutil ap resizecontainer disk2 0b
3
  • The command diskutil ap deletecontainer disk1 creates an Apple_HFS type partition with identifier disk0s3. Since the Apple_HFS type partition is followed an Apple_Boot type partition with identifier disk0s4, the diskutil erasevolume free space disk0s3 command will remove both disk0s3 and disk0s4. There will be no need to enter the diskutil erasevolume free space disk0s4 command. You should learn how to test these types of answers before posting. Commented May 8, 2021 at 7:12
  • @David Anderson. Ho Thanks you very much Teacher You are the best lol. But in the present case i'm not sure of your analyse. Because this disk0s4 partition where present with an APFS structure and it's not very "normal".
    – user415185
    Commented May 8, 2021 at 7:17
  • I did not analyze. I built a sparse image containing a drive similar to the one described in the OP's question. Next, I entered the commands in your answer. The diskutil erasevolume free space disk0s3 command removed both disk0s3 and disk0s4. AFAIK, this behavior has been true since Apple_Boot type partitions first appeared with the release of Lion. Commented May 8, 2021 at 7:36

You must log in to answer this question.

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