I toyed around with Linux, and after discovering that the offical Linux NVidia drivers doesn't have EFI support which makes it impossible to make it work optimally on my system (bummer), I wanted to remove it.
I deleted the partitions with Disk Utility, except the swap partition which I deleted with GParted.
My disk looks like this now in Disk Utility:
Now when I try to extend the Macintosh HD partition to fill the entire disk and click Apply, it gets stuck at checking the catalog file and gives me an error.
Translation (I don't know what it's exactly like in the English version of OSX): Partitioning failed - The partitioning failed with the error: The partition-layout cannot be changed, because the file system could not be checked.
When I try it with GParted, I can't move the handles for some reason.
How can I make Macintosh HD fill the entire disk again, other than formatting the disk and restoring a Time Machine backup?
EDIT: When I click the button to check the disk for errors it says there's nothing wrong.