I recently purchased a new MacBook Pro Retina for my own use and encrypted it with FileVault 2. As part of setting it up, I ran the following command to ensure that the laptop hibernated (where the contents of the RAM are written to disk) and also have the FileVault 2 key automatically removed from the saved RAM state when I put the laptop to sleep:
sudo pmset -a destroyfvkeyonstandby 1 hibernatemode 25
I then put my laptop to sleep and shortly thereafter went to sleep myself.
The next morning, I went to wake up my laptop. I expected to see my account icon and a password blank at the FileVault 2 login screen, which would indicate that it had been asleep.
Instead, I saw the icons for all of the FileVault 2-enabled accounts on my laptop.
That indicated that my laptop had turned off instead of being asleep. For more details, see below the jump.
I hadn’t had this issue on my previous laptop, which was a 13 inch 2011 MacBook Pro. Then I remembered that my new laptop supported Apple’s new Power Nap technology and the old one had not.
My working theory at that point was that Power Nap woke up my laptop. Because the FileVault 2 key had been removed from memory, the waking process then stopped and waited for the account password to be entered.
In a situation like this, the Mac will shut down within a few minutes as a safety measure. This shutdown happens because the OS isn’t running and there’s no way for the functionality available at the FileVault 2 pre-boot login screen to monitor or control the laptop’s temperature.
That would mean that the sequence of events would go like this:
- I put the laptop to sleep
- Power Nap would wake up the laptop roughly an hour later
- The waking process would be interrupted by the fact that the disk was locked
- After a few minutes, the laptop would shut off
- I go to wake up my laptop at a later time and find that it was powered off
Working with this theory, I went into the Energy Saver settings in System Preferences and disabled the Power Nap settings for both the power adapter and battery.
The Power Nap settings can also be disabled by running the following command in the Terminal:
sudo pmset -a darkwakes 0
Adding -a to the pmset command will disable Power Nap for the Battery, Power Adapter and UPS Energy Saver settings.
Once I’d disabled Power Nap, I thought the problem would be solved. Nothing else should wake it up, right? Then I put my laptop to sleep the next night and tried to wake it the following morning. The laptop was off again, so not fixed.
After doing more research, I ran across this thread in the Apple Discussions forums, where people were discussing how their 2013 Airs and Retinas were waking unexpectedly from sleep and saw this post. In particular, the fact that the problem seemed to stop after pmset‘s standby and standbydelay settings were changed. After verifying the difference between pmset’s autopoweroff and standby settings, I then ran the following commands in Terminal:
sudo pmset -a darkwakes 0
sudo pmset -a standby 0
sudo pmset -a standbydelay 0
I then ran the pmset command again to enable hibernation and and remove the FileVault key from memory:
sudo pmset -a destroyfvkeyonstandby 1 hibernatemode 25
Once I did that, my pmset settings looked like this:
After making those changes to my power management settings, my encrypted laptop started sleeping and waking like I wanted it to.
To verify that Power Nap was still part of the issue, I re-enabled Power Nap in my Power Adapter settings and put my laptop to sleep for two hours.
When I tried to wake it, the laptop was off again, so I re-disabled Power Nap. Since then, no problems have been seen.