Has anyone had luck getting hibernation to work on 17?

The old Z16 way of getting hibernation to work does not work in 17 - the version of Gnome is too new Simpler Off Menu from Tweaks to work ([HOW TO] Enable Hibernate Option on ZorinOS 16 or other Gnome distros). Would be nice to get an option in the menu but one thing at a time...

The main issue is that

systemctl hibernate

Does not seem to work! I've updated grub with my swap partition UUID (by appending resume=UUID=xxxx to the end of line “GRUB_CMDLINE_LINUX_DEFAULT”, guidance here: How to Enable Hibernate Function in Ubuntu 22.04 LTS | UbuntuHandbook )

swapon --show returns ok, I have my 64gb SSD partitioned as:

sda1 = fat32, 500mb (EFI partition)
sda2 = swap, 8gb (swap partition)
sda3 = ext4, 27gb, mounted / (root/system partition)
sda4 = ext4, 28.5gb, mounted /home (home partition)

It's a Microsoft Surface Pro 3 with 4gb ram. Everything works perfectly (have run 16 on it fine for years, 17 seems fine) but I can't work out why hibernation won't work

Any help would be much appreciated!

Thanks

1 Like

I know you said you updated grub, but did you update grub after updating lines of grub?

Update Grub:

sudo update-grub

Check again?


No joy?

Check logind.conf file with sudo [nano,vim,etc.]/etc/systemd/logind.conf and uncomment the below line if it is (remove #). Remember to save! This will allow you an optional way to test hibernation easily.

#HandleSuspendKey=suspend hibernate

Restart machine and then sudo systemctl hibernate as before, or alternatively, you can just press the hibernate button you just enabled on your keyboard. If it exists.... dun. dun. dun.

:Grub

2 Likes

Also, have you installed the surface Pro kernel?

2 Likes

Grub knows the swap file exists, but does the OS? If you haven't added it to the /etc/fstab and instructed the OS to mount it on /swap, it may not recognize that the swap partition exists, and is trying to use the swap file instead.

This would essentially make your grub entry moot as the system doesn't know there is an 8gb swap partition to use (swap file defaults to 2gb, probably not large enough).

3 Likes

Hi, thanks for this, just checked and the entry in fstab says:

swap was on /dev/sda2 during installation

UUID=xxxx none swap sw 0 0

Does this look correct? From what I can tell it fits the bill? Anyway still no dice with hibernation, tried ajo001's logind.conf fix too

Hi, thanks for this, changed the line (was commented before I changed), thought might be it but no dice. Any other ideas?

Look in Disks Utility (gnome-disks) or gparted (apt install) partition management applications and double check your UUID for the disk on which you want to install the 8GB swap. Does it match what you're placing in your fstab and GRUB?

Also double check that disk's mount location. Is it actually /dev/sda2? Or is that location pointing to the Live USB identified location?

Hi again,

Yep, thanks, I'd checked this earlier but double checked again, fstab and grub both have correct UUID

sda2 is the correct location; Gparted says filesystem is 'linux-swap', partition flag is 'swap', status is 'active' (quote marks mine). No usb sticks connected!

1 Like

Have you had the chance to test @Aravisian's recommendation to verify if the appropriate Surface kernel is being used?

Kernels are frequently used to call forth the right driver module files to use for any given task. Those tasks require certain hardware to execute those tasks properly. If your kernel does not have driver support for hibernation, but you know for sure your Surface has that capability based on past experience, you might need to install the correct kernel and retest?

Hi, no I hadn't tried this yet...but have now. Confirmed kernel running, still no dice! I am beyond the limits of my limited Linux knowledge now

One this tho...I never actually had hibernation running on my SP3...I couldn't get it working before as I'd opted for encrypted drive on ZOS16. When I got some login issues this was an opportunity to upgrade and get hibernation. My SP Go does run hibernation fine on Opens use but this is obviously a different model and completely different distro

So perhaps it can't be done on SP3...I'll need to make a clonezilla and try and find a Debian based distro that does hibernation out of the box to test...unless someone on this forum can confirm either way

Thanks a for help everyone anyway

Hi, I just went through the hassle of activating hibernate and followed mainly the instructions by boldos.
The one thing I had to do that none of the instructions mentioned - my system was installed with default options, so it had the default swapfile, which did not disappear when I created the swap partition and subsequently got in the way. (To check, run "swapon --show", if there is more than 1 entry, it might be the issue why hibernation is not working).
"sudo swapoff /swapfile" got (temporarily) rid of it, and after that the hibernation worked like a charm.

Unfortunately, I observed that after a reboot the default swapfile will return, so I assume that I have to repeat this every time I reboot the computer. If anyone could point out how to permanently get rid of it, I'd appreciate it.

Hope this is helpful.

You can use

swapon -show

to show that swapfile. Generally, they are in Root so would be /swapfile
After you have verified that is its correct path placement, you can remove it with

rm -f /swapfile