5

I tried to hibernate ubuntu-budgie from the top panel, but it doesn't hibernate, it only locks the computer.

Seeing that, I tried to hibernate from the terminal using sudo systemctl hibernate, but I got the same result.

I used the command systemctl status hibernate.target, and I saw theses errors :

systemd[1]: Dependency failed for Hibernate.
systemd[1]: hibernate.target: Job hibernate.target/start failed with result 'dependency'.

PS : This is a fresh installation of ubuntu budgie, and I have enough swap size (4Gb RAM and 4Gb swap).

PS2 : I am using a swap file and not a swap partition (That's how the new version of ubuntu creates by default)

3
  • 1
    17.04 hibernate issues should be covered by this answer. Can you try please? askubuntu.com/a/892410/14356
    – fossfreedom
    May 10, 2017 at 8:39
  • The s2disk command isn't working. it shows me that it is hibernating, but when I turn the computer on, it doesn't resume, it just do normal boot. May be because the file /etc/initramfs-tool/conf.d/resume is missing in my intsallation ?
    – Sidahmed
    May 10, 2017 at 19:14
  • It's working now when I created the file /etc/initramfs-tool/conf.d/resume and put in it resume=UUID=my_swap_id. I had also to follow this tutorial to allow hibernation from top panel buttons.
    – Sidahmed
    May 10, 2017 at 19:35

2 Answers 2

10

@fossfreedom gave me a link to an answer, the answer is great, but didn't completely solve my problem. So I will put what I did to make my computer hibernate under ubuntu-budgie 17.04

Create Swap File (go to the next step if you already have a swapfile)

These commands create a formatted 4GiB swap file, mounted and added to /etc/fstab:

sudo fallocate -l 4g /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab

Install Userspace Software Suspend (uswsusp)

sudo apt install uswsusp

Verify Swap File Partition

sudo findmnt -no SOURCE,UUID -T /swapfile
> /dev/sda1 11cc33ee-1234-abcd-1234-ddeeff112233

Configure uswsusp

This will create /etc/uswsusp.conf and recreate initramfs using those details:

sudo dpkg-reconfigure -pmedium uswsusp

  • Yes to 'Continue without a valid swap space?' (Wizard hasn't set swap file yet.)
  • Select the partition that the swap-file resides on, cross-reference with details from findmnt above. (Note: not the swap-file itself)

Create the file /etc/initramfs-tools/conf.d/resume if it doesn't exist, and put your swap_id in it like this :

sudo -s
swaplabel /swapfile
> UUID:  81bb07cd-d495-4733-be81-3447f9161f33
echo "RESUME=UUID=81bb07cd-d495-4733-be81-3447f9161f33" > /etc/initramfs-tools/conf.d/resume
update-initramfs -u

Test Hibernate

sudo s2disk

Use s2disk with systemd Hibernate

sudo cp /lib/systemd/system/systemd-hibernate.service /etc/systemd/system/

Edit the new file:

sudo gedit /etc/systemd/system/systemd-hibernate.service

Replace the last line of the file (starts ExecStart=...) with the following:

ExecStart=/usr/sbin/s2disk 
ExceStart=run-parts -a post /lib/systemd/system-sleep

Update the systemd daemon and test hibernate:

sudo systemctl daemon-reload
sudo systemctl hibernate

Allow hibernation from top panel buttons

Open the file :

sudo gedit /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla

and find both sections :

  • [Disable hibernate by default in upower]
  • [Disable hibernate by default in logind]

and change both values from no to yes : enter image description here

1

try:

swapoff /dev/drive/swap 
swapon -f /dev/drive/swap
2
  • Same result. I did notice that I used to have a file called /etc/initramfs-tools/config.d/resume in ubuntu 16.04 , but this files doesn't exist in this installation ; could it be related to this problem somehow ?
    – Sidahmed
    May 9, 2017 at 19:07
  • 1
    Also, I just added it in my question : I am using a swap file and not a swap partition.
    – Sidahmed
    May 9, 2017 at 20:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .