Deleted Bootcamp partition but cannot recover disk space

Discussion in 'macOS Mojave (10.14)' started by Mark Carter, Dec 14, 2018.

  1. Mark Carter, Dec 14, 2018
    Last edited: Dec 14, 2018

    Mark Carter macrumors newbie

    Joined:
    Dec 11, 2015
    Location:
    UK
    #1
    Due to my Windows 10 bootcamp partition crashing I wanted to reinstall it. However Bootcamp Assistant wasn't able to remove the old the partition and neither could disk utility so I managed to use Terminal to remove it. However, I'm not able to recover the 125GB I had used for bootcamp. Please see below - looks like the APFS container needs to be resized to recover the full physical 500GB?

    I'm running 10.14.2 on a 17,1 iMac. I'm no Terminal expert so any help much appreciated.

    Mark


    Last login: Sat Dec 15 00:09:09 on ttys000

    iMac-2:~ markpcarter$ 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 disk1 500.1 GB disk0s2


    /dev/disk1 (synthesized):

    #: TYPE NAME SIZE IDENTIFIER

    0: APFS Container Scheme - +366.0 GB disk1

    Physical Store disk0s2

    1: APFS Volume Macintosh HD 304.5 GB disk1s1

    2: APFS Volume Preboot 42.9 MB disk1s2

    3: APFS Volume Recovery 517.0 MB disk1s3

    4: APFS Volume VM 20.5 KB disk1s4
     
  2. BLUEDOG314 macrumors 6502

    BLUEDOG314

    Joined:
    Dec 12, 2015
    #2
    I've solved this issue in the past with "diskutil mergepartitions" in terminal. Can you post a screenshot of the terminal window for "diskutil list"? I know it will be very similar (the same likely) to what you posted, but usually there is some kind of free space or unidentified area which I'm not seeing.
     
  3. Mark Carter thread starter macrumors newbie

    Joined:
    Dec 11, 2015
    Location:
    UK
  4. BionicMan Suspended

    Joined:
    Dec 14, 2018
  5. BLUEDOG314 macrumors 6502

    BLUEDOG314

    Joined:
    Dec 12, 2015
    #5
    In this case I believe you want "diskutil apfs resizecontainer" used on the device disk1. If you just type "diskutil apfs resizecontainer" into terminal with nothing else, you'll get an explanation of how to use it.
     
  6. Mark Carter thread starter macrumors newbie

    Joined:
    Dec 11, 2015
    Location:
    UK
    #6
    I've tried this on on disk1 with the size zero (to grow to fit) and with size 500g and neither work unfortunately - see terminal screenshot:

    Screenshot 2018-12-15 at 01.34.35.png

    What am I missing?
    --- Post Merged, Dec 14, 2018 ---
    Thanks BionicMan for this - I've tried to copy this for my situation but doesn't seem to work / think my issue is slightly different as my Diskutil list output is different?
     
  7. Fishrrman, Dec 15, 2018
    Last edited: Dec 15, 2018

    Fishrrman macrumors Pentium

    Fishrrman

    Joined:
    Feb 20, 2009
    #7
    OP:

    If you reach a point where nothing seems to work, use my "Fishrrman's nuke 'em back to zero solution".

    1. You'll need an external drive.
    2. You'll also need either CarbonCopyCloner or SuperDuper
    CCC and SD are FREE to download and use for 30 days (won't cost anything)
    3. Erase the external drive to the same format as the internal (APFS or HFS+)
    4. Use CCC (or SD) to clone the contents of your Mac partition to the external drive
    5. Now, BOOT UP from the external cloned backup
    6. Open Disk Utility and ERASE the internal drive. Nuke it back to nuthin'. If you were previously using APFS, erase it back to APFS.
    7. Now that the internal drive is "empty", open CCC (or SD)
    8. RE-CLONE the contents of your cloned backup BACK TO the internal drive.
    9. When done, power down, disconnect external.
    10. REBOOT and HOLD DOWN THE OPTION KEY and KEEP HOLDING IT DOWN until the startup manager appears
    11. Select the internal drive with the pointer and hit return.
    12. Do you get a good boot?
    13. If so, go to the Startup Disk preference pane and RE-designate the internal drive to be the boot drive.

    This should do it.
     
  8. BLUEDOG314 macrumors 6502

    BLUEDOG314

    Joined:
    Dec 12, 2015
    #8
    Other thing you can do is make an image of the current APFS partition with hdiutil and put it on an external drive, then nuke the internal drive and pave with a single APFS container that spans the drive, then restore the container you backed up and it will span the whole drive.
     
  9. Mark Carter thread starter macrumors newbie

    Joined:
    Dec 11, 2015
    Location:
    UK
    #9
    Fisherrman / Bluedog314 thanks for ideas. I've been trying some other solutions but seems like a full erase and restore is going to be the way forward.

    Fisherman - rather than using Carbon Copy Cloner would erasing the HD from internet recover and then using my Time Machine back up effectively be the same?
     
  10. Fishrrman macrumors Pentium

    Fishrrman

    Joined:
    Feb 20, 2009
    #10
    "Fisherman - rather than using Carbon Copy Cloner would erasing the HD from internet recover and then using my Time Machine back up effectively be the same?"

    NO !!!
    You want a BOOTABLE cloned backup, because then it's child's play to
    - boot from the backup
    - erase the internal drive
    - RE-clone BACK TO the internal.
     

Share This Page