diskutil ap resizeContainer disk2 500g jhfs+ Clone 0b
-bash-3.2# diskutil ap resizeContainer disk2 500g jhfs+ Clone 0b
Started APFS operation
Aligning shrink delta to 499 995 131 904 bytes and targeting a new physical store size of 499 999 997 952 bytes
Determined the minimum size for the targeted physical store of this APFS Container to be 863 691 079 680 bytes
Error: -69521: Your APFS Container resize request is below the APFS-system-imposed minimal container size (perhaps caused by APFS Snapshot usage by Time Machine)
-bash-3.2#
diskutil ap deleteSnapshot disk2s1 -xid 1449194
diskutil ap resizeContainer disk2 500g jhfs+ Clone 0b
-bash-3.2# diskutil ap deleteSnapshot disk2s1 -xid 1449194
Deleting APFS Snapshot XID 1449194 "com.apple.TimeMachine.2021-05-03-235848" from APFS Volume disk2s1
Started APFS operation
Finished APFS operation
-bash-3.2# diskutil ap resizeContainer disk2 500g jhfs+ Clone 0b
Started APFS operation
Aligning shrink delta to 499 995 131 904 bytes and targeting a new physical store size of 499 999 997 952 bytes
Determined the minimum size for the targeted physical store of this APFS Container to be 456 944 254 976 bytes
Resizing APFS Container designated by APFS Container Reference disk2
The specific APFS Physical Store being resized is disk0s2
Verifying storage system
Performing fsck_apfs -n -x -S /dev/disk0s2
Checking the container superblock
Checking the EFI jumpstart record
Checking the space manager
Checking the space manager free queue trees
Checking the object map
Checking volume
Checking the APFS volume superblock
The volume Macintosh HD was formatted by hfs_convert (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Checking volume
Checking the APFS volume superblock
The volume Preboot was formatted by hfs_convert (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
warning: directory valence check: directory (oid 0xc0043): orphan directory record
warning: directory valence check: directory (oid 0xc0043): orphan directory record
warning: directory valence check: directory (oid 0xc0043): orphan directory record
Checking volume
Checking the APFS volume superblock
The volume Recovery was formatted by diskmanagementd (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Checking volume
Checking the APFS volume superblock
The volume VM was formatted by apfs.util (945.200.129) and last modified by apfs_kext (945.275.7)
Checking the object map
Checking the snapshot metadata tree
Checking the snapshot metadata
Checking the extent ref tree
Checking the fsroot tree
Verifying allocated space
The volume /dev/disk0s2 appears to be OK
Storage system check exit code is 0
Shrinking APFS Physical Store disk0s2 from 999 995 129 856 to 499 999 997 952 bytes
Shrinking APFS data structures
Shrinking partition
Modifying partition map
newfs_hfs: WriteBuffer: pwrite(3, 0x1091b9000, 1048576, 2325278720): Input/output error
newfs_hfs: write (sector 4541560): Invalid argument
Mounting disk
Could not mount disk0s3 after erase
A problem occurred; undoing all changes
Error: -69832: File system formatter failed
-bash-3.2#
diskutil list internal
-bash-3.2# diskutil list internal
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk2 500.0 GB disk0s2
3: Apple_HFS 499.9 GB disk0s3
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +500.0 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 433.4 GB disk2s1
2: APFS Volume Preboot 23.9 MB disk2s2
3: APFS Volume Recovery 507.4 MB disk2s3
4: APFS Volume VM 8.6 GB disk2s4
-bash-3.2#
3: Apple_HFS 499.9 GB disk0s3
diskutil eraseVolume jhfs+ Clone disk0s3
-bash-3.2# diskutil eraseVolume jhfs+ Clone disk0s3
Started erase on disk0s3
Unmounting disk
Erasing
Initialized /dev/rdisk0s3 as a 466 GB case-insensitive HFS Plus volume with a 40960k journal
Mounting disk
Finished erase on disk0s3 Clone
-bash-3.2#
diskutil ap convert disk0s3
-bash-3.2# diskutil ap convert disk0s3
Converting the volume on disk0s3 to an APFS Volume on an APFS Container
Started APFS operation on disk0s3 Clone
Converting HFS Volume to an APFS Container which will export one APFS Volume
The target is the Journaled HFS+ volume "Clone" backed by the GPT partition disk0s3
The target is 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 disk0s3
Starting conversion from HFS to APFS
Performing apfs_hfs_convert -x --verbose=0x400 --efi /usr/standalone/i386/apfs.efi /dev/disk0s3
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 disk0s3 to APFS
Changing the physical disk partition type in shared mode
Partition modification attempt count was 1
Opening and closing disk0s3 to terminate old content driver
Expecting the new APFS Container at Physical Store disk0s3
Confirmed existence of new unencrypted APFS Volume disk22s1
Mounting APFS Volume disk22s1
APFS Volume mount attempt result was 0
Exiting conversion operations with error code 0
Disk from APFS operation: disk22s1
Finished APFS operation on disk0s3 Clone
-bash-3.2#
caffeinate -dimsu &
cp -av /Vol*/Macin*/* /Vol*/Clone
df -H
-bash-3.2# df -H
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk1s1 2.0G 1.3G 721M 64% 50309 4294916970 0% /
devfs 212k 212k 0B 100% 716 0 100% /dev
/dev/disk3 5.2M 5.2M 0B 100% 52 4294967227 0% /private/var/log
/dev/disk4 524k 147k 377k 29% 5 4294967274 0% /Volumes
/dev/disk5 524k 147k 377k 29% 7 4294967272 0% /private/var/tmp
/dev/disk6 524k 160k 365k 31% 15 4294967264 0% /private/var/run
/dev/disk7 2.1M 143k 2.0M 7% 2 4294967277 0% /private/tmp
/dev/disk8 524k 143k 381k 28% 2 4294967277 0% /System/Installation
/dev/disk9 524k 307k 217k 59% 21 4294967258 0% /private/var/db
/dev/disk10 13M 7.6M 5.0M 61% 216 4294967063 0% /private/var/folders
/dev/disk11 4.2M 655k 3.5M 16% 69 4294967210 0% /private/var/root/Library
/dev/disk13 2.1M 381k 1.7M 19% 76 4294967203 0% /private/var/root/Library/Containers
/dev/disk14 524k 184k 340k 36% 12 4294967267 0% /Library/Preferences
/dev/disk15 524k 168k 356k 33% 6 4294967273 0% /Library/Preferences/SystemConfiguration
/dev/disk16 1.0M 197k 852k 19% 8 4294967271 0% /Library/Keychains
/dev/disk17 524k 143k 381k 28% 2 4294967277 0% /Library/Security/Trust Settings
/dev/disk18 6.3M 176k 6.1M 3% 2 4294967277 0% /private/var/tmp/RecoveryTemp
/dev/disk19 6.3M 176k 6.1M 3% 2 4294967277 0% /private/var/tmp/OSISPredicateUpdateProductTemp
/dev/disk20 524k 143k 381k 28% 2 4294967277 0% /private/var/tmp/InstallerCookies
/dev/disk21 2.1M 143k 2.0M 7% 2 4294967277 0% /Library/Logs/DiagnosticReports
/dev/disk2s1 500G 433G 57G 89% 788448 9223372036853987359 0% /Volumes/Macintosh HD
/dev/disk22s1 500G 441G 58G 89% 798494 9223372036853977313 0% /Volumes/Clone
-bash-3.2#
diskutil ap deleteContainer disk2 "Macintosh HD" ; diskutil ap convert disk0s2 ; diskutil list internal
-bash-3.2# diskutil ap deleteContainer disk2 "Macintosh HD" ; diskutil ap convert disk0s2 ; diskutil list internal
Started APFS operation on disk2
Deleting APFS Container with all of its APFS Volumes
Unmounting Volumes
Unmounting Volume "Macintosh HD" on disk2s1
Unmounting Volume "Preboot" on disk2s2
Unmounting Volume "Recovery" on disk2s3
Unmounting Volume "VM" on disk2s4
Deleting Volumes
Deleting Container
Wiping former APFS disks
Switching content types
Reformatting former APFS disks
Initialized /dev/rdisk0s2 as a 466 GB case-insensitive HFS Plus volume with a 40960k journal
Mounting disk
1 new disk created or changed due to APFS operation
Disk from APFS operation: disk0s2
Finished APFS operation on disk2
Converting the volume on disk0s2 to an APFS Volume on an APFS Container
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 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
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_APFS Container disk2 499.9 GB disk0s2
3: Apple_APFS Container disk22 499.9 GB disk0s3
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +499.9 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 20.5 KB disk2s1
/dev/disk22 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +499.9 GB disk22
Physical Store disk0s3
1: APFS Volume Clone 441.4 GB disk22s1
-bash-3.2#