A couple of days ago my iMac (Late 2009) stopped turning on. It starts booting and the progress bar under the Apple logo goes to just under halfway before it turns off. Booting into recovery mode and trying to reinstall El Capitan doesn't work because it says the hard disk is locked. I tried running the
chflags 0 and
chmod to unlock it that are suggested around here from both single user mode and the recovery terminal but to no avail.
The files on the hard drive are all still there, so I tried to use
cp to copy some stuff from there to USB disk, but it consistently crashes midway through the copy and goes to the "your computer has had a problem" screen. I've also tried zapping the PRAM.
Running first aid on Disk Utility from recovery mode says "file system verify or repair failed". I also tried booting in verbose mode and noticed it crashes after running
fsck_hfs and fails, which I assume is what disk utility is doing behind the scenes.
Any advice on how to backup and then do a clean install or reinstall from recovery or just fix it would be very appreciated!