Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Adding swap partition after system installation

i have already installed ubuntu 11.04 without any swap partition. Now i want to create swap partition which should be utilized by this os. i have tried creating one by partitioning but ubuntu can not use this swap memory and swap usage remains unused. please tell me how to make it usable by ubuntu.

share|improve this question

marked as duplicate by psusi, bodhi.zazen, mikewhatever, Lekensteyn, htorque Feb 10 '12 at 23:49

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.

@caesium thank for drawing my attention – virpara Feb 10 '12 at 13:36
see here… your same problem – Giulio Jiang Feb 10 '12 at 16:15
up vote 10 down vote accepted

see here Adding swap partition after system installation your same situation

To create a swap partition after an Ubuntu installation create an empty partition that should have no holes. You can then format this partition with

sudo mkswap /dev/sdx

replacing sdx with your partition. Mount this partition as swap with

sudo swapon -U UUID

where UUID is that of your /dev/sdx as read from this

blkid /dev/sdx

Bind your new swap in /etc/fstab by adding this line:

UUID=xxx    none    swap    sw      0   0

If you want to use your swap for hibernating then you need to update the UUID in /etc/initramfs-tools/conf.d/resume with this content RESUME=UUID=xxx. Don't forget to $ sudo update-initramfs -u.

I take no responsibility if something goes wrong.

share|improve this answer

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