My main hard drive is not bootable anymore
Hello everyone,
This just happened yesterday. My Mac crashed. Screen went black and it didn't react to anything. I tried restarting, but it wouldn't find a disk to boot from. It did find both of the disks I have in, but neither of them were bootable. I tried fixing them with disk utility. No errors. Couldn't repair permissions from the boot disk as it's not bootable anymore.
I thought, no problem, let's just reinstall Yosemite on top of the old installation. Booted from the recovery partition and that only had Mountain Lion on it! That wouldn't install as it detected that my main disk has a newer version installed. No idea why there wasn't Yosemite or even Mavericks on the recovery partition.
Next I connected a spare disk I had with USB and installed Mountain Lion on it. Booting from that and trying to install Yosemite on my main disk gives me an error telling me I don't have enough space on the main disk for the installation. Everything is still ok in disk utility (apart from not being able to repair permissions), I can access all the files just fine, but the disk is not bootable.
Can I fix this somehow without erasing the disk completely? And also does anyone have any idea what could be causing this? I guess I could erase everything and recover from Time Machine backups, but somehow I do not trust that those are ok either as my problems have been rather weird.
MacBook Pro (15-inch Mid 2012), OS X Yosemite (10.10.4)