For those who don’t know what swap is, now I’m just assuming so you can understand…
“It’s like a boss in his office room having a table containing work papers, laptops, coffee cups, books, family photos, etc., well if it’s all full on the table then he needs another spare table to move things That’s it, now the backup table is swap, the main table is main memory and our work papers are files”

When I first installed our Linux, by default I installed 2x RAM swap (if 2GB RAM I installed 4GB swap), those who want to add more swap space or those who forgot or forgot about the 1st time installing Linux or didn’t know swap can follow The method below is what I got from my friend Lintang27…

Immediately, I tested on Fedora 15:

  1. Determine the amount of swap that you want to make, in this tutorial I made 4GB

$ sudo dd if=/dev/zero of=/mnt/4000Mb.swap bs=1M count=4000
The command will create 4000 blocks (count=4000) with the size of each block = 1 MB. So, the total = 4000 MB aka 4 GB.

  1. So that the file settings can’t be read directly. Change the permission to 666

$ sudo chmod 600 /mnt/4000Mb.swap

  1. Swap file format that we have created (to make it a Swap memory device)

$ sudo mkswap /mnt/4000Mb.swap

  1. Add Swap memory on running system

$ sudo swapon /mnt/4000Mb.swap
The swapon command is useful for activating the Swap memory that we just created earlier.

  1. Then the test is active or the swap hasn’t been done (if successful, a swap memory will appear according to how much we made td)

$ cat /proc/meminfo

  1. Set on our new swap boot td (it will automatically turn on when we start our linux system)

$ su

$ sudo gedit /etc/fstab

  1. Add line ne d’ line at the bottom

/mnt/4000Mb.swap none swap sw 0 0
Please save and reboot PC/Laptop

  1. To see changes, type d’terminal

$ free