Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 14577  / 3 Years ago, tue, november 23, 2021, 10:02:37

I was used to have 21.04 with the hibernate function recallable via an extension that apparently is not compatible anymore with the new GNOME on 22.04.


Apparently there is not an alternative on the extension site.
Do you know anything that can be used rather than typing in the command in the terminal?


More From » hibernate

 Answers
3

There is an extension that will show your hibernate button. That doesn't necessarily means it will work. So a few steps have to be taken:



  1. Check if hibernate works: Open a terminal and execute systemctl hibernate. IF this does not work, you'll have to look into the Ubuntu handbook on how to define your swap partition/file



  2. Enter terminal as root (sudo will not work). Open (or create) a file with:
    nano /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla




Add the text below at the end of the file:


##NEW entry since Ubuntu 18:
[Re-enable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes

##NEW entry since Ubuntu 18:
[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


  1. Clean up hook (Error - recordfail after resume from hibernate). That error occurs after resume (Ubuntu really doesn't want you to hibernate):


sudo nano /etc/systemd/system/use-10_grub_common.service
Enter:


[Unit]
Description=Execute the /etc/pm/sleep.d/10_grub_common script after hibernation.
After=hibernate.target

[Service]
Type=oneshot
ExecStart=/etc/pm/sleep.d/10_grub-common thaw

[Install]
WantedBy=hibernate.target

This script will remove an error flag from grub, preventing it showing an error the next time you boot. Since it is a service you need to enable it:


sudo systemctl enable use-10_grub_common


What I did not cover is the definition of your swap (either partition or file) - see the link at point 1.
There are two places where "Resume" has to be defined:
Grub: Resume=UUID=xxxx (when you have a swap partion and xxx is the uid of that) and an entry in /etc/initramfs-tools/conf.d/resume (Resume=UUID=xxxx)


Since I do not know your configuration and have never tried hibernation with swap files I will not elaborate (now)


[#570] Thursday, November 25, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fittecanap

Total Points: 322
Total Questions: 100
Total Answers: 105

Location: Israel
Member since Tue, Nov 17, 2020
4 Years ago
;