Thursday, January 12, 2012

How to create swap file

Create 1 GB swapfile

dd if=/dev/null of=/swapfile/swapfile.1 bs=1024 count=1048576
mkswap /swapfile/swapfile.1
swapon /swapfile/swapfile.1


To turnoff swap file use


swapoff /swapfile/swapfile.1


Check your memory:
free -m

Use swapon -s to list swapfile in your sytem

You can also add entry in /etc/fstab
/swapfile       none    swap    sw      0       0

and use swapon -a to activate all swapfile


change the /swapfile/swapfile.1 permissions
sudo chmod utgo+rw /swapfile/swapfile.1

No comments:

Post a Comment