This is a short summary for the following instruction: https://ubuntuforums.org/showthread.php?t=1042946
Swapfile activation
# create swapfile (XX stands for your RAM size e.g. 32GB + 1GB => XX=33)
sudo dd if=/dev/zero of=/swapfile bs=1G count=XX
# change swapfile permissions
sudo chmod 600 /swapfile
# make this file as swapfile (ignore UUID)
sudo mkswap /swapfile
# disable all current active swaps
sudo swapoff -a
# activate the new swapfile
sudo swapon /swapfile
# add the new swapfile to the file system table
sudo -b gedit /etc/fstab
# inside fstab: comment out all swap entries and add the following new line:
/swapfile none swap sw 0 0
Hibernate activation
# get partition of the root path
mount | grep " / "
# get UUID of the root partition from above
sudo blkid
# get the UUID of the swapfile
sudo swaplabel /swapfile
# get the "resume_offset"
sudo swap-offset /swapfile
# edit grub
sudo -b nano /etc/default/grub
# set the resume and resume_offset behind "quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=xxxx resume_offset=xxxxx"
# activate the new grub configuration
sudo update-grub
# test hibernate
sudo systemctl hibernate
I am a beginner of ubuntu so followed step by step your message the only problem I had is that I didn’t know which value put in place of yyyyyy!
when I did reboot in the power menu was not resent the “hibernate” possibility!
if from the terminal I give the order sudo hibernate the hibernate works fine also if I get in the terminal “hibernate:Warning: Tuxonice binary signature file not found.” but I have no hibernate on the power menu!. can you help me?
Hi Filippo,
You will get the offset number with the command “sudo filefrag -v /swapfile”
For more detailed description please see the linked article at very beginning of my article.
Thanks for your guide. I tried many many thing and now I am not sure what as the one that in fact worked, but I guess the main thing for me, in addition to the instructions above, was to disable in BIOS the secure boot (as I read in other forums) and the fast boot.
Hi Julio,
thanks for your comment. I didn’t had the problem with the secure boot and fast boot features, maybe the were disabled already. But it may help other people with those problems, thanks.