0

I've tried to search for how to enable hibernation on Ubuntu 18.04, but none of the suggested methods are working for me.

I have a Lenovo T580 ThinkPad with an SSD disk which is a dual-boot system with Windows 10.

$ sudo systemctl hibernate
Failed to hibernate system via logind: Sleep verb not supported
$ sudo pm-hibernate
sudo: pm-hibernate: Command not found
$ cat /sys/power/disk
[platform] shutdown reboot suspend test_resume 
$ sudo apt-get install pm-hibernate
Reading package lists... Done
Buidling dependency tree
Reading state information... Done
E: Unable to locate package pm-hibernate

My /etc/fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme0n1p5 during installation
UUID=d2d3c950-154c-4192-a4a2-496c884bf9dd /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=8CD7-3389  /boot/efi       vfat    umask=0077      0       1
/swapfile                                 none            swap    sw              0       0

And

$ swapon --show
NAME      TYPE SIZE USED PRIO
/swapfile file   2G   0B   -2

Any suggestions?

Best regards, Steen

OZ1SEJ
  • 1,235
  • 3
  • 19
  • 31
  • 1
    have you tried the solution here – ptetteh227 Dec 31 '18 at 12:23
  • Thanks! I did read that, but that problem was that cat /sys/power/disk returned [disabled] and after disabling secure boot returned "normal" values. Mine already returns values suggesting hibernation is enabled... – OZ1SEJ Dec 31 '18 at 12:33
  • 1
    another way to hibernate is to install uswsusp and afterwards hibernate with sudo s2disk. pls do you have a swap partition? – ptetteh227 Dec 31 '18 at 12:36
  • I suppose I have a swap partition - I just installed Ubuntu 18.04 with no custom partitioning other than I chose to install Ubuntu alongisde Windows. How do I see if I have a swap partition? – OZ1SEJ Jan 01 '19 at 13:27
  • I don't have a swap partition; I don't even have a swap file. As far as I can see, I can only implement either by editing /etc/fstab, and I've promised myself to never do that again. So there's that. But thanks for your help :-) – OZ1SEJ Jan 01 '19 at 13:41
  • By the way - I think it's a little strange that the default Ubuntu installation doesn't automatically make a swap partition. Oh well. – OZ1SEJ Jan 01 '19 at 13:42
  • 1
    can you kindly post the output of /etc/fstab. sudo fdisk -l and swapon --show can show swap partitions. – ptetteh227 Jan 01 '19 at 17:39
  • I've pasted the contents above. – OZ1SEJ Jan 03 '19 at 20:28
  • 1
    https://askubuntu.com/questions/6769/hibernate-and-resume-from-a-swap-file looks like natively you won't be able to hibernate to swapfile unless you use uswsusp From the first error pm-hibernate needs to be installed with sudo apt install pm-utils – ptetteh227 Jan 06 '19 at 23:34

1 Answers1

1

I was getting the same error on my X1 Carbon 7th Gen. I did the following to enable the hibernation (Detailed instructions are here):

  1. Turn off Secure Boot in BIOS.
  2. Turn off "Modern Standby" in BIOS.
  3. Create a swap file bigger than my RAM.
  4. Update the grub.

After the above steps, I can use sudo systemctl hibernate command to hibernate and resume properly.

SaTa
  • 996
  • 1
    is there any reason why secure boot has to be off? especially if running on a MOK? – My1 Dec 29 '19 at 05:09
  • Good point. I had the same question. I could not set it with Secure Boot enabled but I am not using MOK. Do you have hibernation with Secure Boot enabled? – SaTa Dec 29 '19 at 22:21
  • 1
    I currently dont even have hibernation with secure boot (although I am using a kinda unorthodox file with a swapfile on an extra partition aside because the Linux partition is just way too small

    but on reddit I did also ask and I read that apparently the kernel has no way to sign the hibernation image, and without that secure boot would be kinda pointless

    – My1 Dec 30 '19 at 23:15