Difference between revisions of "Suspend"

From LinuxMCE
Jump to: navigation, search
(Enable wake on lan)
Line 43: Line 43:
 
   
 
   
 
  EnableWOL() {
 
  EnableWOL() {
     ethtool -s eth0 wol ug
+
     ethtool -s eth0 wol g
 
  }
 
  }
 
  
 
== To suspend the MD ==
 
== To suspend the MD ==

Revision as of 15:28, 22 December 2007

This article describes how to suspend your MD to RAM.


Motivation

  • Saving power
  • Quick boot (usefull if your MD is noisy and you turn it off when not in use)

Setup

There are several different ways of achiving suspend, this is one using the hibernate scripts, which can be configured to use different ways of suspending the machine.

On the MD in question, make sure you have the uswsusp and hibernate packages installed.

apt-get install uswsusp hibernate

Check your BIOS setting to make sure that suspend to ram is enabled.

Using NVidia graphics card

Edit your xorg.conf file and add this line to the "Device" section:

Option "NvAGP" "1"

Also make sure no other vendor AGP modules are loaded, like intel_agp, sis_agp etc. The agpgart module is fine, though. Use

lspci | grep agp

to list all loaded agp modules.

If you see any agp modules besides agpgart, add a line to /etc/modprobe.d/blacklist to blacklist the module.

Edit the /etc/hibernate/ram.conf file, and comment the two lines

EnableVbeTool yes
VbetoolPost yes

Edit the /etc/hibernate/blacklisted-modules, and comment the nvidia line.


Enable wake on lan

To enable wake on lan, to let the core wake up the MD, you have to run a command to enable this before going to sleep. The normal shutdown process does this, but this is not run when suspending the computer. Hibernate provides a way of including our own scripts before suspending.

Add a file (i.e. enableWOL) to the /etc/hibernate/scriptlets.d/ folder:

AddSuspendHook 15 EnableWOL

EnableWOL() {
    ethtool -s eth0 wol g
}

To suspend the MD

Then run

hibernate-ram

to suspends the MD to ram. The script first checks if it recognizes your hardware, to take the correct actions before suspending. If you get a message that your machine is unknown, edit the /etc/hibernate/ususpend-ram.conf file, and un-comment the

USuspendRamForce yes

line, to force it to suspend anyway.


References

The hibernate script uses uswsusp by default when trying to suspend to ram. For more information about the s2ram utility used, read the S2ram howto

The NVidia suspend howto