Windows – Missing disk space after failed Bootcamp install

bootcampdisk-utilityhard drivepartitionwindows

Earlier today, while running Bootcamp attempting to install Windows 7 on my late-2012 iMac, I suddenly lost 160g of disk space after Bootcamp failed to create the partition for Windows. Disk Utility reports that the main Fusion Drive is still 1.1tb, but the only visible partition is Macintosh HD, spanning only 950gb instead of the entire disk (minus the hidden recovery partition). Disk Utility also duly notes that there are only 2 partitions, which I assume to be the main harddrive and the recovery partition:

Image
Image

diskutil cs list actually shows what happened to the storage (note the free space, which exactly matches what I specified in Bootcamp):

CoreStorage logical volume groups (1 found)
|
+-- Logical Volume Group 320B77F3-91C2-4221-B24C-D8B91C233D32
    =========================================================
    Name:         Macintosh HD
    Status:       Online
    Size:         1120333864960 B (1.1 TB)
    Free Space:   160000114688 B (160.0 GB)
    |
    +-< Physical Volume CEADFEBA-F128-40BE-A075-EBFD3877CDD6
    |   ----------------------------------------------------
    |   Index:    0
    |   Disk:     disk0s2
    |   Status:   Online
    |   Size:     120988852224 B (121.0 GB)
    |
    +-< Physical Volume 8CECCFC2-E046-499F-B762-B278E2398F75
    |   ----------------------------------------------------
    |   Index:    1
    |   Disk:     disk1s2
    |   Status:   Online
    |   Size:     999345012736 B (999.3 GB)
    |
    +-> Logical Volume Family E52D5439-ED00-4A23-97A7-70BCF34CBF41
        ----------------------------------------------------------
        Encryption Type:         None
        |
        +-> Logical Volume 933B0D1B-9E56-4DB3-8853-013BE1C2C6E4
            ---------------------------------------------------
            Disk:                  disk2
            Status:                Online
            Size (Total):          951826382848 B (951.8 GB)
            Revertible:            No
            LV Name:               Macintosh HD
            Volume Name:           Macintosh HD
            Content Hint:          Apple_HFS
            LVG Type:              Fusion, Sparse    

Trying to run diskutil cs resizeVolume 933B0D1B-9E56-4DB3-8853-013BE1C2C6E4 0g to give Macintosh HD the remaining space did't work out either:

The Core Storage Logical Volume UUID is 933B0D1B-9E56-4DB3-8853-013BE1C2C6E4
Started CoreStorage operation
Error: -69674: The provided Core Storage logical volume has an incorrect size; you should run whole-disk repair

diskutil verifyDisk disk0 ends with the following:

The volume 320B77F3-91C2-4221-B24C-D8B91C233D32 appears to be OK
Storage system check exit code is 0
Incorrect size for volume "Macintosh HD"
Problems were found with the partition map which might prevent booting
Error: -69688: Incorrect size for logical volume

gpt -r show gives the following:

      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6         
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  236306352      2  GPT part - 53746F72-6167-11AA-AA11-00306543ECAC
  236715992     262144      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  236978136          7         
  236978143         32         Sec GPT table
  236978175          1         Sec GPT header

Does anyone have any ideas how I can get this Free Space back, preferably without needing to wipe my harddrive?

Best Answer

You need to reinstall Mac OS X

Backup your system/data.

  1. Boot into Internet Recovery (CMD + R + i)
  2. Open Terminal
  3. Erase your Macintosh HD Volume

    diskutil cs deleteVolume 933B0D1B-9E56-4DB3-8853-013BE1C2C6E4  
    
  4. Erase Macintosh Volume Group

    diskutil cs delete 320B77F3-91C2-4221-B24C-D8B91C233D32
    
  5. Erase SSD this should disk0, verify!

    diskutil eraseDisk jhfs+ SSD disk0
    
  6. Erase HDD this should disk1, verify!

    diskutil eraseDisk jhfs+ HDD disk1
    
  7. Create LV Group (order is critical SSD and HDD in that order, verify!)

    diskutil cs create OSX-MacintoshLVG disk0s2 disk1s2
    
  8. Create Logical Volume

    diskutil cs createVolume <UUID from Step 7> jhfs+ "Macintosh HD" 100%
    
  9. Restore from TM or reinstall Mac OS