Today I found my Mac shut down. It won't boot again anymore. When I try to turn it on, it just shows the Apple logo, a loading bar and after 1/3 progress it just shuts down again.
After some research I learned how to access the Disk Utility by pressing Command ⌘-R at boot time. Apparently the problem is with the hard disk, since when I try to repair it it says that it can't be repaired and needs to be formatted.
I have an external disk where I backed up the whole system using Time Machine. I'm just not sure how to proceed now.
After accessing the Disk Utility I have 4 options, the first of which is restoring a Time Machine backup. The thing is that if I try this one it lets me restore a backup only in the other partition of the external HD, and not on the disk on my Mac. Why is that? What shall I do?