@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 :

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 ?/etc/initramfs-tool/conf.d/resume
and put in itresume=UUID=my_swap_id
. I had also to follow this tutorial to allow hibernation from top panel buttons.