1
  • 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?

3

1 Answer 1

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
2
  • Thanks for answering. Will I be able to hibernate my system then? Commented Jun 11, 2017 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
    Commented Jun 11, 2017 at 7:53

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