Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Recover lost HD space

Hey there,


I decided to remove the boot camp partition on my Macbook and attempted to re-install Windows via boot camp again. Unfortunately, I ran into an error during the boot camp process, so I decided to try and repartition the HD again and start over. Only this time I was not able to merge the old partition space back into the Mac's original HD (disk utility said that "You can not remove this volume because the previous volume can not be resized.").


I read some things online of some command prompts to put into terminal and was able to remove the "boot camp" space but now it has disappeared somewhere and I am not sure how to recover it back.


I am using a Macbook Pro Mid 2015 15" 500Gb Storage.


Here are the commands we used to get to the point where I am and the current disk utility list:

MacBook Pro with Retina display, macOS High Sierra (10.13.6)

Posted on Aug 5, 2018 11:14 PM

Reply

Similar questions

6 replies

Aug 5, 2018 11:20 PM in response to Sean da bond

Last login: Sun Aug 5 21:30:14 on ttys000

Sean-2:~ larson90$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.3 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_APFS Container disk2 281.0 GB disk0s2

3: Microsoft Basic Data OSXRESERVED 8.0 GB disk0s3

4: Apple_HFS BOOTCAMP 210.8 GB disk0s4



/dev/disk2 (synthesized):

#: TYPE NAME SIZE IDENTIFIER

0: APFS Container Scheme - +281.0 GB disk2

Physical Store disk0s2

1: APFS Volume Macintosh HD 222.6 GB disk2s1

2: APFS Volume Preboot 21.4 MB disk2s2

3: APFS Volume Recovery 519.0 MB disk2s3

4: APFS Volume VM 1.1 GB disk2s4



Sean-2:~ larson90$ diskutil cs list

No CoreStorage logical volume groups found

Sean-2:~ larson90$ sudo diskutil eraseVolume "Free Space" %noformat% /dev/disk0s4

Password:

Started erase on disk0s4 BOOTCAMP

Unmounting disk

Finished erase on disk0

Sean-2:~ larson90$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.3 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_APFS Container disk2 281.0 GB disk0s2

3: Microsoft Basic Data OSXRESERVED 8.0 GB disk0s3



/dev/disk2 (synthesized):

#: TYPE NAME SIZE IDENTIFIER

0: APFS Container Scheme - +281.0 GB disk2

Physical Store disk0s2

1: APFS Volume Macintosh HD 222.6 GB disk2s1

2: APFS Volume Preboot 21.4 MB disk2s2

3: APFS Volume Recovery 519.0 MB disk2s3

4: APFS Volume VM 1.1 GB disk2s4



Sean-2:~ larson90$ diskutil apfs resizeContainer disk0s2 0

Started APFS operation

Aligning grow delta to 524,288 bytes and targeting a new physical store size of 281,000,521,728 bytes

Determined the maximum size for the targeted physical store of this APFS Container to be 281,000,521,728 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

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 2

Checking snapshot 2 of 2

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 280,999,997,440 to 281,000,521,728 bytes

Modifying partition map

Growing APFS data structures

Finished APFS operation

Sean-2:~ larson90$ diskutil list

/dev/disk0 (internal, physical):

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *500.3 GB disk0

1: EFI EFI 209.7 MB disk0s1

2: Apple_APFS Container disk2 281.0 GB disk0s2

3: Microsoft Basic Data OSXRESERVED 8.0 GB disk0s3



/dev/disk2 (synthesized):

#: TYPE NAME SIZE IDENTIFIER

0: APFS Container Scheme - +281.0 GB disk2

Physical Store disk0s2

1: APFS Volume Macintosh HD 222.6 GB disk2s1

2: APFS Volume Preboot 21.4 MB disk2s2

3: APFS Volume Recovery 519.0 MB disk2s3

4: APFS Volume VM 1.1 GB disk2s4



Sean-2:~ larson90$ diskutil apfs resizeContainer disk0 0

disk0 is neither an APFS Container Reference nor an APFS Physical Store

Sean-2:~ larson90$ diskutil apfs resizeContainer disk2 0

Started APFS operation

Error: -69771: The target disk is too small for this operation

Sean-2:~ larson90$ diskutil apfs resizeContainer disk2s1 0

disk2s1 appears to be an APFS Volume disk; you must supply a Container Reference disk or a Physical Store disk

Sean-2:~ larson90$ diskutil apfs resizeContainer disk0s1 0

disk0s1 is neither an APFS Container Reference nor an APFS Physical Store

Sean-2:~ larson90$ diskutil apfs resizeContainer disk0s2 0



User uploaded file

Aug 6, 2018 9:48 AM in response to Sean da bond

You have converted disk0s4 to Free Space, but the 8GB OSXRESERVED is still left. The APFS Container cannot 'jump' over the 8GB part to get to the Free Space. 😉.


  • Either convert OSXRESERVED (disk0s3) to Free Space and then resize the container, or,
  • Convert OSXRESERVED to HFS+, expand it to absorb the Free Space, reformat it as FAT32 and use BC Assistant to remove it.


The BC Assistant does more than just clean up disk space when you remove Windows.

Aug 6, 2018 10:04 AM in response to Loner T

Thank you for your help!


I am hoping to remove all of the BC partition (including OSXRESERVED) and put it all back with the original Macbook HD space. What commands should I use to convert the disk0s3 to free space and then resize the container? Or can you recommend a site to see all the commands that I can use to do this process?


Thanks again!

Recover lost HD space

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.