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.

  3. nx33
    March 18, 2015 at 3:11 pm

    But wouldn’t setting “standby” to 0 make “destroyfvkeyonstandby” pointless?

  4. sw
    October 21, 2015 at 3:47 pm

    with those settings, the next morning when I come into my macbook, I have to start it back up, log in 2 times (fv pw and ad pw are the same but does not sso) then I see any open docs are lost and some apps are saying they were not shut down correctly. Any tips on what to look for? Can we destroykey and have hibernate mode set to 3? seems the power off to the ram that 25 does may be playing a part.

  5. Tom
    September 30, 2017 at 4:53 pm

    Hi, I followed your instructions are my air was going to hibernate mode and the filevault keys were destroyed however since updating to high sierra, my mac doesn’t seem to hibernate no matter what I try. Is this something that others are facing in high sierra? Thanks.

  6. Ralph
    October 4, 2017 at 3:58 am

    I am facing this exact problem after upgrading to 10.13

  7. Paul
    October 11, 2017 at 12:35 am

    Same here with 10.13…

  8. Jon
    March 20, 2019 at 11:01 pm

    As others have said, these settings do not work. Not only don’t they work, but on 2018 MBA with T2 chip they cause a kernel panic upon every wake. As others have said, I have to log in twice. The first time is to wake the Mac, but then the Mac crashes due to a “Bridge OS” error, which is the T2 chip’s OS. I’m pretty sure the crash occurs with any settings that include DestroyFVKeyOnStandby = 1. Tremendously frustrating. (Mojave, incidentally.)

  9. Paul S
    December 16, 2019 at 10:57 am

    Do you know if this still applies in Mojave/Catalina?
    Not worried about the FileVault password clearing, not applicable for our scenario. Purely power nap setting.

    Donā€™t want to break something if thereā€™s a subtle difference – I donā€™t have a test MBP, only live VIPs.

  1. No trackbacks yet.

Leave a comment