Failed to remove container disk and reclaim space to main partition
After I removed Boot Camp I found out that the partition space didn't merge back into my main volume, instead it was called "container disk1". There was no option to delete it so I tried to initialize it and I renamed it "boh".
Following the answer that was given to this question: How to remove a container disk and reclaim space with main partition?, I ran diskutil list
and obtained
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk2 200.0 GB disk0s2
3: Apple_APFS Container disk1 50.7 GB disk0s3
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +50.7 GB disk1
Physical Store disk0s3
1: APFS Volume boh 708.6 KB disk1s1
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +200.0 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 15.7 GB disk2s1
2: APFS Snapshot com.apple.os.update-... 15.7 GB disk2s1s1
3: APFS Volume Preboot 302.6 MB disk2s2
4: APFS Volume Recovery 1.1 GB disk2s3
5: APFS Volume VM 3.2 GB disk2s4
6: APFS Volume Macintosh HD - Dati 115.9 GB disk2s5
Then diskutil erasevolume free none disk0s3
and it returned:
The target disk is in use by APFS as a Physical Store; use diskutil apfs deleteContainer
so I ran diskutil apfs deleteContainer disk0s3
and now when I type diskutil list
this is what I see:
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk2 200.0 GB disk0s2
(free space) 50.7 GB -
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +200.0 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 15.7 GB disk2s1
2: APFS Snapshot com.apple.os.update-... 15.7 GB disk2s1s1
3: APFS Volume Preboot 302.6 MB disk2s2
4: APFS Volume Recovery 1.1 GB disk2s3
5: APFS Volume VM 3.2 GB disk2s4
6: APFS Volume Macintosh HD - Dati 115.9 GB disk2s5
And now I'm scared that I messed it up. The volume doesn't either show up in Disk Utility.
I have a 2016 MacBook Pro 13-inch 4 TBT3, running MacOS Monterey 12.0.1 Thanks everyone in advance
The accepted answer the OP (user federico.jpg) was referring to has been updated. The version of the accepted answer that the OP read when posting the question can been seen here.
Since the question you referenced was posted, macOS has changed. You no longer have to enter the command below. This is the third command shown in the accepted answer.
diskutil erasevolume free none disk0s3
Instead, you just need to enter the command below, which is the final command shown in the accepted answer.
diskutil apfs resizecontainer disk0s2 0