How to Safe Sleep (Hibernate) Your Mac

Hibernation and Sleep

Mac users have become quite familiar with using Sleep mode. In Sleep mode, Macs go into a very low-power mode, while saving the current session for later use. Putting a Mac to sleep will continue to power RAM in sleep mode, so that whatever was in RAM when the computer went to sleep will still be there when the computer wakes. Sleep mode is almost instantaneous, consumes very low power, and as a PowerBook owner its indispensable to me. Still though, it requires a power-source (however low) and there are times when laptop batteries are completely depleted or a user wants to completely power-off their Mac.

Similar to Sleep, Windows “Hibernates,” while Linux “Software Suspends”. They are not as fast as Sleep mode, but they take it a step further by not using any power. When Hibernating, a PC quickly saves the current session to the hard drive, shuts-down, and completely powers-off the computer. Upon powering-on, the user is quickly returns to the previous session.

Safe Sleep

Up until recently, Mac users didn’t have a similar Sleep mode which required no power. When Apple announced new PowerBooks in October 2005, it also introduced Safe Sleep to Mac OS X, an extention to Sleep mode that allows for hibernation without power.

According to an Apple article:

Safe Sleep ensures that data stored in main memory will not be lost should the system shut down due to a loss of power during sleep mode. Prior to your system entering sleep, Safe Sleep automatically saves the contents of main memory […] to the hard drive. In the event the battery becomes completely depleted while the system is asleep, the computer will shut down. But when a power adapter is connected or a freshly charged battery is installed, the PowerBook can be restarted and it will automatically return to the desktop state that existed prior to entering sleep.

When restarting a PowerBook from Safe Sleep, a progress bar indicates that the PowerBook is waking from Safe Sleep. The screen is also in gray-scale and slightly blured. It is impossible to get an actual screen-shot of this, so I’ve created the following renderings:

Screen-rendering of a Mac waking from Safe Sleep.
Grayscale desktop indicating waking from Safe Sleep

Screen-rendering of a Mac waking from Safe Sleep
Progress bar indicating waking from Safe Sleep.

How to Enable Safe Sleep

Safe Sleep is so-far only officially available on the new PowerBooks. But Safe Sleep is very much software based , not hardware based. With Apple’s release of Mac OS 10.4.3, Safe Sleep can be enabled on many Macs thanks to an excellent hack. To enable Safe Sleep you must be running Mac OS X Tiger, and be up-to-date to with version 10.4.3 (or above).

Reportedly working laptops include (but not necessarily limited to) iBook G4s, Aluminum PowerBook G4s. You may also try Safe Sleep on desktops. For a much more technical look into enabling it, visit the source information on the hack.

Warning: Enabling Safe Sleep is essentially a hack. It is very likely to work on recent Macs, but enabling Safe Sleep may not work as intended or wake your Mac properly. Print out this article before continuing, so that you can discard Safe Sleep and undo changes if needed.

1. Apply Safe Sleep Property

To summarize, new PowerBooks have the “has-safe-sleep” property. To apply this property to your Mac, something needs to be run in Open Firmware at boot. In the Terminal enter the folling, hitting return at the end of each line:

sudo nvram nvramrc='" /" select-dev
" msh" encode-string " has-safe-sleep" property
unselect
'
sudo nvram "use-nvramrc?"=true

In a Terminal shell it should look as follow:

Last login: Fri Nov 11 11:11:11 on ttyp1
Welcome to Darwin!
computer:~ User$ sudo nvram nvramrc='" /" select-dev
> " msh" encode-string " has-safe-sleep" property
> unselect
> '
computer:~ User$ sudo nvram "use-nvramrc?"=true

The Mac must be restarted to set the changes.

2. Allow Hibernate Mode

To continue, you must have at least as much free disk space as physical memory , plus 750MB. To enable Sleep Safe, in the Terminal enter:

sudo pmset -a hibernatemode 3

This should create the file /var/vm/sleepimage.

If (and only if) you have secure virtual memory enabled, enter 7 (rather than 3) to disable encrypted hibernation. Encrypted Safe Sleep does not yet work.

When your Mac is set to sleep, it will now enter regular Sleep mode first (consuming minimal power). It will only enter Safe-Sleep if the battery is very low on power, or is unpluged. If you prefer to skip regular sleep, and use Safe Sleep mode instead (note: it takes a few seconds more to sleep and wake-up) enter:

sudo pmset -a hibernatemode 1

Enter 5 (rather than 1) with secure virtual memory.

To disable Safe Sleep:

sudo pmset -a hibernatemode 0

The Mac does not need to be restarted to set the changes to hibernate mode.

What is secure virtual memory?
Secure virtual memory is a software feature that encrypts your swap-files and sleep-image. The option is found in the Security pane in System Preferences. It is not enabled by default, and is does not need to be enabled to use Safe Sleep. In-fact, encrypted Safe Sleep appears to not yet work.

3. Verify Sleeping

Put the Mac to sleep and wait for the light to start pulsing. Wait a few more seconds. Wake it normally (by hitting the space bar for example).

Open Console and view system.log, or simply open the file /var/log/system.log. Look for a line indicating that the process worked. It is similar to:

Nov 11 12:15:33 computername kernel[0]: System SafeSleep

4. Verify Safe Sleep

Now attempt to actually Safe Sleep for real. Put the Mac to Sleep, and wait for the light to start pulsing. Remove the power-source plug and the battery. Wait for the light to stop pulsing and turn off, which may take a a couple of minutes. Your Mac should now be in Safe Sleep mode. Plug the power back in and add the battery. Start-up. It should show the previous saved desktop (blurred and in grayscale) along with a progress bar as pictured above. The system should be back to the way you left it.

Safety: To be safe, don’t use FireWire target disk mode on a Mac that is in Safe Sleep/hibernation, since you may end up with filesystem corruption.

Troubleshooting

You may have problems with a bad hibernate images, which may repeatedly kernel panic. Try restarting which will start the image again. It may work. It may not, and repeatedly fail. This can happen if you don’t set “hibernatemode” properly when using secure virtual memory. If a bad hibernate image keeps booting then crashing reboot the mac holding down Command-Option-O-F to get in to Open Firmware. Type:

setenv boot-image

Hit return, then enter:

boot

Disable Safe Sleep

To disable Safe Sleep enter in the Terminal:

sudo pmset -a hibernatemode 0

No need to restart.

For a more full undo, disable all nvramrc variables:

sudo nvram "use-nvramrc?"=false

Enter password, then restart.

Conclusion

Safe sleep isn’t perfect yet for all users. Safe Sleep should really only serve as a backup to regular Sleep, for times when the laptop battery is depleted or you need to unplug and move your desktop.

You should not use Safe Sleep as a replacement to regular Sleep. Regular Sleep is much faster, and uses very little power.It take about 15 seconds to enter Safe Sleep, and about 40 seconds to wake-up from it. That is much longer than the 2 seconds it takes for regular Sleep and wake-up.

Safe Sleep seems very promising though and it will be interesting to see if Apple officially supports it with older laptops.

[Updated on Nov 14, 2005 with wording changes and info on secure virtual ram.] [Updated on Nov 15, 2005 with warning on using target disk mode.]

How To Install Apple’s Front Row

How To Save iTunes TV Show Previews

You can leave a comment, but trackbacks are currently closed.

306 responses to "How to Safe Sleep (Hibernate) Your Mac"   RSS

Subscrie to comments feed: RSS
  1. 1 Balazs

    Awesome, got it working for my mac mini. This is good when I need to move it from one room to the other or if I’m cleaning my desk. Saves me having to restart everything. Cool.

  2. 2 the mini Blog

    Put your Mac to Safe Sleep (Hibernate) at the mini Blog

  3. 3 tester

    Hmm, did not work for me (G5 Dual 2,5 watercooled)…

  4. 4 Andrew

    “tester,”

    Are you running 10.4.3? Did you reboot after step 1? Did you check system.log/Console?

    Try “sudo pmset -a hibernatemode 1″ to have your Mac go directly into Safe Sleep, to verify more quickly if its working.

    Others,
    Please comment on your successes or failures.

  5. 5 Travis

    Doesn’t seem to work on my old G3 Blue and White, probably and most likely because its running OS X Server.

    [Andrew writes: likely because its not a recent Mac by many years.]

  6. 6 magicite

    Works fine on my PowerBook 15″ 1.67GHz machine (January 2005 edition)

  7. 7 Jesse

    Got it, cool hack. PowerBook G4, generation previous to the October bumps.

  8. 8 tester

    Thanks Andrew,

    I am running 10.4.3 (it is a fresh setup straight from 10.4 to 10.4.3).

    I tried it three times. With reboots.
    Now I tried ahtw you suggested to go directly in safe sleep. Hmm, no way.

    I am checking console right now:
    Nov 12 20:51:48 Rob-G5 sudo: rob : TTY=ttyp1 ; PWD=/Users/rob ; USER=root ; COMMAND=/usr/bin/pmset -a hibernatemode 0
    Nov 12 20:52:42 Rob-G5 sudo: rob : TTY=ttyp1 ; PWD=/Users/rob ; USER=root ; COMMAND=/usr/sbin/nvram nvramrc=” /” select-dev
    ” msh” encode-string ” has-safe-sleep” property
    unselect

    Any idea?
    thanks

    [Andrew writes: Well you should apply “hack” then sleep normally then look for in the Consold: “Nov 11 12:15:33 computername kernel[0]: System SafeSleep”]

  9. 9 Tyler

    Got it working on my iBook G4 1.33 ghz. Thanks!

  10. 10 m1ss1ontomars2k4

    worked on my ibook g4

    except it said this:

    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.
    

    Password:

    lol…it said this right after the
    > ‘
    step.

    [Andrew writes: lol, it usually does that anytime you invoke “sudo”]

  11. 11 John Wells

    Can’t seem to get it working with my rev B iMac G5 - I have 10.4.3, and I’ve tried the entire procedure 3 or 4 times. What’s wrong?

    [Andrew writes: Hmm -odd. Its a recent Mac but a no go.maybe desktops are less likely to work.]

  12. 12 Andrew L.

    Yaaay! Worked like a charm on my iBook G4. Thanks for the info, Andrew.

  13. 13 Brannigan

    Worked great! Thanks.

  14. 14 selcouth

    Worked on my Rev A 12″ 867 PowerBook G4. Nice feature! Though the 12″ doesn’t have a backup battery (you can’t swap batteries while it’s sleeping) so this is a win in that area because you can force safe sleep and switch batteries when needed.

  15. 15 Andrew

    I have been both dug and considered delicious!

    This story is currently on both the front-page of digg.com and del.icio.us, which has been a goal of this blog for a while now. Thanks for your “diggs” and bookmarks.

    selcouth,

    Thanks for the info. There was 1 report of i not working on 12″ PowerBooks. Yes, on the 12″ Safe Sleep is especially useful. Have you tried sleeping normally, and then pulling the battery? What happens?

  16. 16 ebescan

    Is that warning serious? Is it worth the risk?

  17. 17 Patrick

    I can verify that this works (repeatedly) with my 12′’ PowerBook G4 (1 Ghz, MDI out), even after ripping the battery out. This means I can swap batteries without having to go through a full shtudown/boot cycle. Nice.

    It also works with my Dual 867 MDD G4 tower, which is connected to an uninterruptible power supply (which realistically gives about 10 minutes of juice when power cuts off). I have Safe-Sleep configured to power down the machine entirely for the G4 and it seems very snappy. No real numbers for timing, but its quick. This means that when the power does cut off, I can have the UPS software signal the G4 to power down and Safe Sleep. When power is restored, I don’t have to worry about the G4 having to go through another boot-up to reload all my services and apps.

  18. 18 Cool OSX Apps

    How to Safe Sleep (Hibernate) Your Mac:

    “Currently Safe Sleep is just for the new Powerbook introduced last month, but this good article guides you through how to hack the Safe Sleep feature to work on other Mac’s. (Mac OS 10.4.3 only)”

  19. 19 Brent

    To post #18 above…

    You can swap batteries in regular sleep mode.

    [Andrew writes: unless you have a 12″. Also, consider iMac/mini owners who want to unplug and move their computer.]

  20. 20 Sidney

    Not working on my iMac FP running Tiger Server :( .
    Here’s the [relevant] log:

    hibernate image path: /var/vm/sleepimage
    sizeof(IOHibernateImageHeader) == 512
    Opened file /var/vm/sleepimage, size 805306368, partition base 0x58000, maxio 20000
    hibernate image major 14, minor 5, blocksize 512, pollers 1
    error 0xe00002bc opening hibernation file
    IOPolledFileOpen(e00002bc)
    USBF:   433.153 AppleUSBOHCI[0x19a7000] Processing WDH before suspending
    System Sleep
    

    Any ideas?

  21. 21 pluto198
    Nov 12 19:31:33 eMac kernel[0]: error 0xe00002bc opening hibernation file
    

    seems as i’m having the same problem as Sidney.

    I’m running OS X 10.4.3 on an eMac 800 Mhz.

  22. 22 Andrew

    > Is that warning serious? Is it worth the risk?

    No, not all that serious. Worst that can happen is that safe sleep doesn’t work for you. Sleep continues to work, as I’ve seen.

    Safe Sleep + iBook dual-head hack

    If you have an iBook and are using the dual-head hack, which also uses nvramrc, it may conflict. In that case, you can still get it working by seeing the source. He’s a bit more cryptic with instructions though.

  23. 23 Roger

    Has anyone tried it on a Rev 2 TiBook (550/667)

  24. 24 Mike M.

    Hey,

    It works amazingly well on a 14″ iBook G4 (April 04 Model). It takes about 7 seconds to go to sleep and about 30 to wake up.
    Thanks for the tip to enable safe-sleep.

    [Andrew writes: Wow -that a very fast sleep. I’m guessing you have less memory (256mb?) so the sleepimage takes less time to creat and boot.]

  25. 25 Andrew Z.

    Hey, it works on my Fall05 12″ ibook — however, the blinking sleep light is deactivated completely, and now I can only wake the computer by pressing the power button. Is this normal?

    [Yes. When your computer goes into Safe Sleep it shuts-off completely using no power. Use “hibernatemode 3″ to keep using regular Sleep, which will only rarely use Safe Sleep as a backup. ]

    Is there a way to get the functionality of “sleep on lid open” back??

    [Again, No. Your machine is turned-off. ]

  26. 26 Olivier

    how do you revert back to normal sleep?

  27. 27 Ryan

    This irrationally terrifies me. This was originally a feature on the rev A clamshell iBooks. There was an option “Preserve memory contents on sleep”. Apple released a Sleep Memory Extension whose purpose was to disable this feature, which they then removed from Mac OS 9.0.4 and up.

    If I recall, it was writing the memory to a fixed chunk of the disk, without considering that people may use tools like PlusMaker/PlusMaximizer, which changed the size of the allocation blocks on an HFS+ drive and increased the size of the table. Then it would stomp all over the directory structure that was further into the disk than it assumed, making the disk useless without a tool like Diskwarrior.

    Admittedly, this sounds safer, but I had too many bad experiences to trust this.

  28. 28 Neo

    Worked on my Aluminum PowerBook 15.2″ 1Ghz (September 2003)
    It worked great with only one reboot, tried for many times and it was in fact quite fast!

    [Andrew writes: define fast. It would be appreciated if people could post their wait times.]

  29. 29 Andrew

    Oliver,

    If you enter “sudo pmset -a hibernatemode 3/7″ then your mac still goes into regular Sleep mode when you “Sleep” it. Safe Sleep only kicks in after power loss, or automatically/right-away if you enetered “hibernatemode 1/5″.

    Disable Safe Sleep

    To disable Safe Sleep enter in the Terminal:

    sudo pmset -a hibernatemode 0
    

    No need to restart.

    For a more full undo, disable all nvramrc variables:

    sudo nvram \"use-nvramrc?\"=false
    

    Enter password, then restart.

  30. 30 Egypt Urnash

    15″ 1.25Ghz powerbook: worked fine in my test. I was kinda scared when it didn’t seem to start up for a moment at first since the machine is so silent…

    [Andrew writes: I had the same sinking feeling at first. Only once though has it failed when waking up with a kernel panic, but I turned it off, woke it and got it working.]

  31. 31 Jeremy

    Works fine on my 15″ PB 1.67 1.5GB RAM. About 15 seconds to sleep and 30 seconds to wake. One bug I noticed is that Bluetooth is enabled after waking and cannot be turned off.

    [Andrew responds: I couldn’t repeat that bug on a 1.25 or 1.5. Anyone else have this bluetooth bug?]

  32. 32 Alejandro Lobos

    Works like a charm in my 1.5ghz (combo) 12″ powerbook.

  33. 33 Jon Baer

    Got it working on my 12″ G4 Powerbook, although took a good minute or 2 to get back mouse control … thanks for the hack! Extremely useful.

    [Andrew asks: Owch! 2 minutes? Does it keep happening after waking, or was this a one time thing.]

  34. 34 Brian

    Tip worked great on my 1.25Ghz Al Powerbook. Going to sleep took around 15 seconds, waking up was close to 22 seconds.

  35. 35 Brent

    I’m also having the bluetooth problem as well as the sleep light being completely disabled.

    [Andrew responds: The sleep light isn’t being disabled. If your mac is set to enter Safe Sleep right away (”hibernate mode 1/5″) then sleep light would never come; there is no power as your computer isn’t turned on.]

  36. 36 James
    • first time it crashed

    [Andrew writes: Seem to crash the first time -once and only once.]

    • then 2nd time worked, does anyone know if in the Apple menu it can be set as a seporate option?
  37. 37 Vincent D Murphy

    m1ss1ontomars2k4: That message was from the sudo command. It is to make you aware that the command you are running (written after the word sudo) is being run under root privilege.

  38. 38 Chas S

    So has anyone been brave enough to give this a try on any G3 machines (specifically a G3/600 iBook)?

  39. 39 Ryan

    I agree with James, it’s a shame their isn’t a modifier key to make it sleep or safe-sleep in the apple menu T_T

  40. 40 Ryan

    iBook 800 MHz 640 MB DDR about 8 - 10 sec. depending on load to enter safe-sleep. About 16 - 18 sec. waking up. Im not the most heavy of users, so it probably didn’t have to put much onto the HDD, however I’m pretty impressed at the speed of sleep and wake.

  41. 41 Rom

    Works great on powerbook - 15″ 1.67Ghz 1.5GB RAM (Jan05). Sleep in 3 seconds and wakes up in 31 seconds.

    Also works on 12″ powerbook 768MB RAM (rev C).

  42. 42 Jerome

    works fine with my 1GHz G4 Al Powerbook.
    Thanks for the hint.

  43. 43 Damien from France

    I have the same problem as Sidney and Pluto198 :
    Nov 13 13:25:319 powerbook-g4-de-damien kernel[0]: error 0xe00002bc opening hibernation file

    My machine is a PowerBook G4 Titanium 550 MHz with 512 MB RAM

  44. 44 atshoom

    HI, on a rev.1 Dual G5 2.Ghz as well as on a Pismo Powerbook (G3 firewire).
    i have the following issue: i can’t create the file /var/vm/sleepimage with the command
    sudo pmset -a hibernatemode 3
    the command seems to be well interpreted, cause there are no errors on stdout/stderr , but it doesn’t do anything to the filesystem !

    so in my sys.log file i only see the “Sleep” word and no SafeSleep when i go to sleep
    ;(

  45. 45 Oxi

    It is already confirmed that it works on a 12″ Powerbook combo. I noticed that the link with the source article you gave includes a few scripts and it does not require you to reboot into the Open Firmware.

    And an option into the -menu would be very nice. When going on a longer trip where I do not need my Powerbook for a few hours or more, it would be nice if I could force SafeSleep instantly.

    My estimates for the sleep-delay is just a few seconds more then the normal familair sleep. The waking takes about 15 to 20 seconds, instead of 5 seconds.

  46. 46 John Wells

    Atshoom, this is exactly what’s happening to me with my RevB 2Ghz 20″ iMac G5. I wonder what’s wrong…

  47. 47 Audun

    In other words, it doesn’t work with G5 Macs (PowerMac and iMac)

  48. 48 sp

    Very interesting but not sure how much I need it considering the side effects. I think I prefer to have it wake from sleep in a couple seconds rather than ~1min.

    It would be amazing if you could enable both and pick which one to use based on your situation… is it even possible?

    The other thing I am concerned about is the hard drive space required. I have 2GB of RAM and invariably 4-6 swap files totaling ~1.5GB, so does that mean I need ~3.GB of drive space to sleep? thoughts?

    thanks for figuring this one out…

  49. 49 Andrew

    sp,

    I think I prefer to have it wake from sleep in a couple seconds rather than ~1min. It would be amazing if you could enable both and pick which one to use based on your situation… is it even possible? -sp

    Yes, having both options in the Apple menu would be great. In terms of “side effects,” setting hibernatemode to 3/7 means that regular sleep will always be used first, and you will rarely run into situations when you need safe sleep.

    >thanks for figuring this one out…

    Don’t give me the credit, thank Matt Johnston.

  50. 50 Ricardo

    Works on my Aluminum 1.33Ghz Powerbook with 1.25GB of RAM.

    I’d just like to point out that for those of you who have Security set to require your password upon wake from sleep, Safe Sleep does not reveal the contents of your desktop as it loads the image, then asks for your password once it’s done. Very cool, thanks!

    [Andrew writes: Shit! That is really well done on Apple’s part. Try it out. I’m going to add this screen-shot to the post.]

  51. 51 air ick

    This functionality was standard on my Pismo when I got it in February 2000. I always wondered why it stopped being available after system updates.

    I’d really like to see it reintroduced as standard in the power/sleep dialog and apple menu.

    Anyone want to attempt a freeware application?

  52. 52 DaveD

    Powerbook 15″ 1.67Ghz, 1GB RAM works. Times are ~10 seconds to sleep and ~21 seconds to wake.

  53. 53 pickupjojo

    Very nice, works good with my iBook G4 ! :)

  54. 54 CajunLuke

    Would I be correct in assuming that if I don’t know what “secure virtual memory” is, I don’t have it enabled?

  55. 55 The Postman

    Works on my 12″ Alu pBook…

    Just curious… anyone know how I can wake-up using only my 17″ lcd monitor? Before, all I had to do was put the pBook to sleep, then plug in the mini-DVI and the AC adapter, and it would wake up… using the external monitor only…

    I can’t seem to get that to work anymore…

    1024×768 stretched on a 1280×1024 native lcd isn’t a pretty thing!

  56. 56 Sjakelien

    No luck on my G4 Cube; I guess it only works on laptops…

  57. 57 Scott Vieth

    Has anyone tested this on the iBook G3 Dual USB Macs yet? I’ve got one, 600 MHz 384 MB RAM which this would be very nice for.

  58. 58 Leo LeBron V

    working on my Wallstreet 20gb 160mb ram (Powerbook G3 1998). also working on my G3 B&W 350mhz 1gb ram. nice hack. btw, both macs are running OS X 10.4.3.

  59. 59 Andrew

    To: The Postman
    Re: #57

    Are you trying to wake it up after it falls in Safe Sleep when there is no power?

    I’ve asked a friend to try waking his 17″ PB during regular Sleep and it still recognizes the external monitor just fine.

  60. 60 spang

    Has anyone tried this hack on an iMac G4 800Mhz? I’d do it on mine, but I’d rather see if someone has done it before and whether their attempt was successful or not.

  61. 61 Andrew

    Give it a try.

    I’ve attempted this now on a handful of macs.

    Current generation laptops work perfectly. Aluminum PowerBooks, and iBook G4s
    G4/G5 iMacs, iBook G3s are hit and miss

    Still, when Safe Sleep doesn’t work at all, there are no after effects I have seen. The computers continue to work fine, and Sleep normally as they did before.

  62. 62 Paul

    Tried it on my 1.25ghz 15″ Alu works BUT the pulse light doesn’t pulse, just doesn’t light even though it DOES enter this safe sleep how strange??? tried it on my imac g3 500mhz it doesn’t work

  63. 63 Jordi

    It works for me on PB 17″ 1.5 GHz.

    I also agree with other comments that it will be cool to have the power down menu to show either safe or regular sleep. Alternatively, maybe someone knows how to develop either a widget or a script or a simple icon in the desktop that we can use for actually do safe or regular sleep (instead of typing the sudo and then the power button) ?

  64. 64 williaty

    Looks like a no-go on a Titanium PowerBook G4 867MHz (Gigabit Ethernet). Sleeps normally, results in:

    Nov 13 15:12:30 sandamp kernel[0]: System Sleep

    Appearing in /var/log/system.log

  65. 65 Callum Alden

    Bad news for my fellow G3′ers. This hack doesn’t work on my iBook 900 G3. 512MB RAM, 15GB Free… no cigar.

    Time to upgrade? When’s Steve gonna give us these Mac-intels!?

  66. 66 Andrew

    the pulse light doesn’t pulse, just doesn’t light even though it DOES enter this safe sleep how strange

    No. Not strange. If you mac has entered safe sleep, then it is off, completely shut-down, consumes no power, and draws no power at all. Thus, the light doesn’t pulse because no power is use. Please tell me for your sake and my sanity that you understand this. :)

  67. 67 Bruno

    Andrew,
    did you intentionally do this on Nov 11 at 11:11:11 or was it just a ‘coincidence’? Hmm, nice!

    [Andrew writes: It was my small way of giving tribute to the fallen on Remembrance Day.]

  68. 68 Med Student

    this is awesome for the four+hour lectures I have in med school… now I can swap out batteried on my 12″ 1.5 PB and be back in the game in under a min… thanks

  69. 69 Michael

    Im trying to write an applescript to switch between safe sleep and normal sleep modes. this is what I have so far.

    tell application “Terminal”
    do shell script “pmset -a hibernatemode 1″ password “mypassword” with administrator priviliges
    end tell

    The problem is that the script is returning errors that it has a priviliges error. I have tried taking off the “with administrator priviliges” and insted using sudo but i either get the priviliges error or an error asking for my password error depending on how I word the code.

    Im kind of a newbie when it comes to applescript, so anyhelp would be wonderfull.

    My goal is to make 2 scripts that will switch the functionality of the sleep mode. I then want to try and make a script that will check the current status of the sleep mode (to check if safe sleep is active or not). Once this is done I want to combine the 3 scripts into an automator flow so it will automaticaly switch the mode for me.

  70. 70 Roger

    I have the same problem as Sidney and Pluto198 :
    Nov 13 13:25:319 powerbook-g4-de-damien kernel[0]: error 0xe00002bc opening hibernation file
    My machine is a PowerBook G4 Titanium 550 MHz with 512 MB RAM

    I have the same machine, but on mine it just sleeps as normal…
    kernel[0]: System Sleep

    Have ran the steup twice and still nothing… am I doing something wrong?

    [Andrew asks: Which model mac are you using?]

  71. 71 Alamaz

    Same problem here
    kernel[0]: hibernate image path: /var/vm/sleepimage
    kernel[0]: sizeof(IOHibernateImageHeader) == 512
    kernel[0]: Opened file /var/vm/sleepimage, size 671088640, partition base 0xe4000, maxio 20000
    kernel[0]: hibernate image major 14, minor 10, blocksize 512, pollers 1
    kernel[0]: error 0xe00002bc opening hibernation file
    kernel[0]: IOPolledFileOpen(e00002bc)
    kernel[0]: System Sleep

    I’m using a PowerMacG4 QS867, with standard 10.4.3 installed
    I have checked, ran the configuration twice too…Any idea ?

  72. 72 RFS

    The way to have both sleep options available would be to create two Automator workflows (if that crummy app will stay alive long enough).

    1 set up for hibernation; sleep; revert to normal sleep

    2 set up for normal sleep; sleep

    Give ‘em icons and stuff ‘em in the Dock.

    I’d design in the third step of #1 so that it reverts to default behaviour once it wakes up again. If you did a default sleep and you meant to hibernate, it’s only a few seconds to backtrack and correct it. If you did a hibernate and you meant to do normal sleep, it takes over a minute to backtrack.

    Now all it needs is an enabler/disabler.

    Nice work Andrew.

  73. 73 Damien from France

    [Andrew asks: Which model mac are you using?]

    The answer is in the post :

    My machine is a PowerBook Titanium G4 550 MHz with 512 MB RAM

    Works very well on a iBook G4 1 GHz. But with the PowerBook 550 MHz, it doesn’t work. Same system.log as Alamaz (post 73).

  74. 74 OS X Code

    How To: Safe Sleep almost any Mac

  75. 75 SR

    awesome…!! works great on iBook g4 933mhz 640mb RAM and custom mod 5400rpm drive. hibernate mode 3 is best … if you want to wake up quickly it will, otherwise if it sleeps longer than a few minutes, it just drifts off to a deep coma :D

  76. 76 Jacky820

    Cool. It’s work for my 12″PB.

    Question, I’m using the mode3 for sleep my PB. When it wake up and I foudn all (touch pad) is freeze.

    Any idea?

  77. 77 Victor

    Couldn’t get it to work on my iBook G3 600MHz / 640MB RAM / 80 GB HDD / OS X 10.4.3. Log still says ‘System Sleep’ as ever, and if I remove power while sleeping, I get a restart afterwards. Too bad.

  78. 78 mare

    Thanks, since a week I am the happy owner of one those new 15″ PowerBooks (a present from Apple after my TiBook proved irreparable) and it has entered this deep sleep state a couple of times leaving me wondered what was happening. Frankly I thought it was the 10.4.3 update.

    But now I know.

    I wish I could choose this deep sleep when I close the machine (without to resort to writing a shell script). It would be nice there was an option in the “Restart/Sleep/Cancel/Shut Down” dialog.

  79. 79 oli

    i have powerbook 12″ G4 that i bought in december 2004 and when i try mode 1 or 3 and then click on the sleep button, my laptop just crashes, ive tried restarting and doing it again (since it seems that it’s meant to crash the 1st time) but it keeps on happening.

  80. 80 Benfried

    Works perfectly on my 12″ 1.33GHz Powerbook with 512 MB.

  81. 81 mike

    If you’ve tried this and left your PowerBook asleep for a long time, check your clock at wake.

    My clock stops working during the sleep period and, once awakened, starts “ticking” from when it stopped. In other words, the 8 hours my PowerBook 15″ 1.67GHz was sleeping wasn’t accounted for in the system clock. It still thinks it’s around 10:30 PM.

    Anybody else with this problem?

  82. 82 Andrew

    mike,

    Yes, others have reported the clock problem.

    Safe sleep isn’t perfect yet which is why I recommend it as a backup to regular Sleep, for when the laptop battery is depleted, or you need to unplug and move your desktop.

    You should not use Safe Sleep as a replacement to regular Sleep. Regular Sleep is much faster, and uses very little power.

  83. 83 Chris

    Doesn’t work on my 1GHz TiBook. No errors, just doesn’t work. In the system.log I just get:

    kernel[0]: System Sleep

    Not the safe sleep. Just another reason for me to get a new PB. I’m going to wait for the Intel model though…

  84. 84 pillguy

    Works great on my 12″ G4 Powerbook. Thanks!

  85. 85 Max

    Got it to work on a 1.5ghz 12″ powerbook, previous release to this last product refresh.

    Very cool feature!

  86. 86 sai from Indonesia

    Nice hack ..
    the 2nd OF hack I applied along with dual screen spanning hack a year ago …
    (I switched to Mac on July 2004) mine is iBook G4/1GHz 768 MB …

    I used it mostly to preserve my battery’s charge cycle count .. put it to deepsleep @ home, and changed it to using adaptor @ office … battery only used on presentation or no electricity available ..

    on hibernatemode 3 it takes 4-5 seconds from lid closed to blinking, and after taking out juice it woke up at around 25 secs …

    on hibernatemode 1 it takes 4-6 seconds until the harddisk stops, waking up about the same time as above …

    one glitch … sometimes after waking up it would not accept keyboard input for password .. only mouse action .. (I experienced this kind of sleep glitch when using Panther) .. especially on hibernatemode 1 .
    way around is make it sleep again, waking it up again, and most likely it will go smoothly as before …

    So I stick with hibernatemode 3

    Thanks Andrew, thanks Matt …

  87. 87 TipMonkies

    Putting your Mac into safe sleep mode

  88. 88 Swiney

    No go on TiBook 800Mhz. Same symptoms as Chris and williaty

  89. 89 Jeremy K

    Does not work on [my] Fall 2003 12″ Aluminum powerbook (1Ghz). I was really excited when I saw this too, because ever since I installed Tiger, my sleep time has dropped from days to hours. (Of course, I’ve abused my poor battery so much, I only get about 45 minutes on a full charge now…)

  90. 90 Echo.2

    Deep Sleep

  91. 91 Abhi Beckert

    Not working on my G4 iBook, /var/vm/safesleep file isn’t being created.

    I wonder what’s the difference between my iBook and Ryan’s? (comment 42)

    Like his, mine’s an 800Mhz 12″ G4 iBook, running 10.4.

  92. 92 Adam

    Awesome tip. Got it working on my PBG4 867MHz 640MB. Sleeps in 3-5 seconds, and wakes in 18-20. This is incredibly useful for me, as I may have 4 hours of class in a day, but with a 2 hour (or more) gap between them. I used to sleep my PB, and she lost a fair chunk of battery power along the way. Now, I can just SafeSleep it, using no power, and get back to full operability in less time than a full boot. In short, I’m using it less as a replacement for Sleep, and more as a replacement for Shut Down/Startup.

  93. 93 TAN

    After installing Tiger OS - I’m having problem restarting or rebooting my iBook. Not sure anyone can help?
    Thanks…TAN

    [Andrew writes: So you installed Tiger, and Tiger doesn’t work? or the Safe Sleep isn’t working?]

  94. 94 David

    Michael, if you’re still having trouble with priviledges in your apple script, then try this:
    - write a script that runs the command you need: e.g. something like

    !/bin/bash

    pmset -a hibernate 7

    make sure it’s not writeable by anyone
    run chmod a+s ./name-of-the-above-script
    using do shell script in AppleScript, run just the above. The +s modifier should ensure that it always runs with root priviledges.

  95. 95 James

    This has been working perfectally since my last comment,

    but is anyone aware if there is a modifier or a script to enable a seporate button in the apple menu that i could use, so as to when i am travelling home i could put my mac in safe sleep, but for when i walk arround school keep it in normal sleep.

    Oh and Andrew, i hope the bandwith bills arn’t to high.

    [Andrew writes: I’m looking into into a proper Apple menu option, but its complex. Bandwidth is ok –for now.]

  96. 96 Cuberr

    Great hack, worked fine on my iBook G4.

  97. 97 Shanghai Daddy

    I enabled this hac in an iBook 1.2 GHz (Late 2004, non scrolling trackpad model) running Mac OS X 10.4.2. Surprsingly it worked without a hitch. You may see a screenshot on Flickr.

  98. 98 Jerrod

    If we undo the changes shown here, is it safe to delete /var/vm/sleepimage ??

    Great instructions, by the way… I just use my Powerbook too often to let it die completely, so I’d rather have my 1.5GB back.

  99. 99 [Another] Andrew

    I just installed the hack today on my 12″ PowerBook (1.5GHz, Scrolling Trackpad) and it works like a charm.

    Finally the 12″ PB can swap batteries without shutting down and restarting!!! It is just so fast and easy, if I open and close the lid, the PowerBook behaves as it always did, but if I remove the battery from the sleeping PowerBook, it will resume from safesleep with the grayscreen.

    This is a major functional improvement and addresses one of my long-standing complaints about OSX on machines without small backup batteries (iBooks and the 12″ PB).

    [Another] Andrew

  100. 100 Andrew

    Jerrod,

    RE: deleting the sleepimage file:

    /private/var/vm/sleepimage
    

    Yes. If you are not going to use Safe Sleep you can delete this image. You may be able to just drag it into the trash, but this may prove safer:

    Boot up from a Mac OS X install disk. Open Terminal from the tools menu, and remove the sleepimage:
    cd /Volumes/Mac\ HD/private/var/vm
    rm sleepimage*

  101. 101 Skar

    Worked fine on my iBook G4

  102. 102 Bjoern

    Yeah - with the scripts from comment 22 it works like charm on my iBook G4 with the dual-head hack. Awesome!

  103. 103 Kai

    Works fast on my 1 GHz G4 MDD FW800 with 2 GB RAM and secure virual memory enabled. 9 sec down, 20 to start from disk. I’m very happy!

  104. 104 backwhack » How to Safe Sleep (Hibernate) Your Mac - AndrewEscobar.com

    […] How to Safe Sleep (Hibernate) Your Mac - AndrewEscobar.com Mac users have become quite familiar with using Sleep mode. In Sleep mode, Macs go into a very low-power mode, while saving the current session for later use. Putting a Mac to sleep will continue to power RAM in sleep mode, so that whatever was in RAM when the computer went to sleep will still be there when the computer wakes. Sleep mode is almost instantaneous, consumes very low power, and as a PowerBook owner its indispensable to me. Still though, it requires a power-source (however low) and there are times when laptop batteries are completely depleted or a user wants to completely power-off their Mac. Filed under: tech Comments: […]

  105. 105 Shocktrooper

    Andrew, all:

    Tried this hack on my 933 Mhz iBook G4 (Fall ‘03) and it works fine. No crashes at all.

    One thing I haven’t seen mentioned in the posts so far is that this is a great “hack” for those of us who have 3rd-party batteries that do not support Sleep mode. (As far as I can tell, that’s pretty much all 3rd-party batteries.)

    This lack of support for Sleep mode has been kind of an annoyance, like when the computer shuts down automatically even though the battery meter says there still is x percentage remaining. (The meter is never fully accurate, is it?) All work is of course lost when this happens.

    With SafeSleep mode, though, we now don’t have to worry so much when the battery gets low.

    Thanks, ‘Drew!

  106. 106 Andrew

    this is a great “hack” for those of us who have 3rd-party batteries that do not support Sleep mode

    WTF? 3rd party batteries don’t support regular Sleep mode? What the hell!? From MaxFixIt:

    Tutorial: Maintaining and restoring your PowerBook/iBook battery

    Although they sometimes offer a higher purported capacity, the downside of many third-party batteries is that when the system reaches a point of low power where it would normally automatically go to sleep and preserve unsaved data (with an Apple battery), third-party batteries will allow the machine to simply shut off causing you to lose unsaved data if you aren’t careful enough to put the machine to sleep manually when power is running low.

    So is Safe Sleep actually preventing this if you set it to “hibernatemode 1″? Please investigate further and let me know.

  107. 107 Shocktrooper

    Andrew:

    Um…er…heh…. looks like for some reason I was a bit confused when I posted above. (Shocktrooper wipes egg off face.)

    I tested out my theory, and, sure enough, Safe Sleep mode does not prevent data loss when the computer is on when the third-party battery cuts out; indeed, Safe Sleep mode works only if the computer is already in Sleep mode when power fails. I’m therefore assuming Hibernate Mode 1 is useless in this regard, as the computer is not forced into sleep; the power simply, abruptly, cuts out.

    So, it looks like on my larger point I was wrong. My bad.

    Still, Safe Sleep mode could be slightly more advantageous for users of third-party batteries, since, with no auto-sleep to force you to plug your computer in, you might be more likely to drain down the battery farther and then forget to put the computer to sleep unplugged. Granted, this doesn’t seem like much of an advantage, but if it saves your data even once, it might be worth it.

    Anyway, I’m going to crawl back into my hole and get my facts straight. Then I’ m going to crawl into a bottle…

    [Andrew responds: No problem it happens. They’re still very useful comments.]

  108. 108 Jeremy

    When I enter the first line, I get:

    tcsh: Unmatched ‘.

    Huh? What am I doing wrong? (Hint: I didn’t mistype it.)

    [Andrew writes: Hint: Try copy and past?]

  109. 109 Abhi Beckert

    Posted by me:

    I wonder what’s the difference between my iBook and
    Ryan’s? (comment 42)

    I figured it out, I hadn’t realized that the “dual-head hack” is the same as the screen spanning doctor applescript.

    Thank you so much for this! My battery completely died (caused by a bad power cable which I have since replaced), and I can’t afford a new one. So for a few months I’ve been shutting my iBook down every time I go to/from the office.

    This is exactly what the doctor ordered! THANK YOU!!!

  110. 110 Jeremy

    I did copy and paste. That’s what I meant by “I didn’t mistype it.” ;-)

    Also, I forgot to mention, I’m on a 1.5 GHz Aluminum PowerBook, so I should be supported.

    Thanks for the quick reply.

  111. 111 sony

    I have the bluetooth issue too. I’ve disabled safe sleep and bluetooth is back to normal. I don’t have a clue what my previous bt settings were like. I just happened to notice that bluetooth was on, discoverable and needlessly eating up precious battery life.

    12″ PB 1.5ghz - 1.25gb RAM
    Mac OS 10.3.4 build 8F46

    what other specs would be helpfull?

  112. 112 Jerrod

    I did the “safe version” of your procedure in comment 100… and it worked - thank you.

  113. 113 Mathue

    Looks like the TiBooks are off the list, my 867mhz just goes into ‘normal’ sleep. Console shows the same as other Ti users have reported.

  114. 114 patrick

    Same result as Mathue, my TiBook 867MHz/768MB shows the same “System Sleep” entry in Console. The notable section of the log showing where the process errs is here:

    hibernate image path: /var/vm/sleepimage
    sizeof(IOHibernateImageHeader) == 512
    Opened file /var/vm/sleepimage, size 805306368, partition base 0x58000, maxio 100000
    hibernate image major 14, minor 5, blocksize 512, pollers 1
    error 0xe00002bc opening hibernation file
    computername kernel[0]: IOPolledFileOpen(e00002bc)
    

    Looks like TiBooks are out…

  115. 115 Joe

    Same as the others with TiBook 800, 0xe00002bc. And I was really looking forward to hibernate! =[

  116. 116 Joe

    Did a tiny bit of digging. Turns out TiBooks have the KeyLargo ATA controller, while everything newer has Kauai ATA.

    I Am Not A Kernel Hacker, but, it looks like while writing RAM to disk, hardware interrupts get completely disabled. The ATA driver, which ordinarily relys on interrupts, goes into ‘polled’ mode, where instead of waiting to get interrupts, it repeatedly checks (polls) for new events from the ATA bus. The Kauai driver has this code, but the KeyLargo driver does not. However, it seems like the interesting bits are happening in driver-land, not hardware-land; and furthermore the error 0xe00002bc seems to be a manifestation of the system trying to ask KeyLargo ATA to switch to polled mode; so backporting the polled-mode code to KeyLargo seems possible.
    Any takers? =]

    I don’t know how Leo LeBron V got his Wallstreet working. Perhaps it has Kauai ATA? Why did Apple switch to KeyLargo, then back? The world may never know.

  117. 117 Damien from France

    Can somebody check that this mode functions only with computer which uses a certain type of DDRAM ? Because it doesn’t work with PowerMac G5, with old PowerMac G3 blue, with old PowerBook Titanium, etc … And all these computers does not use the same type of memory as the iBook and Powerbook which function.

  118. 118 The Lord Of The Pings

    Howto: Enabling Safe Sleep on any Mac

  119. 119 Mr. Plumber

    Cool! Worked great on my 1GHz AlBook 17″! Thanks! Love this hack! Love O’Reilly — BOTH the media company AND the commentator!

    Mr. Plumber

    [Andrew writes: I’mlad to see you take my jokes in stride. ]

  120. 120 ThRiX

    I have powerbook 12″ G4 (March 2005)
    after use this code:

    sudo pmset -a hibernatemode 3

    in /var/vm/ cannot view the safesleep file…
    can you help me?

  121. 121 Alamaz

    Joe.

    I don’t know if i have understood all what you’re speaking about, but maybe the necessary step would be to modify darwinsource.opendarwin.org/10.4.3/AppleKeyLargo-170.0.0 in order to add him functions from darwinsource.opendarwin.org/10.4.3/AppleKauaiATA-121.3.4

    [edited]

  122. 122 Iljitsch

    Jeremy: I had the same problem. Solved this with “sudo sh” and then executing the commands without sudo.

    Apparently some people think that with safe sleep, the contents of memory are written just prior to the backup battery running out of power. Obviously this is not the case: memory is written to disk prior to entering sleep mode. The time this takes (from lid close to pulsing light) seems to vary with the amount of memory that’s in use.

    When I tried this on my 1.25 GHz 15″ aluminum PB, I noticed that once the backup battery was drained, it stayed that way until I put the regular battery back in and charged it. So apparently the backup battery is not a capacitor but a real battery.

    Bluetooth and keyboard problems seem related to parts of the system being powered off in safe sleep, unlike in regular sleep (where the keyboard and bluetooth can wake up the computer). The bluetooth icon in the menu bar changes to “no bt hardware available” after returning from safe sleep but then quickly turns into the regular icon on my system.

  123. 123 Bob

    On my Dual 1.25 G4 MDD (10.4.3, 2 gig RAM, 40 free Gigs HD) I’m getting the same error that some others are reporting. Namely

    kernel[0]: hibernate image path: /var/vm/sleepimage
    kernel[0]: sizeof(IOHibernateImageHeader) == 512
    kernel[0]: Opened file /var/vm/sleepimage, size 2147483648, partition base 0×80e4000, maxio 100000
    kernel[0]: hibernate image major 14, minor 23, blocksize 512, pollers 1
    kernel[0]: error 0xe00002bc opening hibernation file
    kernel[0]: IOPolledFileOpen(e00002bc)

    My mac simply goes into normal sleep mode. It seems my model of Mac is not supported. :(

  124. 124 skymarshall

    Would it be possible to make it into an Applescript. So people who are not confident with the terminal can still take advantage of this wonderful hack?

  125. 125 Joe

    Alamaz,

    That’s pretty much the idea. There doesn’t seem to be anything hardware-specific in the Kauai polled-mode code. Maybe that enum ‘Command.cmd operations’ might have to be changed a bit. Also it seems the dmaintexpected and intstatus vars aren’t in the KeyLargo code; there are probably other variables for the same function.
    But I’m not a kernel hacker, so I’ll leave it to others more qualified than I to actually write the code =]

  126. 126 Abhi Beckert

    > Would it be possible to make it into an Applescript. So people
    > who are not confident with the terminal can still take advantage
    > of this wonderful hack?

    I could do it, but don’t have time. I’m asking at a coding forum I visit regularly, hopefully someone there will pick it up.

  127. 127 Shocktrooper

    Andrew, all:

    Yesterday I posted a comment about Safe Sleep mode and third-party laptop batteries that I had to backtrack on in a second post. After experimenting further, I can happily somewhat backtrack on my, er, “backtraction.”

    With third-party laptop batteries, Sleep (aka Deep Sleep) mode is not supported. This means that if you ignore the low battery warning, you run the risk of losing any unsaved data when the battery juice does run out, as the computer will simply cut out. This is not the case with Apple batteries because the computer will auto-sleep before the battery has run down completely. Once that happens, it’s like a kick in the butt to plug your computer in.

    I initially stated that for those of us with third-party laptop batteries, Safe Sleep mode would help prevent data loss when battery cuts out, because you can just press the power key and the Safe Sleep image would be reloaded. Unfortunately, in my excitement to post this groundbreaking discovery, I had forgotten that Safe Sleep mode works only if your computer is already in Sleep mode when power fails. Oops.

    After posting a retraction, I decided to experiment more carefully this time to see if maybe I could salvage some credibility. (Visualize white lab coat, beakers, Bunson burner.) I ran my battery down all the way until my computer cut out and even waited for about 30 seconds before plugging it in. After I plugged it in, I suspended my anxious, sweaty finger over the power button, praying for a miracle. I then pressed the power button and–Lo and behold!–my computer booted from the Safe Sleep image!

    I’ve now successfully replicated this result three times and … I have no explanation to account for this. Based on the information available, Safe Sleep mode should only work if your computer is already in Sleep mode when the power fails. I only can positively verify that, before I activated the Safe Sleep hack, my computer would cut out completely when the battery lost power, causing me to lose any unsaved data and necessitating a reboot.

    If I had to hazard a guess, I can only say that maybe my third-party battery had some residual juice left in it–not enough to power the computer, but enough to force a Safe Sleep restore. Or maybe it was because I didn’t let it sit unplugged for long. Dunno.

    Anyway, take my results provisionally. If anyone else here verify my results, that’d be great.

    Andrew, any thoughts?

  128. 128 Caius Durling

    I have a problem with sleeping my powerbook now.

    From my post over at macosxhints.com

    On my powerbook I did the safe sleep instructions to enable it. (Wish I hadn’t now )

    Anyway, now the machine will goto sleep, but when I wake it its just totally unresponsive. The fan kicks in so I know its awake, the screen is totally blank and the machine doesn’t respond to anything. The USB hub lights up as well, so there is obviously life there.

    To get it back I have to hold down the power button to force shut it down and then start it up.

    I’ve booted into open firmware and reset nvram, also reset the PRAM.

    I then reinstalled Tiger and also deleted 3 preference files that someone said to delete.

    The problem is still here.

    I’m at college now, and am going to try a PMU reset when I get home, any other ideas anyone?

  129. 129 SteveJ

    This doesn’t seem to work on my 1.5 GHz 15″ Powerbook G4. ?? I followed the directions to a t, and set it to safe sleep immediately (i.e. to 1, and I’m not using secure virtual memory). All I ever get is regular sleep. Anyone else having this problem with a 15″ 1.5 GHz Powerbook?

    Also, Jeremy, the problem is using the tcsh shell. It doesn’t use the ‘ syntax. So first enter sh to enter the bash shell, then follow the directions.

  130. 130 Ford Prefect

    Thanks, the hack worked flawlessly… as expected, feb2005 15″ pb :) Now all I need is a way to invoke safe sleep at will for long durations. An applescript if possible would be perfect.

  131. 131 Gustavo

    I followed the instructions to enable Safe Sleep on a PowerBook G4 12″ DVI (1GHz). It works great. The machine takes its 1.25GB of memory into a deep sleep in about 14 seconds, and is back to working order (responsive mouse and apps actually working) in some 26 seconds.

    A little bit of insight on the “clock loses time” problem. I experimented several scenarios. 1) Deep sleeping the machine for 5 minutes with the battery out, the clock stays fine. 2) Deepp sleeping the machine for 3 hours with the battery out, the clock loses 3 hours of time. 3) Deep sleeping the machine for 12 hours with the battery in (i.e., take out the battery to deep sleep, then put the battery back in), the clock doesn’t lose time.

    So, bottom line, the clock continues to work for a few minutes, which is great for the purpuse of swapping batteries. As long as the battery actually has power, the clock will continue to tick during the deep sleep. If there is no power whatsoever to go off from, then the clock will stop and the time will be recovered from whatever state was saved in the safe sleep file. I have kept track of how much battery power gets used, by running Jeremy Kezer’s XBattery, and even though still powering the clock, the 12 hours of deep sleep are not noticeable as a power drain. Normal sleep for 12 hours would on the other hand take a toll of a few percent battery charge.

  132. 132 DerekF

    Tried this on my PowerBook 1.25 GHz 15″ with 2 GB of RAM running 10.4.3. Everything seemed to be going as expected until I tried to wake my PowerBook from safe sleep. I didn’t see the blurred desktop (thanks for clarifying why, back in comment 50), but I did see the progress meter gradually filling up at the bottom of the screen.

    Unfortunately, my PowerBook never fully woke up after the progress meter got to the end. I even waited several minutes before rebooting, and when I did, the PMU had been reset, too.

    The only “variable” seems to be that I’m using SideTrack. Can anyone else using SideTrack confirm that safe sleep is working for them?

    Thanks!

  133. 133 Gustavo

    Hi DerekF,

    I’m using SideTrack and Safe Sleep works flawlessly, as I just described in post 131.

  134. 134 fl0rian

    Hi, it work for me on my powerbook 1.5 GHz 15″ for a time and then after few days it shutdown automaticly after the grayscale desktop.

  135. 135 DerekF

    Hey Gustavo,

    Re-read comment 131 and can’t find any reference to SideTrack, but if you’re using it and are having success, then I think I can cross that off my troubleshooting list. The only other thing is my 2 GB of RAM, which I find has given me problems with 10.4 (the occasional kernel panic, seemingly random inability to wake from sleep…). Perhaps I’ll try downsizing to 1 GB and seeing if that has any effect…

  136. 136 Gustavo

    Hi Derek,

    Yeah, comment 131 doesn’t mention SideTrack, it focuses more on the clock issues. What I meant to say in comment 133 is that Safe Sleep works fine for me, and that I am in fact using SideTrack 1.2.1.

  137. 137 Abhi Beckert

    Are the clock issues fixed if you set your mac to set date/time automatically from the internet? I always turn it on, that way I’m certain it’s accurate. I’m pretty sure it would simply set the clock to the correct time as soon as it wakes up (assuming you have internet access of course).

  138. 138 julie

    Worked perfectly on G4 1.5ghz PowerBook and G4 800mhz iBook, both tiger 10.4.3 of course.

    This is great! Thanks

  139. 139 chuckles

    A minor warning for others:

    If you use an external monitor and run your mac with the lid closed don’t try this in “hiberantemode 1″, you will discover that you can’t unsleep it without opeing the lid and cannot operate with the lid closed.

    [Edited]

  140. 140 StyleMac.com

    How to Safe Sleep (Hibernate) Your Mac

  141. 141 P

    Doesn’t work on an iMac G5 Rev. A. I think that the driver idea above is correct - Apple added the necessary code to the drivers used by the new PBs, and those of us using other drivers don’t get the free ride. No big deal though - the iMac is too big to lug around anyway (sour grapes, eh?)

    Jeremy: The error you’re seeing comes from the tcsh shell. The code in the example is for bash, which is the deault shell in OS X since a couple of versions back. Easiest way around it is to temporarily switch to bash before using - just type “bash” without the quotes on the commandline before beginning the incantation above.

  142. 142 DerekF

    I’m “happy” to report that I got safe sleep working on my PowerBook G4 1.25 GHz (see comment 132). However, I had to remove 1 GB of RAM from my PowerBook, so like many other things Tiger-related (e.g., Airport dropouts, random inability to wake from sleep, etc.), it seems like safe sleep has a problem on a PowerBook running more than 1 GB of RAM. At least for me. Great.

  143. 143 Ben Goren

    Works perfectly on my 12″ 1 GHz PowerBook G4 (PowerBook6,2) w/ 1.25 Gbytes RAM.

    I’ve got an external display attached, and it often takes the PowerBook a few extra seconds to detect the display on wake, even if it was attached when it was put to sleep (and not disconnected while sleeping). The time it took to wake from Safe Sleep really didn’t feel any longer than usual.

    My PowerBook is old enough that the two batteries I got with the computer just don’t hold the same charge they used to. On more than one occasion I’ve been quite inconvenienced by having to find a power outlet, shut down, or whatever just to deal with a battery swap. I’m simply delighted that this is now solved!

    My parents have a relatively new eMac. Their power is also somewhat unreliable, tending to spikes and drops and many more outages than I have here. They just got an immortal power supply with voltage regulation to clean the power. I’ll be trying this out on their computer the next time I’m there; it could mean that they’ll never notice a power problem again, unless they actually try to use the computer when it’s out.

    Cheers,

    b&

    P.S. I’m doing a cut-and-paste of these comments between Andrew’s original blog entry and Mac OS X Hints. No, it’s not a case of deja-vu, sorry. b&

  144. 144 Jack Overfull

    Hi, I just wrote SuspendNow!, an app that let you use the safe sleep without replacing the “Sleep” menu item, with a simple double click.
    It’s now at version 0.5, but It’s already working quite good.
    You can download it from http://www.jackoverfull.altervista.org/applicazioni/suspendnow/download.html

  145. 145 Dhan

    Your comparison of Sleep with Hibernation in Windows is wrong. The equivalent feature in Windows is Stand By. I am not sure which devices are powered off, but it is as quick as Sleep.

    “Similar to Sleep, Windows “Hibernates,” while Linux “Software Suspends”. They are not as fast as Sleep mode, but they take it a step further by not using any power.”

  146. 146 Lars Skovgaard

    Hi

    This is an awesome hack – you just gotta love it when you own a 12″ Powerbook.

    One note, though. If you have an external monitor attached when the computer goes to sleep, and your computer requires a password when you unsleep it, it will fail to start up properly.

    I’m using an Apple 20″ TFT monitor AND my 12″ Powerbook monitor combined, and found that the computer wouldn’t wake up properly after SafeSleeping. I got the startup-image, but when the login-prompt should have appeared, I was faced with a black screen and no visual feedback other than my mouse-cursor. When I pressed any key on the keyboard, I would hear a warning-sound, so I could tell the computer was responding allright. I just couldn’t get to it.

    I knew that I should be seeing the login-prompt, so I tried to disconnect the external monitor, but to no avail. The black screen was still there along with an unresponsive keyboard. On a whim, I tried closing the lid to make the computer sleep again (I had it on SafeSleep by default), then waiting until it was completely asleep, then waking it again. On this second awakening, I got the login-prompt as expected, and was able to log in as usual.

    Afterwards, I had to move some windows around in Photoshop and InDesign, but I didn’t lose any changes to my documents.

    Moral of story: If you run this with an external monitor connected AND your computer requires you to login after sleeping, be sure to disconnect the external monitor before waking the computer.

  147. 147 Conrad

    To Dhan in post #145: this is jut a typo. I’m sure he meant to add “Safe” in between “to” and “Sleep” at the start of your quoted material.

  148. 148 David

    I’ve created a control panel for this. The basic functionality is implemented. If you’d like to test it then it’s here:

    http://dsiska.wz.cz/blog/?postid=35

  149. 149 Whosawhatsis

    My bluetooth icon was showing unavailable after safe sleep at first, but it appears that the problem is only with the icon, and killing SystemUIServer not only brings it back, but makes it come back after subsequent safe sleeps until you restart (or possibly log out). I don’t have any bluetooth devices, so I can’t test that it’s actually working, but everything seems to be alright… Can anyone confirm this?

  150. 150 Eric

    Is this feature something you all expect will be included for older laptops in future relases of OS X? i.e., are they testing it and planning to release it in say 10.4.4…?

  151. 151 macpro.se: dagliga nyheter för professionella macanvändare » Låt Mac:en vila säkert

    […] Apple har nu introducerat detta i de senste PowerBook-maskinerna men det går också att få igång på äldre maskiner genom att mecka runt lite i operativsystemet. Andrew Escobar har skrivit en utförlig guide till hur man bär sig åt, och den kan du läsa här. […]

  152. 152 raminuri

    144: Jack Overfull

    Does your “Suspend Now” software take “Secure Virtual Memory” into consideration? What hibernate mode does it invoke?

  153. 153 raminuri

    I wrote that I was directing my Number 152 comment to Jack Overfull but it didn’t seem to take. :-(

  154. 154 Torge

    Finally worked now on my Mac Mini (1.25 GHz, Combo, 512 MB). I first could’nt get it going using the terminal commands described by Andrew. But I tried “SuspendNow!” and now it works! Takes about 10 secs longer to sleep and maybe 20 to wake up completely…

  155. 155 raminuri

    Andrew:

    Works on my early 2005 PB 17″. I will join the chorus: this is an awesome hack.

    I find with this PB that my batteries drained WAAAAY too fast in regular sleep (before this hack.) I was losing a lot of juice if I put it to sleep for three hours while on battery and then came back to it.

    I’m a writer. I write in restaurants and Starbucks. This is fabulous.

    BUT HERE IS A QUESTION THAT I WOULD LIKE ANSWERED BEFORE I PERMANENTLY ALTER SLEEP TO SAFE SLEEP ( the Safe Sleep convenience is important to me.)

    (1) In my Energy Saver Prefs, I have “computer to sleep” for Power Adapter set to NEVER, but “the hard(s) to sleep when possible” is on. What is the effect of
    sudo pmset -a hibernatemode 1/5
    in this setting?

    (2) The answer to (1) becomes more important in Battery.
    Here’s where I can control Safe Sleep by setting “Computer to Sleep” to three (3) hours, then using the Apple Menu Sleep command to invoke Safe Sleep.
    [I only use Battery when I’m out writing or traveling.]

    However, I need to know what the effect of having “the hard(s) to sleep when possible” checked.

    Will my drive go into Safe Sleep every chance it gets if I use
    sudo pmset -a hibernatemode 1/5 ??

    Anyone know?

    Thanks for doing this Andrew, and for the REALLY CLEAR instructions.

  156. 156 Alexey

    PowerBook 1.67GHz G4 15″ 2Gb (pre-october shift).
    Safe Sleep works BUT i didn’t see “gray desktop”… Just pure gray screen and progress bar like on picture…
    Is it OK?
    BTW
    Didn’t know how long it takes to hibernate but it takes about 15sec to wakeup.

  157. 157 Alexey

    adendum to post 156:
    I’m using Tiger 1.4.3 + all updates available via Software Update…

  158. 158 Quang Minh

    hi Andrew, I followed your instruction but cannot get my iBook 14′ running 10.4.3 (bought in August 2005) to work :( Too bad, maybe something wrong with my Terminal ?!
    While i copy and paste the first instruction, I got this on my Terminal, seems not as I expected:

    Last login: Tue Nov 22 23:36:43 on ttyp2
    Welcome to Darwin!
    [iCouple:~] ngoquang% sudo nvram nvramrc=’” /” select-dev
    tcsh: Unmatched ‘.
    ” msh” encode-string ” has-safe-sleep” property
    unselect
    ‘[iCouple:~] ngoquang% ” msh” encode-string ” has-safe-sleep” property
    tcsh: msh: Command not found.
    [iCouple:~] ngoquang% unselect
    tcsh: unselect: Command not found.

    Then after command “sudo nvram “use-nvramrc?”=true” , no file is created in /var/vm , i checked log file but only can see normal Sleep, no Safe Sleep.
    Can u enlighten me, thanks a lot.

  159. 159 raminuri

    Andrew, did you press return after “sudo nvram nvramrc=’” /” select-dev” the way Andrew described up above?
    There are no > signs that you did.

  160. 160 raminuri

    SORRY. SORRY. SORRY.

    I meant QUANG MINH.

    did you press return after “sudo nvram nvramrc=’” /” select-dev” the way Andrew described up above?
    There are no > signs that you did.

  161. 161 Quang Minh

    I did pressed Return after each command, for example:

    Last login: Wed Nov 23 00:07:55 on ttyp1
    Welcome to Darwin!
    [iCouple:~] ngoquang% sudo nvram nvramrc=’” /” select-dev

    //After I pressed Return, I got this line below:

    tcsh: Unmatched ‘.

    Seem smth with my Terminal Setting :(. plz help me, thanks all !

  162. 162 sai from Indonesia

    Quang Minh (and emmm.. raminuri):

    Please see and read comment number 129 and 141 regarding Jeremy’s similar problem.. it informed that tcsh don’t match the script used ….

    Use bash instead … just got into terminal as usual (your’s will use tcsh) then write bash and press enter …. apply the hack … it should be done nicely ..

  163. 163 Quang Minh

    My Problem solved, thanks Sai :-)
    Btw, let say I disable SafeSleep, and even set nvram to false, the sleepimage (~1Gb for me) will be deleted automatically or have to delete it manually ?
    Thanks.

  164. 164 Jack Overfull

    SuspendNow! 0.6
    sunday i updated SuspendNow 0.6. Now the terminal becomes the active app when it asks the password and the installation process is more user-friendly.
    you can download it from http://www.jackoverfull.altervista.org/applicazioni/suspendnow/download.html

    for raminuri (and others interested)
    no, secure memory isn’t yer implementated in SuspendNow! 0.6, but I released a patch to enable it. you can download the patch here: www.jackoverfull.altervista.org/applicazioni/suspendnow/securepatch.zip (copy the link to the browser’s adress field if the download don’t start - it’s a limitation of altervista’s hosting service…).
    simply install 0.6 (or 0.5, if you prefer…) and extract the patch content to /Library/SuspendNow , then click “replace” and the secure vm support will be enabled (do not use the patch if you don’t use secure vm!).
    i’ll merge te patch in the next release…

  165. 165 raminuri

    Jack…THANK YOU.

    Since Andrew seems to be busy, would you mind looking at my question at No. 155 and tell me if it makes a difference WHEN USING SAFE SLEEP INSTALLED if you select the “put the hard(s) drive to sleep when possible” option.

    Do you know if the hard drive will go to Safe Sleep if you’ve opted to make Regular Sleep go to Safe Sleep automatically? [I want to replace Regular Sleep with Safe Sleep at all times, but I am not sure about that System Preferences option: “put the hard(s) drive to sleep when possible.” Will I screw myself up?]

    I know English isn’t your first language but you do a great job with it. :-) Much better than my Italian.

  166. 166 Andrew

    raminuri,

    I’ve played with Safe Sleep allot these days and they’ve all had the “put the hard(s) drive to sleep when possible” option enabled, and nothing has gone wrong yet.

    I want to replace Regular Sleep with Safe Sleep at all times

    Then you should be fine.

  167. 167 Sakke

    I googled a bit about Safe sleep in the Apple Menu. I found this: http://www.macosxhints.com/article.php?story=20050422121335362

    So, it is possible to easily remove an item from the menu, and it is easy to add menu items. What I don’t know is how easy is it to add the functionality to a new “Safe sleep” -item in the Apple Menu? That means there should be a Command-ID for the safe sleep, just like “slep” is for traditional sleep. I could try and quess “sslp”…

    Fruitmenu does something like that? So I just need to create a script that will put the machine immediately to safe sleep and link it (somehow) to a new menu item? I’m not going to pay 10$ for FM to do something once that I can(?) do myself :)

    I have one of the new 15″ PB’s that do ss out of the box, I just want to save the battery when I’m not going to use my PB for some days.

  168. 168 Sakke

    I can confirm, the command id is not “sslp” :)

    The menu part worked fine, I made the “Sleep” also “dynamic”, like the Restart and Shutdown items, so “Safe sleep” replaced “Sleep” when using the option key in the Apple Menu.

    A nice would-be-cool-to-have feature…

  169. 169 Andrew

    Sakke,

    Last week I was working on the StandardMenus.nib interface file mentioned in the above link, but I couldn’t find a working command-id for Safe Sleep. I don’t think there is one. Safe Sleep is just an extention of regular Sleep, so I doubt it has its own special command-id like ’sslp’ or ‘hibr’ etc., and there is no Apple documentation to show otherwise.

  170. 170 Joona

    149 Whosawthis,

    Restarting SystemUIServer works for me. After SystemUIServer restart icon is usable and Bluetooth works just fine with my cell. But I ran into another problem with BT after this. When my latest PB 15″ recovers from SafeSleep, I restart SystemUIServer and turn BT on blued process uses continously up to 50% of my CPU even if there’s no communication between BT devices. Turning it off fixes the problem. This is really weird, because normally blued doesn’t use much CPU even if Bluetooth is turned on and talking with another device.

    Is there other users experiencing this same problem?

  171. 171 Jestered

    Question for Jack Overfull…

    I got your SuspendNow app and have a question. In this article, at the top, it shows two ways of disabling Safe Sleep. One is to disable it and another is to do a full undo of Safe Sleep. Does your app do both of these? From what I can tell, I assume that the disable script in your app folder will disable it and the uninstall SuspendNow app in your folder will completely undo Safe Sleep. Is that correct?

    Thanks in advance.

  172. 172 Jestered

    I forgot to ask Jack Overfull my other question…

    Does your app enable SafeSleep as a secondary to regular sleep mode (used only when the battery is depleted)?

  173. 173 Jules

    Hey Andrew,

    I played with the safe sleep stuff and it worked great on my iBook G4 900MHz with 640MB RAM and OS X.4.3.

    However I left my computer on sleep mode while plugged to the ac power supply for a couple of days (without using it) and when I came back to turn it on the screen stayed black. So I restarted it and since then it displays the blinking folder with the question mark.

    Has anyone encountered that before? And could it be caused by a malfuntioning of this safesleep activation?

    I can boot my laptop from an external hard drive but I can’t see my current HD. I even cleared the PRAM, used the Installation CD to run the disk utility and finally used Disk Warrior as well but I can’t find my HD. I suspect that the filesystem is completely corrupted and I don’t know why and I don’t know what to do.

    Would you please have any suggestion? Could it be caused by this safe sleep thing? Is there a way to recover and reformat such an HD when it does not even appear?

    I look forward to hearing from you. Thank you and Happy Thanksgiving.

    J.

  174. 174 Jack Overfull

    for raminuri (165):
    thanks! ;-)

    for sakke and the others trying to add safe sleep to apple menu:
    i don’t have fruitmenu, but i think that you can link an app to a menu item, so why don’t link SuspendNow?
    another thing…
    there is also an app calledc “classic menu”, wich is the os 9 apple menu for os x, if you want. whit it you can add any app to the menu.

    for Jestered (171)
    no, the “disable safe sleep” script does a full undo, the “remove suspendnow” simple moves all suspendnow files to the trash.
    if you try to start suspendnow after the undo your mac will simple go to stop.

    172
    yes

    for everyone
    i just completed a new version that will have some important improvements. if i’ll have the time i’ll release it tomorrow.

    ps
    is there anyone whit graphics capabilities that would make an icon for SuspendNow?

  175. 175 Jestered

    Jack O,

    About your icon, email me at byron.shaheen@gmail.com and give me an idea of what you want for the app icon.

  176. 176 Jack Overfull

    SuspendNow! 0.7 released:
    new features:
    -Drag’n'Drop installation.
    -The password is always asked for one time.
    -The password is asked graphically.
    -The Terminal application is no longer directly used: SuspendNow! now open a new Terminal session and closes it at wake up.
    -Secure Virtual Memory patch is now included on the disc image.
    -Safe Sleep enabling/disabling with a double click.
    -Now SuspendNow! and the support applications are fully localized in both English and Italian.
    -Also some minor improvements…

    you can download it directly from my applications page: http://www.jackoverfull.altervista.org/en/applicazioni/index.html

  177. 177 Nik

    Jack, SuspendNow! causes some trouble.

    The password is requested twice (once at run, graphically, and then again in a background terminal window). Also, it quits the terminal application if it’s already open when SuspendNow! is run.

    Otherwise it works just fine.

    Any chance you’d be willing to make the source code for your program available? I’m curious how you’re doing this little trick. Looks like a before/after sleep script is required to make it all work. Is that correct?

  178. 178 Jack Overfull

    it isn’t normal. is suspendnow installed in the pplications folder?

    the source are available: it’ applescript and shell scripting…

  179. 179 Gawin

    Works on a first generation PowerBook 17″ (1 GHz).

    The best part is that I use 2 Gb of high preformance RAM, wich in normal sleep mode sucks my battery empty within 8 hours. But with the safe sleep mode this problem doesn’t occur :)

  180. 180 Gawin

    Bluetooth problem solved

    Using a PowerBook 17″ (1 GHz), 2 Gb RAM, OS X 10.4.3 if also found the Bluetooth bug:
    After waking the laptop to safe sleep bluetooth doesn’t work anymore.

    I found a sollution in disabeling the “Allow Bluetooth devices to wake this computer”. This can be found in System Preferences > Bluetooth > Settings.

    Hope this helps, works great for me.
    (Tested with bluetooth on and off, safe sleep, normal sleep and reboots)

    [Andrew asks: Gawin, Could you please leave your real email address next time so that I can send you a thank-you note? Thanks for the help. Seems to work well.]

  181. 181 Blog-A-Drew

    […] Any Mac with new enough software can now do safe sleep (bit like Hibernate on Windows) It involves fiddling with Terminal so be careful. How To […]

  182. 182 Tony

    This worked on my eMac 1.25GHz with 10.4.3. No problems whatsoever.

  183. 183 Heison Chak

    nice hack! works fine on my powerbook…. 1.67GHz on 10.4.3

  184. 184 Murthy

    I was trying to get to work with mac mini 1.5Ghz machine. The machine never seems to go into safe sleep. The light keeps pulsing. i have used the hibernate option 1. but still no luck. what could be the problem? SuspendNow does not seems work. Did any one face similar problems?

  185. 185 Murthy

    Failed to mention the problem in the previous post. The sleep light stays on and the screen goes blank. and nothing seems to happen. If i switch it off using the powerbutton or pull the power, it restarts normally (as if a powerdown).

  186. 186 Jack Overfull

    for nik (117)
    do you have growl installed?

  187. 187 Jack Overfull

    for everyone:
    if ypu have an old version of growl installed, it has probably a bug that causes the nik’s problem in SuspendNow! 0.7. updating growl to the latest version should fix this problem.

  188. 188 Bobbes

    it works fine on powerbook 12″ 1,33GHz 1,25GB RAM!
    thankx!

  189. 189 Craig

    Works beautifully on my G4 Powerbook 1.33ghz! It was quite odd seeing my powerbook somewhat seems to ‘pulse’ the sleeping light for ages after taking the power plug and battery out. I swore my powerbook runs on air…

    Excellent quick hack. Seems dead chuffed seeing it loading up after boot :D

  190. 190 Heison Chak

    What a brilliant feature! After a recent memory upgrade, /var/vm/sleepimage changes according to the installed memory.

  191. 191 Joona

    I’ve made a simple Bash shell script which can be used to put your mac to SafeSleep manually, without replacing normal sleep mode with SafeSleep mode. It doesn’t even need root access, which makes it simple to run. I’m also planning to build Dashboard Widget for easier use.

    The script can be downloaded from
    http://joona.fiveam.org/snippets/safesleep.sh

    You can also take a look at the source at
    http://joona.fiveam.org/snippets/safesleep.txt

  192. 192 Jack Overfull

    graet work, Joona!

  193. 193 Alexey

    Hey, Joona.
    Nice work.
    Can you describe “5 sec” pause? Is it memory dependant or so?
    i have 1.67Ghz 2Gb RAM PowerBook. Do i need 5 sec or 10 sec or …

    And one more Q to all… SafeSleep works good for me for about 2 weeks… Now when i wake PowerBook i saw progress bar and when it comes to 100% PowerBook just turs off!!! Like if i remove AC plug and all batteries it have :( After that i can boot it normally…
    So i’ve disable safesleep totally and looking for addinfo about it.

  194. 194 Dominic

    this is great, but i cant seem to have safe sleep and screenspanning on my iBook:1.2 80gig, 768.

    i install one and the other fails,
    i tink its something to do with ‘clamshell mode’ ishall do some tinking to see if i can get them both to work, and ill let you know.

  195. 195 Jack Overfull

    New SuspendNow! version: 0.8
    What’s new:
    -Is no longer required to insert the password to use SuspendNow!
    -Disable Safe Sleep patch Improved.
    -Removed some obsolete parts.
    -Some speed improvements.
    -Finally has an icon.

    enjoy!

  196. 196 Michael Long

    Awesome. Thanks for the tip.

  197. 197 Dominic

    Hi -update on the dual-head|(screen spanning) in compatability.

    I found scripts that after enabling the above patch, can enable both screen spanning and safe sleep.

  198. 198 ulf

    the german computer magazin c’t recently published a nice article about safe sleep for “older” macs. i also published a small article about that on my private blog and also posted a small script, written by the author of the original article in c’t, for download. it’s in german, but not hard to understand. this script does all the work for you, so you do not have to touch your mac’s firmware.

    have fun
    ulf

  199. 199 Caius Durling

    Turns out that the powerbook 12″ had a faulty logic board. Took it into the Apple Store Manchester and they sent it off for a reed switch replacement, ended up replacing the logic board!

    Just installed front row, about to activate safe sleep and hope for the best!!

  200. 200 William Griffiths

    Damn! This is really bugging me! I have tried it countless times on my Powerbook 15″ 1.67Mhz with 1GB of Ram and it will NOT work. It is as if nothing has been changed. Why isn’t it working?

  201. 201 Orsodimare

    It doesn’t seem to work on my dear Pismo…

    Just a question: is it normal that “man pmset” doesn’t list the “hibernatemode” variable? is it an “hidden” one?

    Anyway I always get a “…. kernel[0]: System Sleep” and no /var/vm/sleepimage is created (I just have a swapfile)…

  202. 202 Jack Overfull

    Orsodimare,

    No, it will not work on any G3. Sorry.

  203. 203 reeks

    Just hacked and seems to be working fine. Specs:

    Powerbook 12″ 768 MB
    Sleep time: 7-8 secs
    Wake up from Safe Sleep (after removing the battery): 18 secs

    just a warning: this doesn’t work if you just pull the battery, you need to sleep the machine first (found out the hard way, makes sense of course)

  204. 204 Will

    Hi,

    Got it working! I guess I was lucky!

  205. 205 Charlie

    didn’t work on my (new) ibook g4 w/ 10.4.3???

  206. 206 Chris

    I have a rev. B imac G5 andAs noticed with other users of the imac G5, it has not recognised the
    “sudo pmset -a hibernatemode 3″ command to create the image file. has anyone with the imac G5’s got it to work so far or is it a no go? also, is it possible to enable both normal and safe sleep modes at the same time and have safe sleep as a shutdown option like hibernate in windows XP? this would be great if possible as it’s not really useful to desktop users if they have to unplug their computer to get a result.

  207. 207 Jack Overfull

    Cris, you can simple installa SuspendNow!

  208. 208 Thinh Q. Thang

    Does not work on a 700mhz G3 14″ iBook.

  209. 209 Manoj

    Upgraded to 10.4.4 and it’s broken there. Looks like 10.4.4 replaced the AppleUSBOHCI and the new one cannot handle hibernate. After booting off the hibernate image I keep getting this message:
    kernel[0]: USBF: 391.468 AppleUSBOHCI[0×1eab000] Watchdog detected dead controller (hcca #: 60865, hc #: 60895)

    I even created a fresh sleepimage and did everything from scratch, same result. Very consistent.

  210. 210 Jack Overfull

    Strange…
    On my iBook it works perfectly on 10.4.4…

  211. 211 Manoj

    I have a powerbook G4 1.5GHz. Should be the same behavior as a iBook isn’t it? Did you follow the same instructions as here?

  212. 212 Manoj

    I went through these post again, and noticed that allowing bluetooth devices to wake up the machine could be a problem. Disabled that and it worked. Wonder how this worked before!!

  213. 213 Josh

    Nice hack! Worked fine on my 17″ G4 Powerbook (1.5GHz Model) running 10.4.4. Thanks for the info.

  214. 214 Santiago

    I’m using a iBook G4 and works perfect… I would like to know: with the normal sleep the hard drive stop working? Because I used to put my iBook to sleep and then move it all around, but somebody told me that this might damage my hard drive… Sorry if i wasn’t clear with my question but my english isn’t very good… Sorry!!

  215. 215 James

    10.4.4 seems to have broken it on my 1.67 Al G4 Powerbook. It sleep fine, and then boots but the trackpad is then non-functional and the only way to get it moving again is to restart the whole system.

    I’ve had to disable it now which is a pain…

  216. 216 radical_tyro

    I’m having the same problem as James. 10.4.4, 1.67 Ghz Al. My errors look like this:

    configd[31]: AppleTalk shutdown failed, status = 71 (retrying)
    kernel[0]: : failed to write to I2C
    configd[31]: AppleTalk shutdown
    kernel[0]: AMS::clearInterrupt ERROR: failed to write the bytes, retval = 0xe00002d7
    kernel[0]: AMS::freeFallIntHandler ERROR: failed to clear the interrupt, retval = 0xe00002d7
    kernel[0]: IOI2CDevice@b0::readI2C device is offline
    kernel[0]: AMS::readBytes ERROR: failed to read from I2C
    kernel[0]: AMS::freeFallIntHandler ERROR: failed to read the byte
    kernel[0]: IOI2CDevice@b0::writeI2C device is offline

    …. a lot more I2C errors ….

    kernel[0]: USBF: 314.215 AppleUSBOHCI[0×1f39800] Watchdog detected dead controller (hcca #: 55640, hc #: 56570)

    The OS seems to be running fine but I have no keyboard or trackpad control.

  217. 217 Brian Mikol

    PB 15″/1.67/1GB/10.4.4 (purchased right before current rev)

    Sleep: 9 seconds
    Wake: 58 seconds

    One thing I did notice is that I think how many applications are running at time of sleep affects the wake time (which does make sense to me; the more you need to write to the HDD, the longer it’ll be to read). Reason why I say that is because when I did the “dry run” when I had the hibernatemode set to “3″, it took a while for the flashing sleep light to die (sorry, I didn’t time it), but waking was extremely fast (again, didn’t time it, but I’d say it was under 10 seconds).

    Difference? The dry run only had Terminal and Console open. The aforementioned times were when I changed the hibernatemode to “1″ and had Entourage, Safari, Firefox, System Preferences and Terminal open.

    Thanks for the great instructions Andrew!

  218. 218 patrick

    Confirmed that it works on a Mac Mini 1.42 after updating to 10.4.4.
    I tried it and the first attempt caused the system to hang when resuming, after rebooting it recovered normally and the error shown in the error log was the same as Manoj was seeing. After deselecting the option to allow a Bluetooth device to wake the machine, it resumes fine and safesleep is working like a charm.
    About 5 seconds to sleep (until the power light turns off), and 15-20 seconds to resume with mail, safari and ical running. Very cool….

  219. 219 Matthias

    iMac Core Duos

    This also works on the new iMac Core Duo machines. You can skip the first few steps and just do the psmet step.

  220. 220 Ramon

    Doesn’t work on a TiBook 400Mhz. When sleeping the machine shuts off after a while, but doesn’t boot up from the “image”. Just a regular boot and all clock settings and the like are gone.

  221. 221 kenny

    Hmm It works very well onn my pb 17″ with 1.67Ghrz. BUT..
    I set the settings so that my pb would always use safe sleep instead of regular sleep, but sometimes this feature is disabled by itself and I always have to go back to the terminal and type “sudo pmset -a hibernatemode 1
    ” again wich is getting kind of frustrating, what did I do wrong?

  222. 222 Anonymous

    It works quite nicely on my 17 inch 1 ghz FP iMac.

  223. 223 William

    Works on my 12″ PB (867) but when it starts up it doesn’t show a grascale image of the desktop, but the normal grey apple (with the loading bar). any ideas?

  224. 224 sairez

    I’m looking for a way to basically save my OS X session, with the state of all my applications intact. Sometimes I need to restart the computer, either because of a crash or a new install, and I want all the unaffected applications to be able to restart in the state they were last in. Is there any way to do this? I’ve been searching and searching to no avail to find software capable of this. This safe sleep seems to be the closest thing I can find because it saves the entire state of your system. Please help if you can =)

    Thanks!

  225. 225 RichMoog

    I tried this on my Powerbook 15″ 1GHz/867MHz:

    Machine Name: PowerBook G4 15″
    Machine Model: PowerBook3,5
    CPU Type: PowerPC G4 (3.3)
    Number Of CPUs: 1
    CPU Speed: 1 GHz
    L2 Cache (per CPU): 256 KB
    L3 Cache (per CPU): 1 MB
    Memory: 1 GB
    Bus Speed: 133 MHz
    Boot ROM Version: 4.5.3f2

    It didn’t work!? I’m using 10.4.4. Could this be the reason??

  226. 226 Jack Overfull

    @ william (223)
    do you have the 10.4.4? on this system something i noticed strange things like that…

    @ sairez (224)
    i don’t know, sorry.

    @ RichMoog (225)
    safe sleep is incompatible with 867 powerbooks, sorry.

  227. 227 Andrew

    Updating to 10.4.4 seems to undo safe sleep, but following the instructions again will get it working. Has anyone else had this happen?

  228. 228 Fergus

    Worked on my 1.42GHz iBook with Mac OS X 10.4.4, however the trackpad was paralysed when the computer woke from safe sleep. Had to use the keyboard to restart.

  229. 229 AssetBurned

    Same here on my 1.33GHz ibook :-( it works fine on 10.4.3 but not with 10.4.4. crap i really liked that tool.

  230. 230 AssetBurned

    correction: after switching of the “let bluetooth devices switch of the sleep” everything is fine now, but it has worked on my old 10.4.3 system.

  231. 231 AssetBurned

    by the way, there is a widget called DeepSleep which put the Mac into the Hibernate mode.

  232. 232 QuarterSwede

    Beautiful, simply beautiful. I won’t have to worry about a kernel panic after my battery dies while in sleep mode again (not that it ever has, but still!). Thanks a ton!

  233. 233 QuarterSwede

    Forgot to state that I have a 12″ 1.5GHz PowerBook G4, 512MB and that it has worked perfectly so far. Thanks.

  234. 234 priti

    PowerBook 12″, Aluminum, 1.25GB
    Installed on OS X 10.4.3 was working well. After upgrade to 10.4.4 and also 10.4.5 whenever waking up from deep sleep the mouse does not work. Everything else is OK. The mouse means the touch-pad or any external too. Other USB devices are working. So essentially have to restart the computer. What can I do? Any solution?

    How to delete/rebuild the /var/vm/safesleep?

  235. 235 Jaffa

    Works perfectly on my 12″ 1.5GHZ PowerBook G4.

  236. 236 Aaron

    I’m having the same problem as #234 priti
    After waking up my MacMini from safe sleep mode the keyboard & mouse are unresponsive. I’m runing 10.4.5 and the keyboard & mouse are plugged into the Cinema display’s USB port. Anyone know the why 10.4.5 update causes this USB problem, and is there anyway to worj around it w/o having to HardBoot?

  237. 237 Alexander

    I did as you told, but then realized that this permanently shrinks your HD by 1GB. I use safe sleep not often enough to justifiy this, so I proceeded as described in “Disable Safe Sleep” (Both commands). But, to my dismay, the sleepimage is being recreated, whatever I do. Any ideas?

  238. 238 Josh

    I came here for clues on how to accomplish the opposite of what everyone else is doing.

    I have the latest (and last, for that matter) 15″ PowerBook G4 Aluminum (Dual-Layer SuperDrive/1440×960 Screen/Oct. ‘05), which comes with Safe Sleep turned on by default. I want to TURN OFF the feature, because I don’t really need it, and the associated “sleepimage” file is eating up 1.5GB (equivalent to my RAM installation) of precious disk space.

    I executed “sudo pmset -a hibernatemode 0″ and “sudo nvram “use-nvramrc?”=false” in Terminal and confirmed they took effect with “pmset -g” and “nvram -p”, even verifying the contents of ” /Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist”. Then I removed the “/private/var/vm/sleepimage” file.

    However, upon every reboot, the 1.5GB “sleepimage” file is recreated.

    Any clues on how to ensure the file is not created unless the feature is turned back on? (I am running 10.4.5, BTW.)

  239. 239 Alan

    Works like a charm on a PB G4 1Ghz - seemed like it slept immediately (no kidding, pulled the battery and the light went off instantly. So fast, in fact, I thought I’d screwed up the activation.)

    Wake took about 20 seconds, all told. Brilliant.

  240. 240 Ryan

    PowerBook G4 12″ 1.5 GHz
    I am also having some problems after the computer wakes up from safe sleep with the mouse/trackpad not working properly, however the keyboard is responsive. (Similar issues as priti 234) Help.

  241. 241 Colin

    AWSOME!!!

  242. 242 Heli

    I also have this keyboard and trackpad problem with my new PB 15″. It goes to safe sleep mode without problems. When I try to wake it up the screen wakes and the everything goes fine until I should use mouse or keyboard. Nothing happens. Also the screen is frozen. When I press power button the shut down screen comes to the screen but I can’t do anything. Only rebooting with forcing helps and PB works fine again - until next safe sleep session. Can’t understand how to fix this.

  243. 243 vbrtrmn

    Just tried on my new MacBook Pro, worked great, thanks!

    CPU: 2GHz Intel Core Duo
    RAM: 2GB DDR2
    OS: OS X 10.4.6

  244. 244 Mark

    I’m currently having trouble trying to wake up my PB G4 from sleep mode can anyone help? I’ve tried taking out the battery and popping it back in but that doenst seem to help. power on/off doesn’t work either.

  245. 245 Vermilion

    I’ve got a PowerBook G3 Pismo (PowerBook3,1), but I can’t get Safe Sleep to work; the /var/vm/sleepimage file is never created. I tried touching that file, but it still doesn’t enter Safe Sleep.

    Someone said that G3’s and KeyLargo ATA controllers don’t work with Safe Sleep, but there have been so many reports of this working on G3’s. Who do I believe and how do I get this working?

  246. 246 Paul Yaconelli

    > Similar to Sleep, Windows “Hibernates,” while Linux “Software
    > Suspends”. They are not as fast as Sleep mode

    You’re mistaken about Windows, which has both ‘Sleep’ (called ‘Suspend’) and ‘Hibernate’ options.

    Suspend mode in Windows is just as fast as the Mac’s Sleep mode.

  247. 247 Rob

    My iBook G4 (3 month old) sleeps, (I did the 1 variation in which it goes to Safe Sleep right away), the light at the front does not work. Opening the lid doesnt wake it, any keys dont wake it, the only way to wake it up is to “Power key” it. Without the battery, the keyboard doesnt respond. Any ideas?

  248. 248 Sophi Aran

    Well, I know this post is a bit old, but just wanted to confirm that SafeSleep with secure virtual memory DOES indeed work with no apparent issues on my Jan. 2005 AlBook. With SafeSleep enabled and normal Sleep mode bypassed, the system takes approx. 5 seconds to fully shut down, and under 10-15 seconds to restart. And I’m quite impressed with the blank screen that Apple put in place if you lock your computer :)

    The only real gripe which has to do with the hardware reinitializing upon waking is the slightly unresponsive keyboard at first. But all in all, a wonderful trade off if you don’t want your poor Book dying on you on a long trip (or, if you’re like me, forgot to charge the battery before you left…)

  249. 249 Mike

    This is great! I was hesitant to try it with my old iBook G4 (800 MHz) since I have the dual-head display hack enabled. However, it worked like a champ! My battery is pretty much shot and sleep does eventually drain it (after about 24 hours); since updating to Tiger I have had tons of problems waking the laptop from sleep - it locks up about 50% of the time. I found myself wishing there was something like the Windows “hibernate” for the Mac and this is the perfect solution. So far no problems. Thanks!

  250. 250 Josh

    I’m going to take a wild guess, but this probably won’t work on an Intel base Mac Correct? (Probably because of the EFI)

  251. 251 Josh

    OK, I take that back. It does work on the Intel Mac Mini. Thanks again for the tip!

  252. 252 Chris

    Like Josh (of the comment Feb 24, 2006), I also wanted to turn off Safe Sleep. I have a new MacBook (not Pro) and used “sudo pmset -a hibernatemode 0″. It seems to be working fine. Now my MacBook goes to sleep right away instead of running the HD for 20 seconds or so.

    Also, I deleted /var/vm/sleepimage and it hasn’t come back on it’s own (yet). So that gives me 2 GB more space on my HD.

    No promises that it’ll work for you, but it seems to have worked for me!

  253. 253 Ryan

    Anyone know of a similar method to this, except one that allows you to boot off another partition? I’m on a 2.0 MBP, with Windows on another partition. I was thinking it would be really sweet if I could hibernate mac, boot windows, hibernate windows, restore mac, etc etc. Any ideas on this would be wonderful, and as I may not see them here, feel free to email to mbp at rsande dot com

  254. 254 Mark

    Works great on my 1.07 ghz iBook. One time an update broke it and i just had to redo it, worked fine after redoing it.

  255. 255 Sebastian

    it worked great until i discovered that dual monitor spanning ceased, do you know why??:

  256. 256 RichB

    Tried it on a MacBook (2Gb). The screen was totally blank (except for mouse pointer) during the hibernation process. Returning from safe sleep, there was a grey screen with a progress bar and finally the login dialog appeared. However, the keyboard refused to work. I changed focus between username and password and the keyboard began working again.

    So, not totally successful.

  257. 257 JohnnyG

    Worked great on my PowerBook G4 12″ 867MHz running 10.4.7 with ‘Secure Virtual Memory’ un-checked.. No side effects; Fan still works; Keyboard and mouse pad work fine after coming out of ‘Safe Sleep’.

  258. 258 JohnnyG

    Sabastian: Did you try Matt’s solution to using Safe Sleep with dual-head solution? http://matt.ucc.asn.au/apple/machibernate.html#makeitwork

  259. 259 Sebastian

    Thanks, i will then uninstall the dual spanning hack and use the hibernate and dual monitor hack instead

  260. 260 Matt

    Anyone think this may be a feature of leopard - added to all macs?

  261. 261 Ola

    Works like a charm on my MacBook 13″ - right out of the box with 10.4.7. Very handy feature!

  262. 262 Vermilion

    It also works like a charm on my 17-inch MacBook Pro (2 GB RAM), right out of the box, also 10.4.7. It also seems to work when the power cord is plugged in.

    Ryan (254): With regards to sleeping Mac OS X and booting Windows, try installing rEFIt in the EFI partition of your hard drive. That will cause rEFIt to load every time you start up your Mac (it’s a boot menu, basically). In theory, that would allow you to sleep an operating system (Mac or Windows) and then wake up the other. I’d try it myself, but I don’t have enough room on my hard drive for a second OS (100 GB, 3 GB free).

  263. 263 Da Wookiee

    Since I just removed the battery from my pb 15 hires DL, this is seriously useful. I’m running 10.4.7 and it has worked (so far) without a hitch.

  264. 264 Miguel Rubio

    Just some timings on a Macbook 13.3″ 2Ghz Intel Core Duo with OSX 10.4.7 and 512MiB RAM

    on hibernatemode 1 (safe sleep)
    9 seconds to shutdown
    21 seconds to wake up from safe sleep

  265. 265 Bernhard

    I set the hibernatefile value to empty to get the sleepimage file not being recreated after disabling hibernation:

    sudo pmset -a hibernatefile ""

  266. 266 Ruq

    Works great on my MacBook. Also learned that I can swap batteries in regular sleep.

    Thanks Andrew

  267. 267 Abysmal

    The trick even worked on my Intel Hackintosh.. Hey Andrew.. all of the sleep problems you were having with my machine was due to a bios power setting..

    Once changed the unit powers off completely and comes back to life in 10-12 seconds.. I just don’t get the lovely little countdown bar..

    Abysmal

  268. 268 Gavin

    Works like a charm on my Macbook with 1GB RAM and Tiger 10.4.8. Thanks for the tip!

  269. 269 Steven Buehler

    Works flawlessly on my 1.83 GHz MacBook as well (1 GB RAM, 10.4.8). I had tried this on my previous laptop (1.2 GHz iBook G4, 2nd to last version) and ran into issues, but it worked great on the MacBook. This is one of those features I really wish Apple would have made easily available.

  270. 270 Olivier Daigle

    I just tried it on my new MacBook Pro core 2 duo 2.13 GHz with 2 GB of RAM and it works fine!

  271. 271 ShickFaced

    This is an amazing little hack and it is so helpful. I tote my MacBook from class to class and it is nice to have no power consumption or threat of overheating in its bag when I close the lid.

    here is just one little problem that I am having. I use the setting for secondary click with a two-finger trackpad tap. When the computer is awoken from “hibernation”, the two-finger tap will not act as a secondary click. When I check the setting in System Preferences, the box is still checked. Simply unchecking and rechecking the box solves the problem, but it is slightly inconveniencing to do that each and every time.

    I also found that the setting itself is stored in the .GlobalPreferences file in ~/Library/Preferences/ but even that plist file reflects that the setting is enabled even though it does not work. Oddly, however, changing the plist file to disabled (0) and back to enabled (1) does not do it. I feel like the change is only reflected when the system is asked to realize it or something. I am really not sure. I have tried killing Finder and a few other things and yet the change still is not reflected in the system unless the box is unchecked and checked again in System Preferences or the computer is fully restarted.

    Any ideas for a solution or even a workaround? Thanks.

  272. 272 David Novosel

    Hi, I also have a Macbook (2.0GHz, 2GB RAM) running 10.4.8, and I have the same problem you have listed, with the ‘two-finger’ tap not working correctly after I come out of hibernation. I rarely hiberante, so personally I just bite the bullet, and live with going through the System Preferences to fix it, but any thoughts on a fix would be nice.

    Thanks.

  273. 273 Norm Fishman

    Have a Powerbook that was going into safe sleep when put to sleep - used the terminal to turn off safe sleep and BINGO it now sleeps!!!!

    Thanks

  274. 274 basiloungas

    Works almost perfectly on my 12″ G4 PB 1,33GHz model.
    I ran the script from Matt Johnston’s site, rebooted (it wouldn’t work without rebooting) and then it just worked!
    It took some more time to sleep when safe-sleep was enabled (8-9 secs) with my 768 MB set-up.
    The only problem is the bluetooth. After safe-sleeping, removing the battery, installing it again (power cord off of cource) and starting the machine, the bluetooth isn’t available.. I hope this will be fixed after rebooting or else.. :)

  275. 275 fabera

    ShickFaced,

    I use AppleScript to recover two fingers click. It does exactly same thing for the enable/disable trick. Hope it save you some time before Apple solve this problem. (GUI Scripting should be enabled. Open AppleScript Utility to enable it.)

    open script in Script Editor

    tell application “System Preferences”
    activate
    set current pane to pane “com.apple.preference.keyboard”
    end tell

    tell application “System Events”
    tell process “System Preferences”
    tell tab group 1 of window “Keyboard & Mouse”
    click radio button “Trackpad”
    end tell
    tell group 1 of tab group 1 of window “Keyboard & Mouse”
    click checkbox “Place two fingers on trackpad and click button for secondary click”
    end tell
    tell group 1 of tab group 1 of window “Keyboard & Mouse”
    click checkbox “Place two fingers on trackpad and click button for secondary click”
    end tell
    end tell
    end tell
    tell application “System Preferences”
    quit
    end tell

  276. 276 MCF

    Just tried your script fabera, but didn’t work initially… first of all, had to convert quotes from smart quotes, into straight regular quotes. Secondly — and for my machine at least (MacBook) — I needed to change “Place two fingers on trackpad and click button for secondary click” to: “Tap trackpad using two fingers for secondary click”.

  277. 277 augustd

    Confirmed that this method does work on a Core2 Duo PowerBook.

    For those of you who forget whet the numbers mean, here is a bash script to switch from normal+safe sleep mode to safe-only sleep mode. Save the following as setSleepMode, make it executable, then you can type:

    setSleepMode normal
    setSleepMode safe

    -to switch back and forth. Here’s the script:

    !/bin/bash

    test $# -ne 1 && \
    echo “Usage: setSleepMode normal|safe” && exit 1

    if [ “$1″ == “normal” ]
    then
    sudo pmset -a hibernatemode 3
    else
    if [ “$1″ == “safe” ]
    then
    sudo pmset -a hibernatemode 1
    else
    echo “Usage: setSleepMode normal|safe” && exit 1
    fi
    fi

    exit 0

  278. 278 Stev

    Can someone please help.:-) Know this might be the wrong place to start this. Since it was talking about sleep I was hopeing for some help.

    System is running 10.3.9 new install and new HD, G4 dual with 1gb of ram.

    When the system is put to sleep and then awakened it takes about a minute plus for the mouse/pointer to come back. any suggestions ?

    all external stuff has been taken off ie. USB Hus ect.

    Thanks in advance

    Stev

  279. 279 ShickFaced

    Thanks a ton. This is great. I am sorry for not responding sooner, but I have been flooded with schoolwork. I completely forgot that AppleScript supports GUI access. Great thinking and thanks again.

  280. 280 someguy

    It doesent seem to work on my Imac G3… This is what console says:

    Mar 10 14:13:22 (My computers name) sudo: (My name) : TTY=ttyp1 ; PWD=/Users/(My name again) ; USER=root ; COMMAND=/usr/sbin/nvram use-nvremrc?=true

    (Just alot of nonsense)

    Mar 10 14:13:22 (My computers name) sudo: (My name) : TTY=ttyp1 ; PWD=/Users/(My name again) ; USER=root ; COMMAND=/usr/bin/pmset -a hibernatemode 1

    (More nonsense)

    Mar 10 14:24:40 (My computers name) kernel [0]: Sysem Sleep
    Mar 10 14:24:40 (My computers name) kernel [0]: System Wake
    Mar 10 14:24:40 (My computers name) kernel [0]: Wake event 0020

  281. 281 Alexis

    Beautiful! works super in my Macbook 13′ Core Duo,thanks!

  282. 282 Almir

    Matt’s dual head + hibernate solution works fine on my iBook G4 1.33, didn’t even need to uninstall screenspanning doc (wich I used before), great new unauthorized apple power!

  283. 283 Alja

    iMac Core Duo, Mac OS X 10.4.9 …perfect!

    Thanks

  284. 284 gmm

    I can confirm that it does not work on my PowerMac G5 dual 2.5GHz. Such a shame. I am always turning off my computer and turning off the powerstrip to save power.

  285. 285 Pixilarion

    Works perfectly on my iBook G4 (800 MHz)

  286. 286 Grzegorz Dymarek

    If you want to have the possibility of choosing between hibernate and sleep the simplest way is to create a hibernate script.
    It assumes that you have the following line in /etc/sudoers:

    ALL = NOPASSWD: /usr/bin/pmset -a hibernatemode 0, /usr/bin/pmset -a hibernatemode 1

    Where is your login name.

    After you have it and did all the steps in this article create a file ‘hibernate’ with the following content:

    !/bin/bash

    sudo pmset -a hibernatemode 1
    osascript

  287. 287 KiRest

    Great, works perfect on my MacBookPro 17″. fairly easy to set up as well :)

  288. 288 KiRest

    Great, works perfect on my MacBookPro 17″. fairly easy to set up as well :)

  289. 289 brian

    Works wonderfully on a 12″ 1.33 GHz G4 PBook purchased in 2004.

  290. 290 Jason Grant

    Wow thanks very much workk the bomb :)

  291. 291 Miroslav Beranič ml.

    Works “out-of-box” with my Quad-Core MacPro (model 2006). Thanks a lot!

  292. 292 Adam

    Worked first try on my 1.25ghz emac

  293. 293 agent smith

    Works fine with my PowerBook G4 5,8 (1,67 GHz DL SD). Does not work and application closes on my iMac G5 20″ 2.1 GHz Rev. C. Both on OS 10.4.9

  294. 294 olaf

    works “out-of-the-box” with my 8-core / 8 gb ram macpro running 10.4.10

    thanks a mil, helps me save the planet ;o)

  295. 295 jadevideo

    Doesn’t work on my G5 DUAL Powermac.
    Probably the Applekauaiata driver is not kompatible to the S-ATA Technology which are installed on G5 Systems. This is my optinion.

    If there is anybody outside who has on his Powermac G5 safe sleep/hibernatate successfully running kindly please inform me on my emailadress nodojo(at)web.de how to.

  296. 296 Eric

    didnt work for me, i have a 1.2 Ghz 12″ iBook G4, when I restarted it gave me the happy mac icon but i fixed it by starting up holding Cmd+Option+P+R

  297. 297 pagocs

    Works fine on my PowerBook G4 12″ (1.5 GHZ).

  298. 298 Frank

    Hey,
    Does not work on my 1,5 GHz MacMini (G4). Tried several Patches. Growl re-/uninstalled and updated. Crashes in to safesleep no systemlog. No safe sleep in systemlog. System seems to chrash after entering Sleep. Any ideas ???

  299. 299 DrYoung

    Great hack :)

    But it would be much better if I could do the following. Close the lid (I have
    MacBook 13′’ 1GB) -> computer goes to normal sleep for predefined period,
    say 15-30 min. After this period it goes to a safe sleep.

    Any ideas how I could do this?

  300. 300 Alexis Chazard

    @DrYoung: Well, I may be wrong but I think regular sleep mode interrupts PIDs at kernel level, so a shell script of some sort shan’t be helpful enough… But as the hardware itself is still on, something might be doable in Open Firmware.
    Undoubtly OF is well-documented, but for enabling such thing not only a routine should be put somewhere (firmware hacking ?) but also a flag should be set to tell the routine it must run at sleep, and check, also in a permanent registry like nvramrc, the delay before switching from regular to safe mode. A tremedous work actually, so one shouldn’t expect to see that in any near future. Ah, if Apple thinks it’s a good idea to develop, why not ;D ?

  301. 301 Lele

    Hi, I have a rather simple question. All I want to do is to prepare a safesleep “boot-image” for my mac mini so that when I start the computer I have all my programs and settings opened and ready to use. Of course I also need an “emergency” option for regular boot if the image is corrupted of if I need to update it. Anybody knows how to do this?in brief:

    1) make an hibernation image with the current desktop?
    2) modify some parameters, so OSX will either do a normal boot or will load my image?

    Thanks a lot! If you have ANY idea PLEASE let me know
    cheers

    Lele

  302. 302 syntic

    hey nice hack it worked perfectly with my new MacBook.
    thx a lot.

    Now i can say for sure that i never will take a windows instead of a mac.
    Later!
    syntic

  303. 303 martin

    worked on my PowerBook G4 (Model PowerBook5,6) running Leopard, but after waking it cannot find keyboard, touchpad and bluetooth.
    i only tried hibernatemode 1, maybe mode 3 works better …

  304. 304 martin

    ok i have the same problems after waking from mode 3. but using mode 3, i can go to normal sleep and after waking up from normal sleep, keyboard, touchpad and bluetooth are working agin …

  305. 305 leonardo

    same problem here, powerbook g4 1.5ghz, wake up from mode 1 gives me no mouse or keyboard (external mouse works) will try mode 5 (secure)

  306. 306 Tony Edgecombe

    Works on a 20″ iMac Intel Core 2 Duo although if I leave my iPod plugged in it pops up an error about device removal.

Leave a Reply