iMac shutting down before progress bar finishes
My 2012 27in. iMac running High Sierra 10.13.5 won't turn on anymore. It shows the apple logo and the progress bar but before the progress bar completes the machine shuts down. When I book to recovery mode and use the disk utility it shows the hard drive and the OS X Base System are both enabled but when I go to Reinstall macOS it says the both are locked.
Any info on how to get this machine up and running would be greatly appreciated.
iMac, macOS High Sierra (10.13.5)