Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

salilsurendran

macrumors newbie
Original poster
May 18, 2015
19
0
Hello,

When I close the lid of my Mac and step away for even an hour my Mac goes into hibernate and takes about 90-120 seconds to restart. Firefox and Chrome are killed. I am using Mojave 10.14.6. I tried the following commands to prevent this from happening but to no use.



sudo pmset -a autopoweroff 0

su do pmset -a standby 0



Executing this command shows standy values

pmset -g|grep standby

standbydelayhigh 86400

standby 0

standbydelaylow 10800

highstandbythreshold 50



I have also set System Preferences such that on battery or adapter hard disk never sleeps. Anyway to stop mac from hibernating?
 
Hello,

When I close the lid of my Mac and step away for even an hour my Mac goes into hibernate and takes about 90-120 seconds to restart. Firefox and Chrome are killed. I am using Mojave 10.14.6. I tried the following commands to prevent this from happening but to no use.
sudo pmset -a autopoweroff 0
su do pmset -a standby 0
Executing this command shows standby values
pmset -g|grep standby
standbydelayhigh 86400
standby 0
standbydelaylow 10800
highstandbythreshold 50

I have also set System Preferences such that on battery or adapter hard disk never sleeps. Anyway to stop mac from hibernating?
You are using the wrong command. :)
You now have hibernatemode = 3 (confirm that with pmset -g)
To get rid of hybernation: sudo pmset -a hibernatemode 0
You didn't say what Mac you are using: There's a known hibernation issue with the 2013-2014 MacBook Air and Pro models. The best-known solution is to run:
sudo pmset -a hibernatemode 0 standby 0 autopoweroff 0 🌈
Optional:
delete the now unnecessary sleep file to regain disk space equal to memory,
You can use the Go to folder menu to delete the file, found in the /var/vm/ folder, and named sleepimage. Reboot and simply delete that file. Or use this:
sudo rm /var/vm/sleepimage or sudo rm /private/var/vm/sleepimage
The sleep image file is actually in /private/var/vm/ but /var/vm/ is a symbolic link to that location.
Optional: Create a blanked zero-byte file so the OS cannot rewrite the file:
sudo touch /private/var/vm/sleepimage
Make file immutable:
sudo chflags uchg /private/var/vm/sleepimage
If pmset -g shows: autopoweroff 1,
disable this automatic hibernation mode (happens even if hibernation mode is set to 0 on the Mac mini 2012 and iMac)
sudo pmset -a autopoweroffdelay 86400
sudo pmset -a autopoweroff 0
when any late model Mac is connected to AC power, it goes into a deeper "safe sleep" mode after 4 hours if there's no activity from wireless/Ethernet/USB devices. It's waking up from safe sleep that's causing issues with Thunderbolt. You can disable safe sleep by bringing up Terminal and entering the two commands shown above:
Also, set the safe sleep timer (standbydelay) to 20 hours, default is 4200 (1.67 hr)
sudo pmset -a standbydelay 72000

After you run these commands, run pmset -g again, reboot and see if your problem has been solved. I expect it will be! All of these commands were found here on this forum. I claim no kudos for any of them, nor did I originate them in any way. I have tried them several times on a late 2011 MBP, a 2009 Mac Pro, and a late 2012 iMac, with no problems at all.:cool:
 
Last edited:
You are using the wrong command. :)
You now have hibernatemode = 3 (confirm that with pmset -g)
To get rid of hybernation: sudo pmset -a hibernatemode 0
You didn't say what Mac you are using: There's a known hibernation issue with the 2013-2014 MacBook Air and Pro models. The best-known solution is to run:
sudo pmset -a hibernatemode 0 standby 0 autopoweroff 0 🌈
Optional:
delete the now unnecessary sleep file to regain disk space equal to memory,
You can use the Go to folder menu to delete the file, found in the /var/vm/ folder, and named sleepimage. Reboot and simply delete that file. Or use this:
sudo rm /var/vm/sleepimage or sudo rm /private/var/vm/sleepimage
The sleep image file is actually in /private/var/vm/ but /var/vm/ is a symbolic link to that location.
Optional: Create a blanked zero-byte file so the OS cannot rewrite the file:
sudo touch /private/var/vm/sleepimage
Make file immutable:
sudo chflags uchg /private/var/vm/sleepimage
If pmset -g shows: autopoweroff 1,
disable this automatic hibernation mode (happens even if hibernation mode is set to 0 on the Mac mini 2012 and iMac)
sudo pmset -a autopoweroffdelay 86400
sudo pmset -a autopoweroff 0
when any late model Mac is connected to AC power, it goes into a deeper "safe sleep" mode after 4 hours if there's no activity from wireless/Ethernet/USB devices. It's waking up from safe sleep that's causing issues with Thunderbolt. You can disable safe sleep by bringing up Terminal and entering the two commands shown above:
Also, set the safe sleep timer (standbydelay) to 20 hours, default is 4200 (1.67 hr)
sudo pmset -a standbydelay 72000

After you run these commands, run pmset -g again, reboot and see if your problem has been solved. I expect it will be! All of these commands were found here on this forum. I claim no kudos for any of them, nor did I originate them in any way. I have tried them several times on a late 2011 MBP, a 2009 Mac Pro, and a late 2012 iMac, with no problems at all.:cool:
I did this but it is still not working. I didn't create an immutable sleepimage file. Here is my pmset -g output

> pmset -g


System-wide power settings:


DestroyFVKeyOnStandby 0


Currently in use:


lidwake 1


autopoweroff 0


standbydelayhigh 86400


autopoweroffdelay 28800


proximitywake 0


standby 0


standbydelaylow 10800


ttyskeepawake 1


hibernatemode 0


powernap 0


gpuswitch 2


hibernatefile /var/vm/sleepimage


highstandbythreshold 50


displaysleep 2


sleep 1


acwake 0


halfdim 1


tcpkeepalive 1


disksleep 0
 
Try this (may already have been posted)
A 4-step process:

1. Turn hibernation off:
sudo pmset -a hibernatemode 0

2. Remove the existing sleep image:
sudo rm /Private/var/vm/sleepimage

3. Create a new, empty sleep image:
sudo touch /Private/var/vm/sleepimage

4. Lock the new sleep image (so it can't grow in size):
sudo chflags uchg /Private/var/vm/sleepimage
 
there is no sleepimage file in either /var/vm/ or private/var/vm/. I can't create any such file either:


sudo touch /private/var/vm/sleepimage
touch: /private/var/vm/sleepimage: Operation not permitted

Same with :

sudo touch /var/vm/sleepimage
touch: /var/vm/sleepimage: Operation not permitted
 
You are using the wrong command. :)
You now have hibernatemode = 3 (confirm that with pmset -g)
To get rid of hybernation: sudo pmset -a hibernatemode 0
You didn't say what Mac you are using: There's a known hibernation issue with the 2013-2014 MacBook Air and Pro models. The best-known solution is to run:
sudo pmset -a hibernatemode 0 standby 0 autopoweroff 0 🌈
Optional:
delete the now unnecessary sleep file to regain disk space equal to memory,
You can use the Go to folder menu to delete the file, found in the /var/vm/ folder, and named sleepimage. Reboot and simply delete that file. Or use this:
sudo rm /var/vm/sleepimage or sudo rm /private/var/vm/sleepimage
The sleep image file is actually in /private/var/vm/ but /var/vm/ is a symbolic link to that location.
Optional: Create a blanked zero-byte file so the OS cannot rewrite the file:
sudo touch /private/var/vm/sleepimage
Make file immutable:
sudo chflags uchg /private/var/vm/sleepimage
If pmset -g shows: autopoweroff 1,
disable this automatic hibernation mode (happens even if hibernation mode is set to 0 on the Mac mini 2012 and iMac)
sudo pmset -a autopoweroffdelay 86400
sudo pmset -a autopoweroff 0
when any late model Mac is connected to AC power, it goes into a deeper "safe sleep" mode after 4 hours if there's no activity from wireless/Ethernet/USB devices. It's waking up from safe sleep that's causing issues with Thunderbolt. You can disable safe sleep by bringing up Terminal and entering the two commands shown above:
Also, set the safe sleep timer (standbydelay) to 20 hours, default is 4200 (1.67 hr)
sudo pmset -a standbydelay 72000

After you run these commands, run pmset -g again, reboot and see if your problem has been solved. I expect it will be! All of these commands were found here on this forum. I claim no kudos for any of them, nor did I originate them in any way. I have tried them several times on a late 2011 MBP, a 2009 Mac Pro, and a late 2012 iMac, with no problems at all.:cool:
Hey guy! I'm using a MBP 16 within clamshell mode, also plugged with a thunderbolt 3 dock named Caldigit ts3+. It is pretty normal when I disconnect the MBP with the dock during sleeping, no deeper sleep, or say hibernation or safe sleep. However, if I connect it with the dock, it must enter deep sleep within 1 hours or less and I have to open the lid to push the power button to boot it up. I have check the arguments of pmset, which seems normal and it should be impossible to happen that annoying stuff. Do u have any idea about that? Thx!!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.