Jump to content

How to Faster Sleep, and Get back Some Storage Space


Cristian
 Share

10 posts in this topic

Recommended Posts

Hey guys, I finally got a near perfect install...just need to take care of restart and shutdown issue...

 

Any ways, I got sleep to work, and I was happy. Then I noticed that I was missing a large chunk of my hard drive space, so I used Grand Perspective to see what large files I had.

 

Turns out that there is a large file called sleepimage, So i googled what this was an I found a little hack that lets me have a faster sleep, and makes it so this file doesn't appear any more. Turns out that it was not really sleeping but actually hibernating. So here is the fix that I got of another site.

 

$ sudo pmset -a hibernatemode 0

$ sudo nvram "use-nvramrc?"=false

 

Hope it works for u guys.

 

If not, I guess someone could create a script that removes this file at boot every time...

Link to comment
Share on other sites

You are wrong.

 

By default Mac OS does not hibernate but use safe sleep, what does this means? Mac OS saves the contents of your physical memory in a file called sleepimage and then puts the system to sleep, when you wake up the memory is intact because sleep maintains current to the memory, but what happens if the power source fail in desktops or battery runs out in laptops there is a fail safe method sot sleepimage is used in order to recover the memory contains.

 

But there is a big "but", on hackintoshes the safe sleep does not work because the method of boot, so make sleep to "simple sleep" is a way to gain some disk space, but the sleepimage does not occupy a very large space just the same exact amoutn of your physical memry, so if you have 16GB of memory and you don't use safe sleep get rid of the file.

 

Even if you force to hibernate this does not work on hacintoshes, they will sleep and never cut the power.

How you force it:

$ sudo pmset -a hibernatemode 1

 

hibernatemode values from Macworld's article:

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.

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).

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

 

Also I think that the second command does not take any efect on Hackintoshes because they don't have the same firmware as real Macs.

see the contents of a hackintosh and a real Mac:

Hackintosh
# nvram -p
platform-uuid	%10%80%1cB
SystemAudioVolume	@
dvd-fix

Mac Pro
$ nvram -p
SystemAudioVolume	@
efi-boot-device-data	%02%01%0c%d0A%03%0a%01%01%06%02%1f%03%12%0a%04%01*%02(@%06 %19%12%1ds%9fT%e4@w%acK%a0%ac%99%e2M%f1%9e7%02%02%7f%ff%04
prev-lang:kbd	es:8
platform-uuid	%10%80%17%f2%0e%bb%a4
boot-image	%02%01%0c%d0A%03%0a%01%01%06%02%1f%03%12%0a%04%01*%02(@%06 %19%12%1ds%9fT%e4@w%acK%a0%ac%99%e2M%f1%9e7%02%02%04%04%1a1cc2730000%7f%ff%04
efi-boot-device<array><dict><key>IOMatch</key><dict><key>IOProviderClass</key>
<string>IOMedia</string><key>IOPropertyMatch</key><dict>
<key>UUID</key><string>E4549F73-7740-4BAC-A0AC-99E24DF19E37</string></dict></dict>
<key>BLLastBSDName</key><string>disk0s2</string></dict></array>

 

EDIT:

Even worst that I thought, it gives an error with the second command:

$ sudo nvram "use-nvramrc?"=true
nvram: Error (-1) setting variable - 'use-nvramrc?'

Link to comment
Share on other sites

Even if you force to hibernate this does not work on hacintoshes, they will sleep and never cut the power.

 

So, I'm far away from an expert - but when I send my hackintosh to sleep, it takes some seconds and the whole machine is off. No fans running, no leds lighted, the complete systems seems off. Although I set waking by events on in all cases, the only way to wake the machine is pressing the power button.

 

I will try disconnecting the power chord while in sleep later on ... I will post the result of it.

Link to comment
Share on other sites

What part of "hibernate wont work on hackintoshes" is not clear?

 

anyway the command is "sudo pmset -a hibernatemode 1"

 

On real Macs the screen will dimmed and appear a bar indicator like this:

002.jpg

Link to comment
Share on other sites

your conceptions are fine, hybernate means shutdown everyting so no power are send to components, you can even disconnect the computer from the poweer outlet and connect it later, but this only works on real Macs.

 

sleep is like windows stand-by, minimal power to some components, like memory (to maintain the data and state of the OS), if you unplug the power or battery you loose the contnets of the memory and when you rconnect you got a nrmal boot process.

Link to comment
Share on other sites

  • 2 weeks later...
your conceptions are fine, hybernate means shutdown everyting so no power are send to components, you can even disconnect the computer from the poweer outlet and connect it later, but this only works on real Macs.

 

I spoke with many people who have S3 sleep mode working in no real Macs , in Hack OS X.

Link to comment
Share on other sites

 Share

×
×
  • Create New...