1

I have set my MacBook to forget the filevault password after going into standby (not sleep) after a few hours. This works great, but sometimes I don't want to wait that long for the system to go to standby. So is there a way I can force going into standby immediately?

I know the 'pmset sleepnow', so I was hoping there is something like 'pmset standbynow', but I cannot seem to find it.

0

You may try to set standby delay manually:

sudo pmset hibernatemode 3 standbydelay 900

This will setup your system to turn hibernation on, copy RAM to SSD, but NOT to turn power off (this is hibernatemode 3) AFTER 15 minutes (900 seconds). Or set any desired standby delay time.

Alternatively, you may use hibernatemode 25, which will turn hibernation on, copy RAM to SSD, and turn the power off.

Hope this will help.

  • Huh, when was hibernatemode 25 introduced? – JMY1000 May 16 '16 at 16:29
  • Since OS X Lion if I am not mistaken – Denis Rasulev May 16 '16 at 16:31
  • Thanks for the answer, but that is not really what I am looking for. I am using the hibernatemode 3 and am very happy with the powered RAM, since it wakes my MacBook so much faster and I open and close my MacBook often. The standbydelay is set to several hours, but on occasion I would like to enable standy immediately. So I am really looking for a command or something to keep using hibernatemode 3 and a long standbydelay AND be able to immediately enter standby. – MeHim May 16 '16 at 19:48
0

Standby is effectively hibernate mode, one of the several versions of sleep. It's actually possible to set the sleep mode, then call pmset sleepnow.

Let's go over each of the sleep modes:

0 - Old style sleep mode, with RAM powered on while sleeping, safe sleep disabled, and super-fast wake.

1 - Hibernation mode, with RAM contents written to disk, system totally shut down while “sleeping,” and slower wake up, due to reading the contents of RAM off the hard drive. (Deprecated)

3 - The default mode on machines introduced since about fall 2005. RAM is powered on while sleeping, but RAM contents are also written to disk before sleeping. In the event of total power loss, the system enters hibernation mode automatically.

5 - This is the same as mode 1, but it’s for those using secure virtual memory (in System Preferences -> Security). (Deprecated)

7 - This is the same as mode 3, but it’s for those using secure virtual memory.

25 - The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image.

You can get more in depth information from the man page. Please read it, it contains more in depth info.

You're probably after 25. It's quite easy to set your sleep mode.

Just in case, first note down the current sleep mode in case something isn't working later. pmset -g | grep hibernatemode will tell you. Note this down somewhere. You can then set the sleep mode using sudo pmset -a hibernatemode MODE, which in you case would be sudo pmset -a hibernatemode 25.

If you want something that will hibernate without keeping the sleepmode as 25, you can use DeepSleep to hibernate on demand.

  • Currently only three hibernate modes are available: 0, 3 and 25. – Denis Rasulev May 16 '16 at 16:38
  • Alright, made some edits. Hopefully it's up to date now. – JMY1000 May 16 '16 at 16:42
  • Thanks for the answer, but that is not really what I am looking for. I am using the hibernatemode 3 and am very happy with the powered RAM, since it wakes my MacBook so much faster and I open and close my MacBook often. The standbydelay is set to several hours, but on occasion I would like to enable standy immediately. So I am really looking for a command or something to keep using hibernatemode 3 and a long standbydelay AND be able to immediately enter standby. – MeHim May 16 '16 at 19:50
  • @MeHim DeepSleep should be able to do that. – JMY1000 May 16 '16 at 20:24
  • I thought of a (less elegant, but free and flexible) solution by entering the command: – MeHim May 20 '16 at 6:01
0

I thought of a solution by entering the command:

sudo pmset -a hibernatemode 25; pmset sleepnow; sleep 60; sudo pmset -a hibernatemode 3

This sends the laptop straight to standby and restores the old settings on wake. The sleep is there to make sure the system doesn't set the old settings before standy is fully enabled. Maybe you could do with less then 60 seconds.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .