diskutil ap deleteContainer disk2 "Macintosh HD"
diskutil list
MacBook-de-Chopin:~ cesar$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *128.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 79.9 GB disk0s2
3: Apple_APFS Container disk1 47.8 GB disk0s3
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +47.8 GB disk1
Physical Store disk0s3
1: APFS Volume SOS 21.0 GB disk1s1
2: APFS Volume Preboot 22.0 MB disk1s2
3: APFS Volume Recovery 516.1 MB disk1s3
4: APFS Volume VM 3.2 GB disk1s4
MacBook-de-Chopin:~ cesar$
diskutil ap convert disk0s2
diskutil list
MacBook-de-Chopin:~ cesar$ diskutil ap convert disk0s2
Started APFS operation on disk0s2 Macintosh HD
Converting HFS Volume to an APFS Container which will export one APFS Volume
The target is the Journaled HFS+ volume "Macintosh HD" backed by the GPT partition disk0s2
The target is a data disk; it is not a macOS system disk
Found APFS EFI driver /usr/standalone/i386/apfs.efi to install into the APFS Container
The target is not encrypted
Unmounting disk0s2
Starting conversion from HFS to APFS
Performing apfs_hfs_convert -x --verbose=0x400 --efi /usr/standalone/i386/apfs.efi /dev/disk0s2
Reporting pre-conversion statistics
Reporting post-conversion statistics
Successfully finished conversion from HFS to APFS
Successful conversion in commit mode so will switch type to APFS
Setting type of disk0s2 to APFS
Changing the physical disk partition type in shared mode
Partition modification attempt count was 1
Opening and closing disk0s2 to terminate old content driver
Expecting the new APFS Container at Physical Store disk0s2
Confirmed existence of new unencrypted APFS Volume disk2s1
Mounting APFS Volume disk2s1
APFS Volume mount attempt result was 0
Exiting conversion operations with error code 0
Disk from APFS operation: disk2s1
Finished APFS operation on disk0s2 Macintosh HD
MacBook-de-Chopin:~ cesar$
MacBook-de-Chopin:~ cesar$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *128.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk2 79.9 GB disk0s2
3: Apple_APFS Container disk1 47.8 GB disk0s3
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +47.8 GB disk1
Physical Store disk0s3
1: APFS Volume SOS 21.0 GB disk1s1
2: APFS Volume Preboot 22.0 MB disk1s2
3: APFS Volume Recovery 516.1 MB disk1s3
4: APFS Volume VM 3.2 GB disk1s4
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +79.9 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 925.7 KB disk2s1
MacBook-de-Chopin:~ cesar$
diskutil list
MacBook-de-Chopin:~ cesar$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *128.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk2 79.9 GB disk0s2
3: Apple_APFS Container disk1 47.8 GB disk0s3
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +47.8 GB disk1
Physical Store disk0s3
1: APFS Volume SOS 21.7 GB disk1s1
2: APFS Volume Preboot 22.0 MB disk1s2
3: APFS Volume Recovery 516.1 MB disk1s3
4: APFS Volume VM 3.2 GB disk1s4
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +79.9 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 17.6 GB disk2s1
2: APFS Volume Preboot 20.3 MB disk2s2
3: APFS Volume Recovery 520.6 MB disk2s3
MacBook-de-Chopin:~ cesar$
diskutil list
MacBook-de-Chopin:~ cesar$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *128.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk2 79.9 GB disk0s2
3: Apple_APFS Container disk1 47.8 GB disk0s3
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +47.8 GB disk1
Physical Store disk0s3
1: APFS Volume SOS 20.5 GB disk1s1
2: APFS Volume Preboot 22.0 MB disk1s2
3: APFS Volume Recovery 516.1 MB disk1s3
4: APFS Volume VM 3.2 GB disk1s4
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +79.9 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 17.9 GB disk2s1
2: APFS Volume Preboot 22.0 MB disk2s2
3: APFS Volume Recovery 520.6 MB disk2s3
4: APFS Volume VM 3.2 GB disk2s4
MacBook-de-Chopin:~ cesar$
diskutil ap deleteContainer disk1
diskutil eraseVolume free null disk0s3
diskutil ap resizeContainer disk2 0b
MacBook-de-Chopin:~ cesar$ diskutil ap resizeContainer disk2 0b
Started APFS operation
Aligning grow delta to 47 960 137 728 bytes and targeting a new physical store size of 127 825 920 000 bytes
Determined the maximum size for the targeted physical store of this APFS Container to be 127 824 891 904 bytes
Resizing APFS Container designated by APFS Container Reference disk2
The specific APFS Physical Store being resized is disk0s2
Verifying storage system
Using live mode
Performing fsck_apfs -n -x -l /dev/disk0s2
Checking volume
Checking the container superblock
Checking the EFI jumpstart record
Checking the space manager
Checking the object map
Checking the APFS volume superblock
warning: apfs_sb at apfs_fs_index (0): apfs_formatted_by.timestamp is invalid (1531252292000000000), is greater than current time (1531249368601370000)
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Checking snapshot 1 of 1
Checking the APFS volume superblock
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Checking the APFS volume superblock
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Checking the APFS volume superblock
Checking the object map
Checking the fsroot tree
Checking the snapshot metadata tree
Checking the extent ref tree
Checking the snapshots
Verifying allocated space
The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Growing APFS Physical Store disk0s2 from 79 865 782 272 to 127 825 920 000 bytes
Modifying partition map
Growing APFS data structures
Finished APFS operation
MacBook-de-Chopin:~ cesar$
diskutil list
MacBook-de-Chopin:~ cesar$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *128.0 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk2 127.8 GB disk0s2
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +127.8 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 18.3 GB disk2s1
2: APFS Volume Preboot 22.0 MB disk2s2
3: APFS Volume Recovery 520.6 MB disk2s3
4: APFS Volume VM 3.2 GB disk2s4
MacBook-de-Chopin:~ cesar$