Skip to main content

How To Hiberante Ubuntu? | Enable/Disable Hibernation | Show Hibernate Option In Power Menu


Ubuntu Hibernate Main
In the Ubuntu Linux distro, the hibernation feature is disabled by default since the release of Ubuntu 12.04 on the machines which are not certified for Ubuntu. But the hibernation option is not gone forever. You can enable or disable the hibernation feature in Ubuntu 16.04 and its derivatives using the command line and text editors. It will also show up in the power menu.

Later versions, since 12.04, of the Ubuntu Linux distribution have the hibernation option disabled by default. One of the reasons is the lack of compatibility between Ubuntu and the computer hardware which is mostly dominated by Microsoft Windows. In fact, Windows itself doesn’t enable the hibernation option by default.
The process of hibernation in the case of Ubuntu involves copying what’s stored in the RAM and writing it to the swap partition before powering off the machine. This helps it retain the system state after it’s turned on. But it has been observed that hibernation option doesn’t work well. When the device is powered on, sometimes, all the open files and folders get lost. This has been a cause of my frustration many times. Similar is the case of the Suspend option.

How to Hibernate Ubuntu 16.04?

Ubuntu Hibernation show
For all the needs, the command line is the ultimate destination. You can enable hibernation in Ubuntu by typing the following command in the terminal:
sudo pm-hibernate
Note: Save your work before running this command.
Your machine will turn off automatically after the command execution finishes. Restarting the machine would bring you to the same state where you left, i.e. all the applications and files would be as it is. If this happens then the hibernation process has done its job. If not, your machine would look as if you’ve restarted it with all the open applications gone.
In case, your computer is taking excess time to hibernate, you need to interrupt the hibernation process and turn it off manually using the power button.
Now, the thing is that you would have to type the command every time you want to hibernate your Ubuntu system. However, there is a way to enable to hibernation option forever and also show it the power menu.

How to enable hibernation in Ubuntu 16.04 permanently?

To make the Ubuntu hibernation process permanent, you need to create a new file using a text editor on the command line:
sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
The system requires root privileges to enable the hibernation option, hence, the command sudo should be added. You can use other text editors like vi, gedit, emacs, etc.
Now, copy and paste the following text to file (use the mouse, keyboard shortcuts won’t work):
[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.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
Press CTRL+O to save and CTRL+X to exit the nano editor.
Ubuntu Hibernation Enable
Now, logout of your system and then login again, you’ll start seeing a hibernate option along with the Shut Down and Suspend options.

Hibernation might not work

If you’re using a partition formatted with the btrfs file system, chances might be there that the hibernation won’t work on your system. You need to reformat and delete that partition.
The size of your swap partition should be as large as your RAM (if you have 2GB to 8GB physical RAM). In the case you have more, the swap file can go up to 4GB.

How to disable hibernation option in Ubuntu 16.04?

You can remove the hibernate option from the power menu any time you want. To do this, open the same file in the command line using a text editor:
sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
Now, set ResultActive=no for both upower and logind.
Save the file using CTRL+O and leave the edit using CRTL+X.
Ubuntu Hibernation Disable
You won’t see the hibernate option after you logout and login again.
So, this was the method to turn on the hibernation feature on Ubuntu Linux distribution. Other than the regular Ubuntu release, it will work for Ubuntu flavors including Kubuntu, Xubuntu, etc. and derivates such as Linux Mint.
Did you find this helpful? Drop your thoughts and feedback.

Comments

Follow Us

WHAT'S HOT

Best Gaming Linux Distros You Need To Try In 2017

Gaming on Linux scene is improving each year with better hardware support and increasing support from game developers. Apart from established distros like Ubuntu and Arch Linux, gamers are using gaming Linux distros like Steam OS to get a better experience. The other It’s gaming operating systems are Sparky Linux – Gameover

Learn How To Activate iOS 11 Dark Mode

Apart from all the major iOS 11 features and changes, there are some hidden and minor features as well. In this release, Apple has included a feature named Smart Invert Colors, which is the closest you can get while looking for an iOS 11 dark mode.

Microsoft Set To Put Fingerprint Sensor In Keyboard Keys

According to a new patent titled “ Keyset Fingerprint Sensor ,” Microsoft might be working to integrate the fingerprint sensor in keyboard keys. The fingerprint recognition might be done

Latest Linux Distribution Releases List

This list is prepared with the inputs from different Linux distro developers and the official release notes. But, before going ahead and taking a look at latest releases, don’t forget to check out our useful lists of best Linux distros of 2017: Best Linux Distro For Beginners Best Linux Distro For Gamers Best Lightweight Linux Distros Best Operating Systems For Ethical Hacking Linux Distribution Releases (July 2017) Linux Mint 18.2 Release Date: July 2nd, 2017 You can read about Linux Mint 18.2 Sonya in detail  on 9jabreezeland . 4MLinux 22.0 Release Date: July 1st, 2017 4MLinux 22.0 is the latest stable release. It comes loaded with LibreOffice 5.4.0.1, GIMP 2.8.22, Dropbox 28.4.14, Firefox 54.0, Chromium 59.0.3071.86, etc. The biggest change comes with 4MLinux Server, which is a lightweight and fast server Linux distro. You can read more about 4MLinux 22.0  here . Netrunner 17.06 Release Date: July 1st, 2017 Netrunner 17.06, codenamed Daed...