1

As the title suggest.

I've already tried sudo pm-hibernate, sudo systemctl hibernate, sudo s2disk all of them did nothing and just freeze on input in the terminal, except sudo systemctl hibernate which seems to shutdown the system instantly but fail to resume after start the machine back up again.

I had 8 Gb RAM, 9 Gb Swap partition, when I first tried and I've already added resume parameter in /etc/default/grub. And failed after I tried to hibernate as I described above.

After that I tried use swap file instead of swap partition to hibernate by creating a 5 Gb swap file (I heard that I only need at least half the size of my RAM) and then add the parameter resume_offset to the GRUB_CMDLINE_LINUX_DEFAULT the same way as I did with resume.

I also add the following to /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla

[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
ResultActive=yes

and also edit the following (changing from yes to no in the ResultActive both section) in /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla:

[Disable hibernate by default in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=no

[Disable 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=no

Note that when I use sudo pm-hibernate I only have pm-utils installed. And when I used sudo s2disk I uninstall pm-utils before reinstall uswsusp then run the command like this

sudo dpkg-reconfigure -pmedium uswsusp

before sudo s2disk and then again nothings happened

what did I do wrong? I don't know what else I should try.

3

3 Answers 3

1

Look at your /etc/initramfs-tools/conf.d/resume file. It should contain the UUID of your swap partition, like so:

RESUME=UUID=071f8b0e-8e16-4f4d-90ff-a4ae9cc56e2b # use your own correct UUID

To identify the correct UUID to use:

sudo blkid # to display your UUIDs

Look for a line similar to this:

/dev/sda8: UUID="071f8b0e-8e16-4f4d-90ff-a4ae9cc56e2b" TYPE="swap" PARTUUID="d042d9f3-dfe7-4ba9-bbc8-efe6413e7fa4" # your UUID will be different

Then perform:

sudo update-initramfs -c # to create a fresh initramfs image file

reboot # to reboot the computer

Now retest hibernate.

6
  • Ok now there's RESUME=UUID=592d80c6-6112-4602-95f7-47f80d67e0e8, which is the UUID of my swap partition in my /etc/initramfs-tools/conf.d/resume Then I ran sudo update-initramfs -c -k 4.15.0-20-generic then reboot and test hibernation with sudo systemctl hibernate (with uswsusp and pm-utils purged) ..well it didn't hibernate but it turns into the Screen Lock instead
    – mathmd
    May 7, 2018 at 14:12
  • @AidenBhe did hibernate work in 17.10? From your update-initramfs command, you're running kernel 4.15.0-20-generic, yes? Hibernate is normally disabled in Ubuntu for operational reliability issues, and may never work on your computer. However, have you checked for a BIOS update?
    – heynnema
    May 7, 2018 at 14:45
  • @AidenBhe you may have to edit /etc/default/grub and find the quiet splash line and add something like resume=/dev/sda8 or resume=UUID=592d80c6-6112-4602-95f7-47f80d67e0e8 and then sudo update-grub, reboot and retest.
    – heynnema
    May 7, 2018 at 14:50
  • Thank you for a quick reply. I've already done that here's the lines in /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=592d80c6-6112-4602-95f7-47f80d67e0e8" GRUB_CMDLINE_LINUX="" and yes 4.15.0-20-generic is my kernel version. I haven't thought about flashing BIOS though I'll try that and let you know!
    – mathmd
    May 8, 2018 at 11:18
  • And also I just returned to Ubuntu recently so I haven't use 17.04 or 17.10 before.
    – mathmd
    May 8, 2018 at 11:29
0
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=959b6..."

in /etc/default/grub did this for me on xubuntu 18.04 after grup update and install. You see it resuming on boot. But when I use

sudo systemctl hibernate

resuming fails. With hibernate by window manager it works. I patched /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla as described to enable hibernation. I did not install pm-utils or uswsusp.

1
  • By "window manager" did you mean from GNOME? Because from my desktop I don't have any Hibernation Button in the status menu when I recently installed Ubuntu 18.04. But I did add a GNOME extension to have the button in the status menu though and it did the same thing when I sudo systemctl hibernate
    – mathmd
    May 8, 2018 at 11:27
0

Had the same problem in Ubuntu 18.04. Found that it was necessary to update the kernel.

The s2disk resume did not work for me in 4.15.0.

It is working for me in 4.18.12.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .