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 swap-files on btrfs is a new/experimental feature, that requires a linux kernel 5.0 or newer).
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
1a. Copy your UUID of the swap partition from fstab:
Code: Select all
cat /etc/fstab
Code: Select all
xed admin:///etc/default/grub
Example:
Code: Select all
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=putYourSwapUUIDhere"
Save the grub file and update grub:
Code: Select all
sudo update-grub
Open terminal and run command:
Code: Select all
systemctl hibernate
enable it in the menus via the following steps.
3. Enable hibernation in the shutdown menu
Open terminal and run the following commands to create and edit the configuration file:
Code: Select all
sudo touch /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
xed admin:///etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla
Code: Select all
[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;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
Comments are welcome.