safe sleep

You are currently browsing articles tagged safe sleep.

First find your current sleep setting by opening Terminal in OS X and entering this at the prompt:

pmset -g | grep hibernatemode

That should return you something like “hibernatemode 3″. Remember this number, send an email to yourself, write it down on a scratch pad, whatever it takes to remember your default mode. Mode 3 keeps your RAM powered during sleep to allow super fast wake-up, but also writes an image file of all memory onto disk in case power is lost.

To change the hibernate safe sleep setting to not create an image file on the disk, i.e. mode 0 (mode zero, not the letter ‘o’), enter the following in a Terminal window:

sudo pmset -a hibernatemode 0

Enter your password when asked to do so. This prevents Safe Sleep from saving your memory contents to disk, in large part the cause of not being able to wake MacBook’s from sleep.

If you’d like to get back about a gigabyte or more of disk space, delete the memory image file with the following Terminal command:

sudo rm /var/vm/sleepimage

Macworld has a great article with more information about safe sleep and hibernation on MacBooks.

Open the lid and nothing? Tap keys, change brightness, close and re-open lid and your MacBook still in sleep mode?

Solution: Turn off Safe Sleep. Or use Smart Sleep.

If you open your MacBook lid and notice that you can’t wake your MacBook from sleep, it’s because of the Safe Sleep system Apple designed. This system puts all your current memory (your RAM) onto the disk, so that it can power down the RAM, save energy, and keep the current working state of your computer, even if you ran out of battery power, changed batteries, etc.

Problem is, it’s slow. And buggy. Often when waking from sleep by opening the lid, the MacBook will remain in sleep.

My solution to this: don’t use Safe Sleep. Unless you’re constantly working on battery power and hate plugging in, you likely won’t ever notice you’re not using Safe Sleep’s hibernate to disk mode.

Here are some instructions on how to turn off Safe Sleep on a MacBook Pro Leopard or Tiger to avoid wake-up problems.

If you still want to use Safe Sleep with disk caching of RAM, use Smart Sleep by Patrick Stein. This software adds a preference pane to your Mac, allowing you to not use disk hibernation until you reach a low battery level, say 20% remaining battery.

In a follow up to my post about how to dual boot Tiger and Leopard on your Mac, this post is about removing large (unnecessary) files from your hard disk and recovering disk space on your hard drive before attempting to repartition Macintosh drives and dual booting.

Many folks have been noticing that repartitioning disks using Leopard Disk Utility often fails with an error of “no space left on device”, even though there is plenty of space “left on the device”.

A solution that many have found is removing any “large” files from your Tiger partition before attempting Leopard Disk Utility repartitioning. By large files I’m talking single files that are in the range of 1GB+.

Before running off and deleting large files on your hard disk willy nilly, please, make a backup of your Mac hard drive using SuperDuper! (free / donation-ware) or move these large files off to a secondary external hard disk connected via USB or FireWire.  If you find that you actually need these files later, you can always move them back or revert to your complete backup you made to an external drive.

A great program that helps with finding and moving / removing large files on your disk is Disk Inventory X. Disk Inventory X generates a visual file map of your disk like the one displayed here. Disk File Map by Disk Inventory XClick on the large squares and rectangles to inspect the details of the files. The usual suspects that you can get rid of safely include scratch disks such as the Photoshop scratch disk and the Apple safe sleep memory image. This safe sleep / hibernate memory file takes the contents of your physical RAM and copies it to disk (in a single file) so that your Mac can “hibernate” for an indefinite period, with or without power, without losing what you were working on. The downside of this is that it creates a file equal the size of your physical memory. That can be anywhere from 1GB to 4GB for Macbook users.

The skinny on how to get rid of this sleep image file: First find your current sleep setting by entering this in a Terminal window:

pmset -g | grep hibernatemode

That should return you something like “hibernatemode 3″. Remember this number, send an email to yourself, write it down on a scratch pad, whatever it takes to remember your default mode. Mode 3 keeps your RAM powered during sleep to allow super fast wake-up, but also writes an image file of all memory onto disk in case power is lost.

To change the hibernate safe sleep setting to not create an image file on the disk, i.e. mode 0 (mode zero, not the letter ‘o’), enter the following in a Terminal window:

sudo pmset -a hibernatemode 0

Enter your password when asked to do so, then delete the image file with the following Terminal command:

sudo rm /var/vm/sleepimage

Macworld has a great article with more information about safe sleep and hibernation on portable Macs.

The best solution to the “no space left on device” errors while partitioning your Mac hard disk is to continue with finding and deleting 1GB+ files that you can live without or can move off to a temporary external disk. Then get back to repartitioning your Mac hard disk in preparation to setup a dual boot of OS X Tiger and Leopard on your Macbook.