Creating swap partition

Swap partition is same thing as pagefile.sys for Windows. When we are using more RAM than we have, pagefile is used to store that extra data from memory.
For this Linux use swap partition. While you install Linux distribution most installers suggest to make swap partition that is twice the size of your RAM.
This is uncommon on VPS because that is a waste of storage on small servers.
But we can create and activate swap partition:

If Swap: 0 0 0 that means we aren’t using any swap partition.

Lets create and activate swap as root user:

Swap partition is use temporary, until we save information about it inside fstab:

Now we can enjoy swap even after reboot.


Leave a Reply

Your email address will not be published. Required fields are marked *