Posts tagged How to add Additional swap Space on linux

How to add Additional swap Space in linux

Steps to create Additional Swap space :

root@server[#] dd if=/dev/zero of=/home/.additionalswap bs=1M count=4096

root@server[#] mkswap /home/.additionalswap

The mkswap command formats a partition to be used as a swap device

root@server[#] swapon /home/.additionalswap

Swapon is used to specify devices on which paging and swapping are to take place

root@server[#] swapon -s

Display swap usage summary by device. Equivalent to “cat /proc/swaps”

Then to make the changes permanent open the /etc/fstab

root@server[#] vi /etc/fstab

And add this line at the end

/home/.additionalswap none swap defaults 0 0

This will make the changes permanent

That’s all you are done.