<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HyperBBQ &#187; hacking</title>
	<atom:link href="http://www.hyperbbq.com/index.php/tag/hacking/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hyperbbq.com</link>
	<description>The trials and tribulations of two college guys on a quest to conquer this thing called life</description>
	<lastBuildDate>Sat, 01 Aug 2009 02:04:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Fixing Sleep Mode on Portable Macs</title>
		<link>http://www.hyperbbq.com/index.php/2008/04/26/fixing-sleep-mode-on-portable-macs/</link>
		<comments>http://www.hyperbbq.com/index.php/2008/04/26/fixing-sleep-mode-on-portable-macs/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 11:11:51 +0000</pubDate>
		<dc:creator>Aaron</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://www.hyperbbq.com/?p=101</guid>
		<description><![CDATA[As discussed in the Macworld article Set newer portable Macs&#8217; sleep mode, it is possible to disable the copying of RAM onto disk when you put a MacBook or MacBook Pro to sleep. I&#8217;ve found the recovery from sleep to be more reliable with this feature disabled. Going to sleep also takes much less time. [...]]]></description>
			<content:encoded><![CDATA[<p>As discussed in the Macworld article <a href="http://www.macworld.com/article/53471/2006/10/sleepmode.html" onclick="pageTracker._trackPageview('/outgoing/www.macworld.com/article/53471/2006/10/sleepmode.html?referer=');">Set newer portable Macs&#8217; sleep mode</a>, it is possible to disable the copying of RAM onto disk when you put a MacBook or MacBook Pro to sleep. I&#8217;ve found the recovery from sleep to be more reliable with this feature disabled. Going to sleep also takes much less time.</p>
<p>I&#8217;ve included the relevant portions of the article below for the curious. For the impatient, running the following commands in Terminal will change sleep mode to RAM-only, and remove the memory image file:</p>
<pre>sudo pmset -a hibernatemode 0
sudo rm /var/vm/sleepimage</pre>
<p><span id="more-101"></span></p>
<blockquote><p><strong>Check the current setup</strong></p>
<p>After you launch Terminal, the first step is to determine which sleep mode your Mac is currently using (in case you wish to go back to it). You can both view and change the sleep mode using the Unix program <tt>pmset</tt>. To see your current settings, type 	<tt>pmset -g | grep hibernatemode</tt>.  You should see something like this:</p>
<pre>	$ pmset -g | grep hibernatemode

hibernatemode  3</pre>
<p>Great, so your machine is using mode 	<tt>3</tt>, whatever that might be. Well, thanks to the documentation for the handy 	<a href="http://deepsleep.free.fr/" onclick="pageTracker._trackPageview('/outgoing/deepsleep.free.fr/?referer=');">Deep Sleep</a> Dashboard widget, which puts your machine immediately into hibernation mode (so you don’t have to yank all the power sources to invoke it), we can tell exactly which mode is which:</p>
<div id="articleText">
<li> <tt>0</tt> &#8211; Old style sleep mode, with RAM powered on while sleeping, safe sleep disabled, and super-fast wake.</li>
<li> <tt>1</tt> &#8211; 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.</li>
<li> <tt>3</tt> &#8211; 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.</li>
<li> <tt>5</tt> &#8211; This is the same as mode 	<tt>1</tt>, but it’s for those using secure virtual memory (in System Preferences -&gt; Security).</li>
<li> <tt>7</tt> &#8211; This is the same as mode 	<tt>3</tt>, but it’s for those using secure virtual memory.</li>
<p>Once you see which mode you’re presently using, make a note of it. You could do this in one step, actually, with a command like this:</p>
<pre>sudo pmset -g | grep hibernatemode &gt; ~/Desktop/current_mode.txt</pre>
<p>That will take the output of the 	<tt>pmset</tt> command, strip out everything other than the 	<tt>hibernatemode</tt> value, and then dump the result into a file on your desktop named 	<tt>current_mode.txt</tt>. Save this file for future use.</p>
<p><strong>Note:</strong> I’m being overly cautious here on purpose. The reality is that, unless you’ve messed with this setting before, your Mac will either be in mode <tt>0</tt> (in which case, this tip doesn’t matter, as your Mac is using old-style sleep), or mode 	<tt>3</tt> or 	<tt>7</tt> (the default for machines shipped since last fall). Saving a text file to remember a 	<tt>3</tt> or a 	<tt>7</tt> is really overdoing things, but at least you won’t be able to say you don’t remember which mode your machine was in.</p>
<p><strong>Change the sleep mode setting</strong></p>
<p>To change your sleep mode, you use 	<tt>pmset</tt> again, providing the variable and value you wish to assign. So to return to the old style sleep mode (which is mode 	<tt>0</tt> from the above list), enter this command:</p>
<pre>sudo pmset -a hibernatemode 0</pre>
<p>Press Return, and you’ll be asked for your password. Provide it, and your sleep mode has been changed. If you ever wish to go back to your previous setting, just repeat the above command, but replace <tt>0</tt> with the value from your 	<tt>current_mode.txt</tt> file.</p>
<p>And yes, this means you can also set your machine to always go directly into hibernation mode by running the above command with 	<tt>1</tt> at the end. I find it much simpler, though, to use the Deep Sleep widget linked above—and the widget also returns the 	<tt>hibernatemode</tt> setting to its prior value, which means that you can use the widget for hibernation, and still enter normal sleep mode when you simply close the lid.</p>
<p>Note that restarting is not required for these changes to take effect.</p>
<p><strong>Recover some drive space</strong></p>
<p>If your machine was previously set to mode 	<tt>3</tt> (or 	<tt>7</tt> ) and you’ve reverted to the old style sleep mode, you’ve got one more step to take: recover the drive space used up by the copy of your system’s RAM, which was created the last time you slept the machine prior to making the switch. In Terminal, enter these two commands, pressing Return after each and providing your password when asked:</p>
<blockquote>
<pre>	cd /var/vm

sudo rm sleepimage</pre>
</blockquote>
<p>If you ever return to the new style sleep mode, the 	<tt>sleepimage</tt> file will be automatically recreated when you execute the 	<tt>sudo pmset</tt> command—yes, it creates the file as soon as you execute the command, not the first time you put the machine to sleep.</p>
</div>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.hyperbbq.com/index.php/2008/04/26/fixing-sleep-mode-on-portable-macs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

