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?
2 Answers
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.
-
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: i989.photobucket.com/albums/af17/adamjoh/… 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 ;)– AdamSep 14, 2012 at 10:01
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:
swapon PARTITION_NAME
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)
-
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
Sep 13, 2012 at 22:33