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