0

I am using ubuntu 20.04 on a machine with 16G RAM and 1T SSD. I used to have a swap partition of 20G and know how to hibernate with swap partition. But I found the partition never used in normal time. So I think it is unreasonable to preserve a swap only for hibernation and I deleted this partition and decided to hibernate with hibernation file. But I am stuck in doing this, even found some answer saying this is impossible. So is there any way to achieve hibernation without swap partition?

The following link would be helpful but I can not understand it fully, https://help.ubuntu.com/community/SwapFaq.

3
  • 1
    If your "hibernate" wants to power off the memory, you'll have to use a swap file or swap partition, so the system can unhibernate from somewhere. – waltinator Jan 1 at 4:10
  • You can use a swapfile, but method is a little different than with swap partition: askubuntu.com/questions/1290326/… – C.S.Cameron Jan 1 at 4:31
  • @Simon: Your link does not mention the requirement for adding a resume_offset when hibernating from a swapfile. You cannot hibernate from a swapfile without it. – C.S.Cameron Jan 1 at 7:43
0

For the FAQ you go down the the section "How do I add a swap file?". When you get the dd command need to multiply the count=# by 20 to get 20GiB of space initialized, so it would be 20971520. Once you have the swap file sorted out, you will need to edit the /etc/default/grub file to add resume=/mnt/20GiB.swap and resume_offset=file_offset. This thread has some good information and links: How to enable hibernate option in Ubuntu 20.04?

I hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.