Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Disabling sleepimage unsuccessful

Over the past couple months I have repeatedly locked my sleepimage using the steps below, but after almost every reboot it's unlocked and taking up space again.

Yesterday I had a locked swapfile of 8.5 GB, and two other swapfiles of 1 GB each. Today I'm back to a normal, unlocked 8.5 GB sleepimage and one 1 GB swapfile. I'm on a desktop and don't need these space-wasters.

Disable sleep mode:

Type in the Terminal: sudo pmset -a hibernatemode 0


Remove the image:

Type in the Terminal: sudo rm /private/var/vm/sleepimage


Create a 0-byte file:

Type in the Terminal: sudo touch /private/var/vm/sleepimage


Make the file not writable:

Type in the Terminal: sudo chflags uchg /private/var/vm/sleepimage


Run these commands one by one and reboot.

Mac mini, OS X Yosemite (10.10.5), 2.3 GHz quad-core i7 with 16 GB RAM

Posted on Nov 13, 2015 9:59 AM

Reply
Question marked as Best reply

Posted on Nov 20, 2015 11:15 PM

I discovered a new command, so hopefully it will prevent writing to the file.


sudo ln -s /dev/null /var/vm/sleepimage

2 replies

Disabling sleepimage unsuccessful

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.