Unallocated space on disk0 under Mavericks

disk-utilityhard drivepartition

I have the same kind of issue than here :
Create new partition in unallocated space with diskutil

but on disk0 ! I don't know what to do anymore 🙁

So i can't modify anything with gpt.
I had Ubuntu installed on a partition, deleted it with Disk Utility which got stuck during the process, had to force quit. Reboot the mac, and that's when it became weird :

Recovery HD was no more hidden and mounted as a standard partition on my Desktop, 20GB of the former Ubuntu partition vanished !

I tried the functions activated in the Debug Mode of Disk Utility, resetting PRAM, BootCamp tells me "the startup disk cannot be partitioned or restored to a single partition", and nothing different when booting on Recovery HD to use Disk Utility.

Macbook-Pro-de-Ced:~ Ced$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                  Apple_HFS Mac                     478.2 GB   disk0s1
   2:                  Apple_HFS Recovery HD             650.0 MB   disk0s2
Macbook-Pro-de-Ced:~ Ced$ sudo gpt -r show disk0
Password:
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34     409606         
     409640  934013608      1  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  934423248    1269536      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  935692784   41080351         
  976773135         32         Sec GPT table
  976773167          1         Sec GPT header

Error while trying to repair disk :

Error repairing

Screens from Disk Utility :

Disk Utility

I don't even have the grey zone for the unallocated space like on this post : How can I resize a partition with Disk Utility?

Disk Utility partitions

Best Answer

Wasn't exactly feeling like modifying the GPT table via the terminal with all my data on the disk, so I just completely erase the disk after backing up my data and reinstall OS X booting on a USB stick with Mavericks on it :

enter image description here enter image description here

Everything is back to normal :)