Yosemite clean install taking way too long?
Ok, so one day the lights went out while I was working on my iMac and it shut down. The next time I turned it on it wouldn't start, it'd only show the apple logo and the progress bar would get stuck halfway. I tried just about everything but it would not even start in recovery mode, just in single user mode. When I tried repairing using fsck it said the volume was ok. I never new why it wouldn't start, so I decided it was best to install Yosemite again. I managed to backup all my files from single user mode and created a bootable USB with the newest version of Yosemite. I booted from the USB drive and finally got the options to open utility disk and repair or erase the hard drive. I erased the hard drive, checked if it needed repairing and everything was going fine until I tried installing Yosemite. It showed a window saying it was going to copy the necessary files to the hard drive and the restart. In the first attempt two hours passed and the progress bar never filled, not one bit. The next attempt went fine, and restarted. It opened again the installation window and said 17minutes remaining, so I waited, after a few minutes a bit of the progress bar filled a tiny bit then another two hours passed and it filled another bit. Long story short, it took 3 days for it to fill completely. Then it restarted and got stuck again in the apple logo with the progress bar halfway for another day until I turned it off. So it basically ended with the same issue it started. I've tried to install it again but the bar just takes the same amount of time and the log shows a lot of errors, for example:
X /Volumes/Macintosh HD: Missing core services
Keyboard layout identifier -xxxxx has ben replaced with -xxxxxx
Also I made two bootable drives because I thought one might be corrupt or something but it's the same with both...
My iMac is compatible with Yosemite.
Please help!
iMac, iOS 5.1.1, iMovie