[Go] How to enable sleep mode for Ubuntu

Source: Internet
Author: User


We all know that Windows has a sleep mode, in fact, Ubuntu also has. The sleep mode simply means that everything in memory can be written to the hard disk when the user is temporarily away, and when the user turns on the next time, it can boot directly to the last saved state.

For example, you are using LibreOffice to process a document, while opening a lot of reference pages and other files, when the time comes, you are afraid to come back the next day to find those reference pages and files, etc. will affect your writing ideas, now you can leave Ubuntu hibernation. After hibernation, Ubuntu will write all the unfinished processing tasks to the hard disk and then shut down, the next time the boot will automatically call the last state from the hard disk.

Check if Ubuntu hibernation mode is normal

Now we're going to check to see if the current Ubuntu allows sleep mode, to allow hibernation we'd better assign the current system a SWAP partition of the same size as the memory (most of the users will be assigned when the system is installed). Use the Ctrl + Alt + T shortcut to open a terminal and execute the following command:

sudo pm-hibernate

After the command is executed, Ubuntu will automatically shut down and power down. Once again, if everything is OK, we will be able to restore directly to the last shutdown state, which indicates that the current Ubuntu system sleep mode is working properly.

Note: If the status and session are not restored or other errors are encountered before the shutdown, it may be caused by a number of reasons, and you will need to go through the error before proceeding to the next step.

Re-enable hibernation

If you have confirmed that Ubuntu hibernation mode works on your system through the above steps, we can add the "Hibernate" button back to our menu.

Execute the following command to create a com.ubuntu.enable-hibernate.pkla file in the /etc/polkit-1/localauthority/50-local.d/ directory:

sudo vi /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

Write the following in the above file:

[Enable Hibernate in logind]Identity=unix-user:*Action=org.freedesktop.login1.hibernateResultActive=yes

Ubuntu has been fully supported in low-power mode from 14.04, and the above configuration file should be able to call completion. But if you're using an earlier version of Ubuntu you can try the following:

[Enable hibernate in upower]Identity=unix-user:*Action=org.freedesktop.upower.hibernateResultActive=yes

Note: The above wording does not apply to Ubuntu 13.10

If you are not entirely sure or for the sake of insurance, you can also write both of them into the com.ubuntu.enable-hibernate.pkla configuration file.

[Enable Hibernate InchUpower]Identity=Unix-User:*Action=Org.FreeDesktop.upower.resultactive=yes [ enable hibernate in< Span class= "PLN" > Logind]identity=unix-user:* action=org.. Login1. Hibernateresultactive=yes      

After the configuration file has been modified, we need to restart the system or restart the indicator session:

killall indicator-session-service

The "Hibernate" option will appear when the reboot is good.

Hibernation is a very useful feature, unfortunately the default is removed by Ubuntu, but we can easily use the method described in this article to enable Ubuntu sleep mode, interested friends quickly try it.

[Go] How to enable sleep mode for Ubuntu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.