1

This question already has an answer here:

  • OS: Ubuntu 16.04 LTS,
  • Platform: 64bit,
  • Root partition(/) size: 153.6 GB,
  • Free space in root partition(/): 140.2 GB,
  • Swap partition size: 6 gb,
  • Any free/Unallocated space in disk: No,
  • Dual Boot/Other OS: Yes, Windows 10,
  • Main objective: To be able to hibernate ubuntu

I tried to hibernate my system but it failed. I read in some articles that I must allocate swap space equal to the size of RAM installed on my system to perform hibernate. I have no space left in my hard disk other than Ubuntu root partition so how can I shrink it and add 2 GB to swap to make it 8 GB.

Will it hibernate then? Is there any other way?

marked as duplicate by Pilot6, David Foerster, user364819, Kaz Wolfe, Charles Green Jun 15 '17 at 4:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

I suggest to add a swap file instead of resizing root partition.

First create a empty file somewhere in /

sudo dd if=/dev/zero of=/swapfile bs=1024K count=2000

make it a swap file:

mkswap /swapfile

open /etc/fstab:

sudo nano /etc/fstab

add this line into it:

/swapfile         swap          swap    defaults        0 0

run:

sudo swapon /swapfile

check you swap size:

$ cat /proc/meminfo | grep -i swaptotal
7874913
  • Thanks for answering. Will I be able to hibernate my system then? – Shubhansh Jaiswal Jun 11 '17 at 7:43
  • I don't know if your problem is really related to the swap size, you can test it, if it didn't work you can easily. remove the file and specific line from /etc/fstab – Ravexina Jun 11 '17 at 7:53

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