1

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.

4
  • 2
    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, 2021 at 4:10
  • 1
    You can use a swapfile, but method is a little different than with swap partition: askubuntu.com/questions/1290326/… Jan 1, 2021 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. Jan 1, 2021 at 7:43
  • 2
    Does this answer your question? Hibernate and resume from a swap file
    – eddygeek
    Jun 1 at 0:18

1 Answer 1

1

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.

You must log in to answer this question.

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