Imac restarts while prepering to install mac os x after installing new blank ssd
Imac 2010 a1311 2839,
the original 1tb hdd failed, installed new blank 512gb ssd, reseted pram,
got it booted in internet recovery for high sierra, erased, made into correct format,
then went to install the os x when the "cannot connect to the recovery server" error appeared.
tried again, and still same, checked the date, its correct.
tried making a bootable usb with high sierra, booted from usb into recovery, erased ssd again, went to installation, proceeded through, while preparing for installation and "2 minutes remaining" the computer suddenly shut off and restarted, booted itself back to recovery like nothing happened.
tried again, same result.
while it does that i can see it does write some things on the ssd but it always is like a half of the installator package (2,5-3,5gb).
tried making the usb with mountain lion, but i cant get it open on my macbook cause its too recent for that system, and thus failed to make the bootable usb with mountain lion.
tried to recover from time machine, which is going fairly ok,
but then it boots me up into recovery, the system in the time machine was sierra, i try to install the sierra, and same problem with the computer restarting itself suddenly while preparing for installation, with "1 minute remaining" and again booting up like nothing happened to the recovery with again writing some files onto the ssd before restarting.
Cant get it to stop doing that. please someone help me fix that
Earlier Mac models