I have deleted a Bootcamp Partition, something went wrong and I now have 250 GB of "free space". Now I want to retake this space back. I already tried this solution but it didnt work for me. See screenshot attached. Secondly, I tried deleting the partition with disk utility but it too failed. Is there a way to retake the space without formatting the pc?
Output of diskutil list
:
❯ diskutil list ~
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: EFI EFI 314.6 MB disk0s1
2: Apple_APFS Container disk1 750.0 GB disk0s2
(free space) 250.2 GB -
/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +750.0 GB disk1
Physical Store disk0s2
1: APFS Volume Macintosh HD 15.8 GB disk1s1
2: APFS Snapshot com.apple.os.update-... 15.8 GB disk1s1s1
3: APFS Volume Macintosh HD - Data 310.8 GB disk1s2
4: APFS Volume Preboot 654.2 MB disk1s3
5: APFS Volume Recovery 1.1 GB disk1s4
6: APFS Volume VM 24.6 KB disk1s5
Output of diskutil addpartition disk0s1 apfs NewAPFS 0
:
❯ diskutil addpartition disk0s1 apfs NewAPFS 0 ~
The new partition to be added will be of a filesystem personality of APFS apfs APFS 7C3457EF-0000-11AA-AA11-00306543ECAC
The new partition will be added following disk0s1
Started partitioning on disk0
Error: -69519: The target disk is too small for this operation, or a gap is required in your partition map which is missing or too small, which is often caused by an attempt to grow a partition beyond the beginning of another partition or beyond the end of partition map usable space
Output of disk utility translated with deepl:
Operation 1 of 1 is executed: Remove "Free" ((null)) and grow container disk1 "Macintosh HD" (disk0s2) ...
Adjust growth delta to 250,240,712,704 bytes and set new physical storage size of 1,000,240,963,584 bytes
The maximum size for the target physical storage of this APFS container was determined to be 1,000,239,935,488 bytes
Change the size of the APFS container specified by the APFS container reference disk1.
The specific APFS physical storage that is being resized is disk0s2
Check storage system
Use live mode.
run fsck_apfs -n -x -l /dev/disk0s2
Check the container superblock ...
Check the EFI jumpstart entry ...
Check the space manager ...
Check the space manager free queue trees ...
Check the object allocation ...
Check the encryption key structures ...
Volume "/dev/rdisk1s1" is checked.
Check the APFS volume superblock ...
Check the object allocation ...
Check the snapshot metadata tree ...
Check the snapshot metadata ...
Check snapshot 1 of 1 (com.apple.os.update-9D831579E656FF2E36BAC3334521407031CBA216B7079C5998A817A5EC7C76B7) ...
Check the extent-ref tree ...
Check the Fsroot tree ...
Check the file extent tree ...
Check the object map location of the volume ...
Volume "/dev/rdisk1s1" seems to be ok.
Volume "/dev/rdisk1s2" is checked.
Check the APFS volume superblock ...
Check the object allocation ...
Check the snapshot metadata tree ...
Check the snapshot metadata ...
Check the extent-ref tree ...
Check the document ID tree ...
Check the Fsroot tree ...
error: doc-id tree: record exists for doc-id 3936, file-id 51075282 but no inode references this doc-id
Check the object map location of the volume ...
The volume "/dev/rdisk1s2" is obviously damaged and needs to be repaired.
Volume "/dev/rdisk1s3" is checked.
Check the APFS volume superblock ...
Check the object allocation ...
Check the snapshot metadata tree ...
Check the snapshot metadata ...
Check the extent-ref tree ...
Check the Fsroot tree ...
Check the object map location of the volume ...
Volume "/dev/rdisk1s3" seems to be ok.
Volume "/dev/rdisk1s4" is checked.
Check the APFS volume superblock ...
Check the object allocation ...
Check the snapshot metadata tree ...
Check the snapshot metadata ...
Check the extent-ref tree ...
Check the Fsroot tree ...
Check the object map location of the volume ...
Volume "/dev/rdisk1s4" seems to be ok.
Volume "/dev/rdisk1s5" is checked.
Check the APFS volume superblock ...
Check the object allocation ...
Check the snapshot metadata tree ...
Check the snapshot metadata ...
Check the extent-ref tree ...
Check the Fsroot tree ...
Check the object map location of the volume ...
Volume "/dev/rdisk1s5" seems to be ok.
Volume "/dev/rdisk1s6" is checked.
Check the APFS volume superblock ...
Check the object allocation ...
Check the snapshot metadata tree ...
Check the snapshot metadata ...
Check the extent-ref tree ...
Check the Fsroot tree ...
Check the object map location of the volume ...
The volume "/dev/rdisk1s6" seems to be ok.
Check the mapped space ...
Perform deferred repairs ...
error: doc-id tree record exists for doc-id 3936, but no inode references this doc-id
Moved repairs skipped.
The container "/dev/disk0s2" could not be fully checked.
Exit code for storage system check is 8.
Failed to check or repair the storage system. : (-69716)
Action failed ...
I would greatly appreciate any help recovering the 250 GB.
diskutil addpartition disk0s1 apfs NewAPFS 0
must be wrong. Surely it should bedisk0s2
as the partition to be added is afterdisk0s2
. This is just my reading ofman diskutil
. And, don't do anything without making sure you have a good backup! – Gilby Apr 10 '22 at 22:41