Many of you will tell me that hibernation technology is not something new, but it is being the center of many articles and publications due to the recent problems that both proprietary systems and distributions as well as users are having lately with hibernation.
Here we will not talk about the problems that Windows 10 has with hibernation, but we will talk about this utility in the main Gnu / Linux distributions, as well as its differences with respect to other ways to shut down or suspend the computer and thus know which is the best option we have for each situation.
We will not mention all the distributions that are currently available to everyone, but we will talk about hibernation on major Gnu / Linux distributions that currently exist.
First we have to know what hibernation is and what it is not. Hibernation is a process of the operating system in which all the data, services and settings that we are using are "frozen" in order to turn off the computer and restart it as it was.
Thus, hibernation does not mean leaving documents and files as they were when we turned off the computer to use them again, nor does it mean suspending the computer. It is somewhat faster than the former and less expensive than the latter.
Table of Contents
What is suspension?
Suspend a team or enter in sleep mode means that the operating system creates a live image of the entire system (personal data included) and send it to ram or volatile memory of the computer in order to turn off the rest of the components, but the ram memory and the motherboard continue to work although at a slower rate.
Going to sleep means that the equipment continues to consume power, although less than fully operational and will be reactivated with a key or mouse gesture or simply by lifting the lid in the case of laptops.
This method is really useful in computers that have more than 2 Gb of ram memory and little internal storage on the hard disk (for example, because it is an SSD disk).
What is restart with open documents?
Operating systems like MacOS have a hybrid function that It supposes shutting down the operating system but when it is turned back on, the operating system opens the latest applications that have been closed or certain documents.
This is practical for many, so many Gnu / Linux distributions do the same. However, this option is still a restart or a simple shutdown of the computer, with the subsequent initial loading of processes and configurations that is done at each startup, something that we can do manually but that can slow down the startup of the operating system.
So what is hibernation?
Hibernation is a process in which a live image of the current system is created, but it is not saved in ram memory but in swap memory or hard disk swap memory. That is, on the disk and therefore can be turned off without erasing the information.
This means that the computer can be turned off because it has nothing in the ram memory, the volatile memory, but the system load is not as long as at the start of the operating system, since the image is used.
All the information of the system is dumped in a single file that is the file that is loaded, therefore also we will need to have a hard drive with a large capacity to be able to use hibernation no problem.
Can i have hibernate function in gnu / linux?
We can only have this function if the Linux kernel really supports it. This is important to remember because if we want to use a kernel compiled by us we must have this function activated, otherwise we will run out of this functionality and we will not be able to activate hibernation.
However, the most common is to use the kernel offered by the distribution, a version in which the hibernate function as well as other functions and drivers are enabled. So the normal thing is that hibernation is present in our computer with Gnu / Linux.
How do I activate hibernation on my Gnu / Linux distribution?
As we have said, hibernation is present in all Gnu / Linux distributions (at least most). This means that just go to the shutdown menu on our desktop and we will find the option to hibernate, along with shutting down, restarting, suspending and logging out. Once we are in hibernation mode, we only have to press the power button to activate the system again.
If we want to use this function through a terminal command, first we have to have the pm-utils tools installed, something that surely will already be. But if we have any error messages, we may not have these tools installed, which are found in all official distributions repositories. Thus, if we have these tools, to enter hibernation mode we have to use the following command:
If we have a distribution that is based in ArchLinux or derived from it, we only have to write the following:
hibernate -F /etc/hibernate/ususpend-disk.conf
In the case of using OpenSUSE, we have to use the following command:
If we are more risky and we have a distribution that is based on or is Gentoo, the command is as follows:
This is the general rule, but there are some exceptions like Ubuntu.
How to enable hibernation in Ubuntu
Although Ubuntu allows the system to go into hibernation in its kernel, this option is not enabled by default in the distribution and we have to activate it ourselves. But this it can be fixed in a very easy way.
First we have to create a text file with gedit and write the following in it:
[Re-enable hibernate by default in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes [Re-enable hibernate by default in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.hibernate-multiple-sessions ResultActive=yes
We will save this file with the following name:
Now we have to open our file manager with administrator permissions and paste the file that we have created in the following folder:
Once we have pasted the file, we close all the windows and restart the operating system so that the appropriate changes are applied. And after the system restart, we will see how the option of this function is now available in the desktop menus of our Ubuntu and not just through the terminal.
Conclusion on hibernation
Hibernate is generally more environmentally friendly than sleep, but we must take into account our needs. If we need a quick start, suspension is the fastest option of them all.
If, on the other hand, we want to save energy and resources, restarting with opening documents is the best option. But if, on the contrary, we do not have problems with resources but we do not want to waste energy, hibernation is the best option and therefore it is usually the best suited to modern equipment where there are no limits on hard drive space but there are battery problems.