Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to enable hibernation mode of Ubuntu

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to enable the hibernation mode of Ubuntu". In the daily operation, I believe that many people have doubts about how to enable the hibernation mode of Ubuntu. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to enable the hibernation mode of Ubuntu". Next, please follow the editor to study!

Everyone knows that Windows has hibernation mode, but so does Ubuntu. To put it simply, the hibernation mode means that everything in the memory can be written to the hard disk when the user leaves temporarily, and the next time the user boots up, he can boot directly to the last saved time state.

For example, you are using LibreOffice to deal with a document, while opening a lot of reference pages and other files, it is time to get off work, you are afraid that coming back the next day to find those reference pages and documents will affect your writing thinking, you can now leave the Ubuntu dormant. After Ubuntu hibernates, all outstanding processing tasks will be written to the hard disk and then shut down, and the last state will be automatically called from the hard disk the next time it is booted.

Check whether the Ubuntu hibernation mode is normal

Now we want to check whether the current Ubuntu allows hibernation mode, and to allow hibernation we * have allocated a SWAP partition with the same amount of memory as the current system (most users will allocate it 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 off. After rebooting, if everything is all right, we can directly return to the state of the last shutdown, which indicates that the current hibernation mode of the Ubuntu system is working properly.

Note: if the state and session before shutdown are not restored or other errors are encountered, it may be caused by a variety of reasons, and you need to troubleshoot before 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 hibernation 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 fully supported low-power mode since 14.04, which should be called by the above configuration file. But if you are 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 words do not apply to Ubuntu 13.10

If you're not sure or just to be on the safe side, you can write both in the com.ubuntu.enable-hibernate.pkla configuration file at the same time.

[Enable Hibernate in upower] Identity=unix-user:*Action=org.freedesktop.upower.hibernateResultActive=yes [Enable Hibernate in logind] Identity=unix-user:*Action=org.freedesktop.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

After rebooting, the hibernation option will appear.

Hibernation is a very useful feature, but unfortunately it is removed by default by Ubuntu, but we can easily enable Ubuntu's hibernation mode through the method described in this article.

At this point, the study on "how to enable the hibernation mode of Ubuntu" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report