Previous 1 2 Next 22 Replies Latest reply: Feb 7, 2015 9:01 AM by Casio Speedwagon Branched to a new discussion.
garbor Level 1 Level 1 (0 points)

I did the update 2.0 today and I noticed that hibernate mode has been set to enabled. So I deleted the /private/var/vm/sleepimage and disable hibernatemode like this :

 

sudo pmset -a hibernatemode 0

 

But the problem is that hibernate mode is automatically set to 3 when I shutdown my macbook air or I reboot it. Anyone has the same issue ?


MacBook Air (13-inch, Mid 2012), OS X Mountain Lion (10.8.2)
  • garbor Level 1 Level 1 (0 points)

    Ok so I managed to solve my problem. Basically, I couldn't prevent the sleepimage to rebuilt even though my hibernate mode is set to 0, I don't know why but now my sleepimage weights 0 byte instead of 8 gigs. Here's the deal :

     

    First, disable hibernation mode :

    sudo pmset -a hibernatemode 0

     

    delete /private/var/vm/sleepimage :

    sudo rm /private/var/vm/sleepimage

     

    create an empty file and name it 'sleepimage' :

    touch /private/var/vm/sleepimage

     

    change his flag to immuable :

    chflags -uchg /private/var/vm/sleepimage

     

    That's it ! Now, OS X won't be able to rebuilt over your sleepimage file since it is locked. This one worked for me, hope it'll work for those who encounter the same problem as mine.

  • BoyHowdyDoo Level 2 Level 2 (380 points)

    Worked fine thanks. Errored out with -uchg. Used no flag "uchg" and all is peachy.

  • Steffen B. Level 1 Level 1 (0 points)

    Thanks! Worked fine. Was looking for a solution to this all day long...

  • RSpaight Level 1 Level 1 (5 points)

    Thanks for sharing the solution, this was driving me batty. Your fix seems to do the trick, just had to remove the dash from "-uchg" as noted above.

  • ferdinand0 Level 1 Level 1 (0 points)

    when i use the touche command the terminal give a permission denied message

  • garbor Level 1 Level 1 (0 points)

    Didn't you forget sudo before typing any commands ?

    By the way thanks for the mistake it is 'chflags uchg' without the dash.

  • NickAtoms Level 1 Level 1 (0 points)

    An alternative to garbor's solution is to change the sleepimage file to /dev/null.  I believe anything "written" to /dev/null is simply discarded.  The existing sleepimage file can then be removed.

     

    sudo pmset -a hibernatefile /dev/null

  • Ellfire Level 1 Level 1 (25 points)

    Yep, this worked great.  Thanks!  It was driving me nuts!

  • Jason Sims Level 2 Level 2 (180 points)

    Just noticed the same thing myself. I installed MBA/MBP Update 2.0 today, and just now noticed my MBA (mid 2012) took 10-15 seconds to become responsive after opening it (one of several reasons I disabled hibernate mode in the first place). I checked if /var/vm/sleepimage existed, and sure enough, there it was.

     

    Thanks for the tip about blocking sleepimage from being written. It's more of a band aid than a real solution, but if it actually sticks, it'll do for now.

     

    Are you sure your Mac is actually setting hibernatemode to 3 though? Did you try pmset -g to get the current settings before disabling it again? I just checked mine, and hibernatemode is still set to 0. This leaves me with two working theories:

     

    1. The hibernatemode setting is now being ignored on purpose*
    2. There's a bug introduced by MBA/MBP Update 2.0 that causes hibernate mode to be on even when it's supposed to be disabled

     

    If it's #2, it might just be a matter of resetting the PMU (and then possibly re-applying the setting via pmset). I'll try that later and report back if it works.

     

    * Why Apple would force everyone to use this "feature" is beyond me, since there are a number of very valid reasons for turning it off, ranging from annoying delays to bigger problems like kernel panics, not to mention the fact that this feature is basically pointless if you never leave your laptop in sleep mode long enough to run out of power.

  • Nikolaus Heger Level 1 Level 1 (15 points)

    @Jason Sims - I've come to the same conclusion.

     

    No matter what I set hibernate mode to, my retina MacBook Pro takes 10 seconds or more to wake from sleep - it seems to only happen after a while so I guess what the system does is:

     

    - Put computer to sleep

    - After a certain amount of time, hibernate. About 30 minutes or so.

     

    If I wake my computer instantly, there's still a short delay with a grey screen showing - that's new also. Prior to that latest upgrade, wake was instant.

     

    The system seems to ignore the hibernatemode setting completely (I had it on 0 and it would remain on 0, but still hibernate and take forever to wake).

     

    Locking the sleepimage like the above is a hack and once they fix it, you have to remember to remove this hack again. If you forget to remove it it might cause problems down the road.

     

    Best to file bugs with Apple.

  • bunnyhero Level 1 Level 1 (0 points)

    Nikolaus Heger wrote:

     

    - After a certain amount of time, hibernate. About 30 minutes or so.

     

    the "standbydelay" parameter for pmset is supposed to govern that length of time, in seconds. i'm going to try to set that to a very large value to see if that makes a difference.

  • Studio Engineer Level 2 Level 2 (445 points)

    BoyHowdyDoo wrote:

     

    Worked fine thanks. Errored out with -uchg. Used no flag "uchg" and all is peachy.

    That is because the line is "false" the uchg is a keyword. Not an option. Hence the dash is left out.

     

    The line should be like this -

     

    chflags uchg /private/var/vm/sleepimage

  • danielkinard Level 1 Level 1 (0 points)

    Is there a way to reverse this after it has been done? I've followed your steps and it worked perfectly, but just incase I'd want to reinstate sleepimage in the future -- do you know how to do this? I'm a mac noob so I really have no idea how to figure that out on my own.

     

    Cheers.

  • garbor Level 1 Level 1 (0 points)

    Hi, just put 'no' before the command. For example :

    chflags nouchg /private/var/vm/sleepimage

     

    By the way, think to man the command next time

Previous 1 2 Next