Hibernate

Version: 

Section: 

System

Background

Hibernation is an alternative to suspend, and is used to write the RAM of your system to disk and shut down the machine. Upon restarting, the applications you had open when initiating hibernation will be in place without reopening them. It can be particularly useful on laptops to save power.

The process typically takes 15-45 seconds on most modern computers, both hibernating and returning--in stark contrast to suspend, which takes only a few seconds. The user will usually see the screen go black before hibernation finishes its work.

Setup

1. You must have created a swap partition prior to, or during, the installation of MX.  Instructions on how this is done can be found in the Users Manual, Section 2.3.3. The size of the partition must be large enough to hold the RAM consumed when hibernate is invoked. An old rule of thumb is to make the swap partition 1-1.5 times the size of installed memory. With large memory installed the size may be lowered.

2.Add this line to grub's kernel parameters (most easily done using Grub Customizer, see below):

resume = /dev/sdx

That "x" is the swap partion (such as "sda1") which you can locate by typing in a terminal as regular user this command:

inxi -P | grep swap

grubcustomizer_kernelparams_0.png

Init system

Sysvinit (default)

Hibernation was removed from default locations in MX Linux such as the logout box because it proved highly unreliable in users' tests. One user posted a method that has worked for some, but is not officially supported by MX Linux.

  • Search and mark for complete removal:
    • pm-utils
    • uswsusp
  • Reinstall first pm-utils and then uswsusp. Not necessary for hibernate to function, but should give feedback and a percentage counter rather than a black screen.

Systemd

Hibernation in MX 17 works if you choose Advanced Boot Options > systemd boot option on the Bootup screen (grub).

Use

Login screen (lightdm)

There is a link for "Hibernate" in the menu that shows when you click Power icon in the right corner of the top bar.

Logout screen(lightdm)

The command button for hibernate on the logout dialog box is hidden by default in MX Linux. If you use hibernate regularly with success, you can add it to the logout dialog box as follows.

1. Open this file in featherpad or another text editor: ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml

2. Edit lines 36-38  to change ShowHibernate to "true" so it looks like this:

<property name="shutdown" type="empty">

<property name="ShowHibernate" type="bool" value="true"/>

</property>

3. Log out and back in for it to show.

CLI

sysvinit

sudo pm-hibernate

systemd

systemctl hibernate

Resources

Language: 

English