Home > FileVault 2, Mac administration, Mac OS X > Power Nap, power management settings and FileVault 2

Power Nap, power management settings and FileVault 2

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.

Screen Shot 2014-02-12 at 12.51.27 PM

Instead, I saw the icons for all of the FileVault 2-enabled accounts on my laptop.

Screen Shot 2014-02-12 at 12.51.17 PM

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:

  1. I put the laptop to sleep
  2. Power Nap would wake up the laptop roughly an hour later
  3. The waking process would be interrupted by the fact that the disk was locked
  4. After a few minutes, the laptop would shut off
  5. 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.

Screen Shot 2014-02-12 at 1.02.41 PM

Screen Shot 2014-02-12 at 1.05.12 PM

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:

Screen Shot 2014-02-12 at 1.36.41 PM

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.

Screen Shot 2014-02-12 at 1.53.59 PM

When I tried to wake it, the laptop was off again, so I re-disabled Power Nap. Since then, no problems have been seen.

Screen Shot 2014-02-12 at 1.02.41 PM

  1. February 16, 2014 at 3:34 pm

    Is it normal for you to have to enter your password again once filevault is decrypted? Is there a way to only have to enter your password once? Just wondering and thanks for the tip!

    • February 16, 2014 at 3:50 pm

      Having to enter your password twice is normal behavior in this case because enabling FileVault 2 also automatically enables the screensaver lock function. This function requires a password after waking from sleep or when returning from the screensaver.

      If you’ve used pmset to enable the automatic removal of your FileVault 2 key from memory when putting the machine to sleep, you will be prompted twice for your account password when you wake the machine. The first password will be to unlock the disk and the second time will be to get past the OS’s screensaver lock.

  2. n1000
    March 18, 2014 at 11:01 am

    Thanks for the post! I had endless discussions on the Apple forum about this. Apple says the culprit is the European energy saving ordinance. Here is the Apple KB article: http://support.apple.com/kb/HT1757

    Actually this results in two issues:
    1. Mac going to hibernation after 4h (as discussed here) and
    2. wakeup on powerchange, meaning when you disconnect the MBP from the power, it will powerup and wait for your FV2 password. I found that annoying when I needed to leave in a rush.

    Both can be deactivated via pmset. The later requires the ‘acwake’ option.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 159 other followers

%d bloggers like this: