After doing diskutil list:

/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         500.3 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            140.0 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

and sudo gpt -r show disk0:

    start       size  index  contents
        0          1         PMBR
        1          1         Pri GPT header
        2          4         Pri GPT table
        6      76800      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
    76806   34169245      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
 34246051     158692      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
 34404743   87733384
122138127          4         Sec GPT table
122138131          1         Sec GPT header

I deleted some partitions I was using for a dual boot with Ubuntu using gdisk, but now Disk Utility nor diskutil will show empty space from deleting the volumes. Although my GUID_partition_scheme shows I have 500 gigs on the disk, the space is just gone and no longer able to be expanded to the "Macintosh HD" partition. I tried rebooting but nothing seems to work. Any ideas?

  • @user3439894 It says, "No CoreStorage logical volume groups found" and Disk Utility wouldn't let me delete them, so its not like I had any other choice.
    – user191609
    Aug 27 '16 at 1:22
  • @Midi, Did you try using diskutil from Terminal vs the Disk Utility app to remove what you deleted with gdisk before resorting to it? Aug 27 '16 at 1:30
  • @user3439894 Yes, I tried both.
    – user191609
    Aug 27 '16 at 1:32
  • @klanomath So any ideas?
    – user191609
    Aug 27 '16 at 1:38
  • @klanomath If you add it to the answers, then I'll select it if you want. Thanks.
    – user191609
    Aug 27 '16 at 1:53

Under these circumstances - only one main volume - the proper command to expand it to its full size is:

diskutil resizeVolume /dev/disk0s2 R

This command will not work if your main volume is part of a CoreStorage Volume Group.

You must log in to answer this question.