I manually click Sleep but the iMac immediately reboots instead of going to sleep
I'm having two related issues, as follow.. .. these happen about 40% of the time
- I manually click Sleep (Apple menu, Sleep) and it appears to be going to sleep but as soon as it would appear to have gone to sleep, meaning the screen goes dark, the hard drive stops, all of a sudden you hear the start up chime and its in the rebooting process and brings me to the log in screen
- I set Energy Saver to put the iMac to sleep in 10 minutes and when that time is up, it does the same thing as in #1 above.
This happened out of the blue a few weeks ago, I'm still trying to find the root cause but this is what I have done so far.. ..
- Climbed through logs to no avail
- Performed an SMC and NVRAM reset. That did not solve it.
- Performed a Disk Utility First Aid on the hard drive, it found issues that it could not repair and stated a File System exit code of 8. File system verify or repair failed
- Then I noticed my Western Digital firewire backup drive that is attached to my iMac was also flaky, all of a sudden it became read only and Time Machine could not back up to it. It would randomly disappear from Finder and then it would reappear. When it was in Finder, I had no issue navigating it and seeing all the backups
- I then rebooted in Internet Recovery Mode and did a hardware test which stated a 4HDD/11/40000004: SATA(0,0) error. That was the only error and I did the loooong extended test.
- Upon restarting the iMac using its internal hard drive, it never finished the boot cycle and instead would display a list of DOS like stuff on the screen, very quickly, and then try to reboot again and it did this over and over and over so I thought the hard drive finally bit the dust, maybe the loooong extended test killed it :-0
- I then installed El Capitan on a thumb drive using my laptop and booted the iMac from that using the Option key to select a different start up drive and it worked well so I thought the iMac was ok but maybe the hard drive was suspect once again
- Since I could read the backup drive, I took a chance and erased the iMac's hard drive and reinstalled the OS (El Capitan 10.11.6). That went well
- I then told the iMac to use the backup drive to finish the recovery and that went well and I was back up and running.
- I then erased the backup drive and did a full "first time" backup which also went well and it was read/write again instead of read only.
At this point I was back up and running and putting the iMac to sleep successfully until about the 4th or 5th time when it rebooted instead of going to sleep so the issue remains. At this point I .. .
- Ran Disk Utility on both the internal hard drive and the backup drive and both passed
- I have not yet run another hardware test from Apples internet recovery server but do plan to while this request for help percolates. When running that hardware test before, the only thing it found was that hard drive error I listed above. I ran both the short and long tests.
In Summary: 2011 27" iMac running El Capitan. All works well except for it rebooting instead of sleeping about 40% of the time. To be clear, it reboots instead of sleeps at the moment it tried going to sleep, not at some point after it sleeps. Once asleep, it does not wake up unless I wake it via the space bar and when it does wake up, it wakes up fine.
I uploaded a few of the screenshots as taken from my phone. Any ideas as to the root cause and corrective action would be very appreciated.
iMac 27″, OS X 10.11