Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Asked
Viewed
35k times
I used to have a bootcamp partition but somehow while attempting to remove it its changed into a container disk. (don’t know how this happened, I didn’t explicitly create a container).
diskutil list:
/dev/disk0 (internal):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme 500.3 GB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk1 402.0 GB disk0s2
3: Apple_APFS Container disk2 97.8 GB disk0s3
4: Apple_Boot Boot OS X 134.2 MB disk0s4
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +402.0 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD 336.1 GB disk1s1
2: APFS Volume Preboot 23.2 MB disk1s2
3: APFS Volume Recovery 515.0 MB disk1s3
4: APFS Volume VM 2.1 GB disk1s4
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +97.8 GB disk2
Physical Store disk0s3
How can I delete this and merge its space back into the main drive?
0
Here, I assume the macOS volume that you boot to is Macintosh HD
.
The commands below should remove the extra partitions and return the free space back to macOS.
diskutil erasevolume free none disk0s4
diskutil apfs deletecontainer disk0s3 Untitled
diskutil erasevolume free none disk0s3
diskutil apfs resizecontainer disk0s2 0
If you are using Big Sur or newer, then you can just enter the commands given below.
diskutil erasevolume free none disk0s4
diskutil apfs deletecontainer disk0s3
diskutil apfs resizecontainer disk0s2 0
0
If you are looking for a non-command line version, there is also a way to do it from the native Disk Utility app.
- Open Disk Utility.
- Select the partition in the lefthand menu.
- Right click –> “Erase” (it will now rename to Container disk#)
- In the top righthand menu, press “Partition”
- Select the desired partition in the pie chart
- Press the “-” (minus) option directly under the Pie chart
- Wait for confirmation message (APPLE SSD AP0512M Media has been cleaned)
Rohan Shah is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
You must log in to answer this question.
Not the answer you’re looking for? Browse other questions tagged .