Hibernate Ubuntu 18.04
Remove unneeded utills
apt purge pm-utils uswsusp
We need to find out device UUID on which swap is located
sudo blkid
UUID="413928f5-61de-40be-88df-3c205d3ead67 in my case
/dev/nvme0n1p1: LABEL="SYSTEM" UUID="74FA-456E" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="6a431cb8-00b1-4fca-bcae-61fb06fa0cb5"
/dev/nvme0n1p4: UUID="EE6CC4C06CC484B5" TYPE="ntfs" PARTUUID="ecbeb429-0a5f-4307-9fdb-05cd49ee6db8"
/dev/nvme0n1p5: LABEL="Windows RE Tools" UUID="BE8456C084567ABB" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="0b785c44-9132-4fc0-b154-0470ddb9746d"
/dev/sda1: UUID="413928f5-61de-40be-88df-3c205d3ead67" TYPE="ext4" PARTUUID="3ac66e6e-01"
/dev/nvme0n1: PTUUID="31d6b4bb-890f-40fc-a6df-08b2d8a0d3e8" PTTYPE="gpt"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="83ed35e2-3a29-45a5-8f94-453d0d62844d"
/dev/nvme0n1p3: PARTLABEL="Basic data partition" PARTUUID="2f5093da-274a-4155-8f02-98ba6317f1cc"
If you have a swapfile instead of a separate swap partition then you also need to add the extra resume_offset=
parameter.
sudo filefrag -v /swapfile

Need to update the file /boot/grub/grub.cfg
using the information above
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=413928f5-61de-40be-88df-3c205d3ead67 resume_offset=14727167"
sudo update-grub
Edit the file /etc/initramfs-tools/conf.d/resume
resume=UUID=413928f5-61de-40be-88df-3c205d3ead67 resume_offset=14727167
sudo update-initramfs -u -k all
Add hibernate option in poweroff menu
sudo vim /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;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit ResultActive=yes
After reboot hibernation will work
Last updated
Was this helpful?