Swap space refers to the portion of the virtual memory which is reserved as a temporary storage location.
$ free -mh
$ df -h
# create a 2G swap file $ dd if=/dev/zero of=/myswap bs=1024 count=2048000 # mark the file as swap space $ mkswap /myswap # enable the swap file $ swapon /myswap
$ echo '/myswap none swap sw 0 0' >> /etc/fstab
$ swapoff /var/swap $ rm /swap
Then you should remove the line includes ‘/swap’ from /etc/fstab