0

I use Ubuntu 20.04 LTS which I installed dual boot to Windows. I wanted to add Hibernation as an option. So I installed pm utilities and tried sudo pm-hibernate It did not work. I read somewhere that the swap file should be equal to the size of my RAM. My RAM is 8 GB and my swap file was 1.4 GB (default). I hadn't tampered with anything earlier when I had installed Ubuntu.

Then after looking up, I followed THIS. And I did everything exactly up until about 7 steps where it says to "reboot".

Steps include - doing swapoff -a, adding a # against a UUID in the existing swap file. Creating an 8GB swap file using sudo fallocate -l 8G /swapfile

sudo mkswap /swapfile

sudo chmod 0600 /swapfile

sudo swapon /swapfile

And then I hit reboot. Then it boots to get stuck at HP logo (Ubuntu at the bottom). I tried hard shud down and booting again. It again gets frozen at HP logo.

Did mess anything up? How do I go ahead and fix this?

P.S - I must mention that there were 3 UUID's in the file. I didnt know which one to add a # to. Then I looked up how search for my UUID of the swap file and found my UUID and then hashed only that one.

  • a suggestion: chroot into the system using a live usb with linux and restore fstab to previous state – Andra Jun 05 '22 at 20:11
  • @Andra Alright, I did that. Thanks!

    I went to recovery mode and removed the # from the fstab. Now the swapfile says it's 8GB but it still shuts down, instead of hibernate.

    – Adhesh Sagar Jun 07 '22 at 19:06
  • did you edit grub and add resume? – Andra Jun 07 '22 at 19:30
  • @Andra , Yes. I had. But when I booted back, nothing I was doing was saved. But this ( https://askubuntu.com/a/1321773/1601559 ) answer fixed everything. Got hibernate working now!! – Adhesh Sagar Jun 07 '22 at 19:41

0 Answers0