David A. Harding on 24 Jun 2009 08:17:47 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Hibernation Question

On Tue, Jun 23, 2009 at 09:07:00PM -0400, Casey Bralla wrote:
> I'm assuming that I need at least 8 GBytes of swap space to hold all my RAM 
> when hibernating.

You need enough swap space to store everything currently in *virtual*
memory, which might be up to 10 GB in your case.  You can see how much
memory you're using right now with the "free" command.

The good news is that Linux fails gracefully if you try to hibernate
(suspend) with insufficient swap space. When you activate suspend, the
kernel stops running all the user space programs, stops some kernel
drivers, purges the filesystem cache, writes the contents of virtual
memory to disk, stops some more kernel drivers, and turns off the
computer. The kernel never wipes active memory; it just lets the
computer stop refreshing it when the power goes off.

If the write to disk fails because you have insufficient disk space, the
kernel stops during that step, prints an error message to its log,
restarts the stopped kernel drivers, and restarts the stopped programs.
Basically, it whistles a quick tune and tries to play it off. Because
the active memory is still there, it doesn't need to do anything else
and you don't lose anything.

> Any use hibernation for a desktop?  Any suggestions?

In my experience, suspend crashes a lot of desktop computers, especially
newer computers. Usually the problem is that kernel drivers written for
desktop hardware don't support suspending. I suggest that the first time
you try, you do a safe test by exiting every program with important data
before suspending. If suspend works once, it should continue working,
but when you upgrade your kernel or change your hardware, you should do
another safe test.

Good luck,

David A. Harding	    Website:  http://dtrt.org/
1 (609) 997-0765	      Email:  dave@dtrt.org
			Jabber/XMPP:  dharding@jabber.org
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug