While installing Ubuntu 11.10 a months ago I had not allotted any swap space, I now came to know that there would be no Hibernate option without Swap space.

Is it possible to do it Now?, What if the drives mess up? I have 4 gigabytes of ram, a 500 GB disk and I'm dual-booting with Windows 7.


You can use gparted to resize your partitions and make some space to a new swap partition. Although this works pretty good according to my own experience, before doing it, you should make a backup of all your files just in case.


Make a backup of all your important data before attempting this.

You need to boot from your installation media and use the Gparted application to shrink the filesystem, it is generally recommended to have a swap partition double the size of your RAM. Once you have shrunk the filesystem you should right-click on the now "unallocated space" and format it as swap. Once done, hit the "Apply all operations" button and reboot.

Now you should be back in your main Ubuntu system.

You need to run the gksudo gedit /etc/fstab command and add a line like this:

/dev/sdXY swap swap defaults 0 0

Of course, change the XY to the correct settings for the system.

Finally, reboot or run sudo swapon /dev/sdXY to use the swap without rebooting.

  • isnt there any Sure Shot to this? do i really need to take a backup? Dec 1 '11 at 16:55
  • 3
    Of course, you really do not need to make a back-up. You can resize your partitions without backing up first. It is your choice but if something goes wrong you must take responsibility for the loss of data that may happen. In the past I have resized my partitions and I have not needed to use the back-ups that I have made but it is still a wise thing to do. It is easier to back up your data than to recover corrupted data. We do not want your next question to be: "I lost all my files. How do I get them back?" Dec 1 '11 at 18:42
  • As explained above . To follow the steps you can refer to [this article][1] I found on ubuntubuzz. [1]: ubuntubuzz.com/2011/08/how-to-add-swap-space-on-ubuntu.html Apr 1 '13 at 14:14

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.