Hello,
this howto should help you to set up working hibernation with a swap partition on a fresh install of LM19.
For a guide on howto use a swap file, see viewtopic.php?f=42&t=284100.

Short background:
a. Hibernation basically writes the content of your memory into the swap space of your computer - when you start your computer, after hibernation, it should load/ read the content of the swap partition in order to resume.
b. There are two different methods to set up a swap-space on your disk. First: The use of a separate swap partition (set up when formatting your disk during install). Second, the use of a swap file (this is the new default).
c. Hibernation is known to cause problems on some computers. Be sure that you know howto boot and restore your system, before you enable hibernation. It is probably a good idea to have a working usb-stick with Linux Mint 19 around.

There may be different reasons, why some users use a separate swap partition. One reason could be that you want to use btrfs as a file system (and btrfs does not support swap-files).
This howto should guide you, when setting up hibernation and using a separate swap partition.

1. Step - Make sure, that the kernel will look at the right place when booting (after hibernation):
In order to achieve this, one has to add the option "resume=UUID= " to the file /etc/default/grub

You should really use xed admin://</path/file>, there's no reason to run the editor itself with elevated privileges. Also sudo with GUI programs is just generally bad practice and can lead to issues in some cases.

Otherwise looking good, although hibernation had to be disabled in Mint 19 because it is really problematic with the Ubuntu 18.04 base, so good luck to those trying it.

Last edited by gm10 on Sun Aug 05, 2018 11:17 am, edited 1 time in total.

Is there a good way to check if hibernation is supported?
The only suggestion is to search in the internet for bug reports.
However this is likely to give false results, since hibernation depends on the version of the kernel, the version of the driver, the configuration, the implementation details.

In the end it always comes down to trial an error - which is basically what is suggested in your link: "sudo pm-hibernate" <- the equivalent to "sudo systemctl hibernate" in step 2.
However if one does not implement step 1 - hibernation will always fail.

Last edited by goebbe on Fri Jul 13, 2018 10:56 am, edited 1 time in total.

You should really use xed admin://</path/file>, there's no reason to run the editor itself with elevated privileges. Also sudo with GUI programs is just generally bad practice and can lead to issues in some cases.

OP, one more: sudo systemctl hibernate -- there's no reason to sudo that one, either. Don't be so generous with your sudo. Elevated privileges should be given sparingly. A program that runs elevated basically owns your system. Never forget.

OP, one more: sudo systemctl hibernate -- there's no reason to sudo that one, either. Don't be so generous with your sudo. Elevated privileges should be given sparingly. A program that runs elevated basically owns your system. Never forget.

Thank you!
xed admin:// can only edit an existing file! So when using xed admin:/// one has to add an additional step, in order to create the file.
I edited the howto. Of course, one can also use the nano editor, as suggested.

Last edited by goebbe on Mon Jul 16, 2018 2:01 pm, edited 1 time in total.

Thank you!
xed admin:// can only edit an existing file! So when using xed admin:/// one has to add an additional step, in order to create the file.
I edited the howto. Or one can use the nano editor, as suggested.

but it says "Failed to hibernate system via logind: Sleep verb not supported"

There are several known possibilities that could lead to this error message:
1. hibernation might not be supported by your hardware (computer) - did it work before installing Mint 19?
2. hibernation might not be supported by your Linux kernel - use the standard kernel, if possible.
3. hibernation is known to cause problems in combination with "secure boot" - disable secure boot if possible.
Take care: If you need secure boot e.g. in a dual boot setup, for booting Windows, this is not an option.
4. make sure that your swap partition is bigger than your memory (RAM).

There are several known possibilities that could lead to this error message:
1. hibernation might not be supported by your hardware (computer) - did it work before installing Mint 19?
2. hibernation might not be supported by your Linux kernel - use the standard kernel, if possible.
3. hibernation is known to cause problems in combination with "secure boot" - disable secure boot if possible.
Take care: If you need secure boot e.g. in a dual boot setup, for booting Windows, this is not an option.
4. make sure that your swap partition is bigger than your memory (RAM).

Please report back, if you find the source of your problem.

Thanks for the reply, after considering the risk about enabling hibernation on dual boot system, i think i'm not going to enable it.

Otherwise looking good (if your cat /etc/initramfs-tools/conf.d/resume already has the correct UUID then you can skip most of your steps but no matter), although hibernation had to be disabled in Mint 19 because it is really problematic with the Ubuntu 18.04 base, so good luck to those trying it.

You're giving a null-info. Tell us, what are the "most" steps to skip?

However, I could not skip any step. After finally adding swap UUID to /etc/default/grub everything works.

This will create confusion. The original method speaks of the file “/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla”. The alternative method speaks of the file “/var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkl”. Different directory and different extension!

What worked for me:
if you created the file “/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla”, then delete it.
Create the file “/var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla” with the new text from sour_diesel Mon Jul 16, 2018 11:41 am.

I have taken the original extension. The extension just describes what sort file it is. I believe that just any file in this sort of directory is parsed, whatever the name is. Why the directory var/lib works and etc not, only an expert will know. Using points in filenames is by the way a weird/dangerous habit. Is the extension part after the first or last point. I thought it would be the last, a filename manipulation function of free pascal thinks the first. In the past, this created a strange error for me.

This will create confusion. The original method speaks of the file “/etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla”. The alternative method speaks of the file “/var/lib/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkl”. Different directory and different extension!

Well spotted!

It always pays to double-check commands in case anything has been missed off. Seen this in instructions on other websites, one just missing that final / on the path ...