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

My system was recently locking up, and I realized that all my ram was all used up. I then inserted an old Hard drive and made an 8gb swap partition to compensate. Swap memory is "not avaliable" which means I need to activate it. How do I do so?

share|improve this question
up vote 2 down vote accepted

Best way to accomplish this permanently is adding a correct line in your /etc/fstab file pointing to the swap partition you created. Then run swapon -a.

Such a line in fstab should look similar to this:

UUID=4139a640-c32e-4e88-b275-75c77722da7c none            swap    sw              0       0

Find the UUID of your swap partition by running blkid and replace it accordingly.

It is also possible to activate it temporarily using swapon by pointing it to the partition directly (see manpage). After reboot it will not be activated again automatically.

share|improve this answer
It worked! :D Many kudos to you, been trying to work this out for ages! I have now got 8 gb of swap in my system monitor:… Btw, when i typed "swapon" i got a list of items, i actually had to type "swapon -a". Ill go reboot now and see what happens ;) – Adam Sep 14 '12 at 10:01
It worked on restart. Thanks – Adam Sep 14 '12 at 10:05

1) Setup swap partition on your drive (You can as well setup Swap file on your current drive)... So: start Gparted and set a partition and make it as swap

2) You can activate it manually by command:


where PARTITION_NAME is something like /dev/sdb1 (according to your drives, check it out correctly)

Now you should find mention of this swap in /proc/swaps

3) You can activate it permanently by editing /etc/fstab Ad line like this:

PARTITION_NAME  swap  swap defaults 0 0

where again PARTITION_NAME is something like /dev/sdb1 (according to your drives, check it out correctly)

share|improve this answer
Looking at the other answer: using UUID instead of /dev/* name is good idea... Also after adding it to /etc/fstab you need to do swapon -a – Jakub Lucký Sep 13 '12 at 22:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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